Skip to content

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

@bkamin29

Description

@bkamin29

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..

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2high priority issuesbugSomething isn't workingtriagedScoped and ready for work

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions