Unable to publish flow (filesha256 error)

I'm trying to upload a flow from a yaml file using the genesyscloud_flow resource but the filesha256 function is failing to find the file to hash.

The yaml file is in the same directory as the .tf files and my resource is configued as per the documentation:

resource "genesyscloud_flow" "flow" {
filepath = "./SimpleFinancialIvr_v2-0.yaml"
file_content_hash = filesha256("./SimpleFinancialIvr_v2-0.yaml")

}

I get the following error however:

│ Error: Error in function call

│ on flow-resources.tf line 87, in resource "genesyscloud_flow" "flow":
│ 87: file_content_hash = filesha256("./SimpleFinancialIvr_v2-0.yaml")
│ ├────────────────
│ │ while calling filesha256(path)

│ Call to function "filesha256" failed: open SimpleFinancialIvr_v2-0.yaml: The system cannot find the file specified..

I'd really appreciate if someone could tell me what I'm doing wrong.

Thanks in advance.

Hi Mark,

  1. Just out of curiosity are you running windows, Linux, or OS X.
  2. I run the exact same code in my own copy of the simple IVR blueprint and I have not had any issues with deploying it. I would be curious to see if you get the same behavior using this:
resource "genesyscloud_flow" "deploy_archy_flow" {
  depends_on = [
    genesyscloud_routing_queue.queue_K401,
    genesyscloud_routing_queue.queue_ira
  ]

    filepath          = "SimpleFinancialIvr_v2-0.yaml"
    file_content_hash = filesha256("SimpleFinancialIvr_v2-0.yaml")     //I took the ./ out of the filepath
}```

Hi John,

Thanks for your reply.

It's running on windows. I made the change that you suggested and I get the same error.

I've also previously tried the full file path but to no avail.

Thanks again

Hi Mark,

A couple of quick questions:

  1. Are you running this inside of a Terraform module?
  2. Have you tried running this with the absolute path of the file? This is more to help diagnose the problem than to offer a solution. I have used this resource dozens of times on Linux and OS X, but never on Windows so I am not sure if there is something unusual going on with path resolution.

Thanks,
John

Thanks,
John

Morning John,

Yes I've tried the absolute path and the result is the same. I've also tried running it in WSL to see if it behaved any differently with Linux but still get the same error.

Thanks.
Mark

Sorry, and yes I'm running it inside a terraform module.

Thanks,
Mark

Hi John,

Thanks for taking the time to look at this. You'll be pleased to know there was nothing wrong with the function, it was user error and I had a superfluous character in the filename.

Thanks again

Mark

Hi Mark,

Glad to hear you resolved it. I know all too well how frustrating those types of bugs are.

Thanks,
John Carnell
Director Developer Engagement

1 Like