Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

google_cloudfunctions_function.main : Error : file main.py [...] doesn't exist. #25

Open
bkamin29 opened this issue Dec 6, 2019 · 3 comments
Labels
bug Something isn't working P2 high priority issues triaged Scoped and ready for work

Comments

@bkamin29
Copy link
Contributor

bkamin29 commented Dec 6, 2019

Hello,
I'm systematically encountered an error when running a first terraform apply command from my laptop and after adding a new terraform-google-scheduled-function resource.
I encounter this error by using terraform-google-slo/slo

Trace :

[...]
module.slo-generator.module.slo-hp-fr-latency-1024ms.module.slo-cloud-function.module.main.google_cloudfunctions_function.main: Still creating... [1m40s elapsed]

Error: Error waiting for Creating CloudFunctions Function: Error code 3, message: Function failed on loading user code. Error message: File main.py that is expected to define function doesn't exist

  on .terraform/modules/slo-generator.slo-hp-fr-latency-1024ms.slo-cloud-function.main/terraform-google-modules-terraform-google-event-function-32a9ef5/main.tf line 41, in resource "google_cloudfunctions_function" "main":
  41: resource "google_cloudfunctions_function" "main" {

After re-executing a terraform apply command, the new cloud function is created successfully.

Maybe we don't wait long enough between the event where we push "code" in the storage bucket and the moment where the Clund Function is in creating.
So i have try to add a manual resource dependency (depends_on=) in google_cloudfunctions_function. main, but it's not a success..

@bkamin29 bkamin29 changed the title Error : file main.py [...] doesn't exist. google_cloudfunctions_function.main : Error : file main.py [...] doesn't exist. Dec 6, 2019
@bkamin29
Copy link
Contributor Author

bkamin29 commented Dec 6, 2019

I have try to do my terraform apply in two distinct steps :

  • The first without the resource google_cloudfunctions_function.main enabled (in comment)
  • The second, after somes minutes in with uncommented google_cloudfunctions_function.main resource.

And it's work, not more errors with this procedure.

@morgante
Copy link
Contributor

morgante commented Dec 6, 2019

@taylorludwig Could you do some investigation here?

@morgante morgante added question Further information is requested and removed question Further information is requested labels Dec 6, 2019
@j-flat
Copy link

j-flat commented Feb 23, 2020

Experiencing same issue. "Same" code on my project worked 4-5 months earlier.

@morgante morgante added bug Something isn't working P2 high priority issues triaged Scoped and ready for work labels Feb 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P2 high priority issues triaged Scoped and ready for work
Projects
None yet
Development

No branches or pull requests

4 participants