Skip to content
This repository has been archived by the owner on Nov 19, 2023. It is now read-only.

Errors while deploying Cloud Functions #213

Open
sripto opened this issue Sep 15, 2022 · 3 comments
Open

Errors while deploying Cloud Functions #213

sripto opened this issue Sep 15, 2022 · 3 comments

Comments

@sripto
Copy link

sripto commented Sep 15, 2022

Environment: GCE VM running Debian 5.10.136 (amd64)
Go: v1.16 (runtime chosen in GCP cloud functions)

After having installed all the required components and going past the error and fix identified in this issue, I'm encountering the following error:

Error: Error waiting for Creating CloudFunctions Function: Error code 3, message: Build failed: # cloud.google.com/go/storage
/layers/google.go.functions-framework/gopath/pkg/mod/cloud.google.com/go/[email protected]/bucket.go:1504:5: cannot use r.Condition.AgeInDays (type int64) as type *int64 in field value
/layers/google.go.functions-framework/gopath/pkg/mod/cloud.google.com/go/[email protected]/bucket.go:1592:5: cannot use rr.Condition.Age (type *int64) as type int64 in field value; Error ID: 975560ac

 with module.revoke_iam_grants.google_cloudfunctions_function.revoke_member_function,
 on cloudfunctions/iam/revoke/main.tf line 16, in resource "google_cloudfunctions_function" "revoke_member_function":
 16: resource "google_cloudfunctions_function" "revoke_member_function" {

The same error shows up for the following files:

cloudfunctions/bigquery/closepublicdataset/main.tf
cloudfunctions/cloud-sql/removepublic/main.tf
cloudfunctions/cloud-sql/requiressl/main.tf
cloudfunctions/cloud-sql/updatepassword/main.tf
cloudfunctions/filter/main.tf
cloudfunctions/gce/createsnapshot/main.tf
cloudfunctions/gce/openfirewall/main.tf
cloudfunctions/gce/removepublicip/main.tf
cloudfunctions/gcs/closebucket/main.tf
cloudfunctions/gcs/enablebucketonlypolicy/main.tf
cloudfunctions/gke/disabledashboard/main.tf
cloudfunctions/iam/enableauditlogs/main.tf
cloudfunctions/iam/revoke/main.tf
cloudfunctions/router/main.tf

Could someone point me in the right direction to get past this error? Is there any updated code base that fixes all outstanding bugs/issues?

Thank you for any help on this.

@yashrath07
Copy link

yashrath07 commented Sep 21, 2022

I see the same error for all the cloud functions. I started encountering the same issue a few days back.

` Error: Error waiting for Creating CloudFunctions Function: Error code 3, message: Build failed: # cloud.google.com/go/storage
/layers/google.go.functions-framework/gopath/pkg/mod/cloud.google.com/go/[email protected]/bucket.go:1504:5: cannot use r.Condition.AgeInDays (type int64) as type *int64 in field value

/layers/google.go.functions-framework/gopath/pkg/mod/cloud.google.com/go/[email protected]/bucket.go:1592:5: cannot use rr.Condition.Age (type *int64) as type int64 in field value; Error ID: 975560ac

with module.close_public_cloud_sql.google_cloudfunctions_function.close-cloud-sql,
on cloudfunctions/cloud-sql/removepublic/main.tf line 14, in resource "google_cloudfunctions_function" "close-cloud-sql":
14: resource "google_cloudfunctions_function" "close-cloud-sql" {`

Any help on this is appreciated.

@vFawzi
Copy link

vFawzi commented Jun 28, 2023

+1 here, I am getting below error (sample for one function)

Error: Error waiting for Creating CloudFunctions Function: Error code 3, message: Build failed: # golang.org/x/sys/unix
│ /layers/google.go.functions-framework/gopath/pkg/mod/golang.org/x/[email protected]/unix/syscall.go:83:16: undefined: unsafe.Slice
│ /layers/google.go.functions-framework/gopath/pkg/mod/golang.org/x/[email protected]/unix/syscall_linux.go:1018:20: undefined: unsafe.Slice
│ /layers/google.go.functions-framework/gopath/pkg/mod/golang.org/x/[email protected]/unix/syscall_linux.go:2297:9: undefined: unsafe.Slice
│ /layers/google.go.functions-framework/gopath/pkg/mod/golang.org/x/[email protected]/unix/syscall_unix.go:118:7: undefined: unsafe.Slice
│ /layers/google.go.functions-framework/gopath/pkg/mod/golang.org/x/[email protected]/unix/sysvshm_unix.go:33:7: undefined: unsafe.Slice
│ note: module requires Go 1.17; Error ID: 6fba28bd

│ with module.filter.google_cloudfunctions_function.filter,
│ on cloudfunctions/filter/main.tf line 15, in resource "google_cloudfunctions_function" "filter":
│ 15: resource "google_cloudfunctions_function" "filter" {

@vFawzi
Copy link

vFawzi commented Jun 28, 2023

Updating the tf runtime for Go to 119 solved the issue
unsafe.Slice was added in Go 1.17 and Cloud Functions (frustratingly) hasn't evolved beyond Go 1.16. unsafe.Slice is returned by syscall.go:83.16

Source https://stackoverflow.com/questions/74049351/gcloud-functions-deploy-go-runtime-error-undefined-unsafe-slice-error-id-2f5

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants