-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Cloud functions gen2 source repo block does not work π’ β #11408
Comments
Couple things to try;
|
Hi Riley Apologies I copied the wrong snippet. I actually specified The build logs are not very useful, do you have a working snippet at all I could use to help diagnose the issue?
|
We don't happen to have a test for repo mode, unfortunately- it's hard to set up + tear down one of 'em in a test. @k-ezis: If you have a few space cycles, do you spot anything off in that response? Given the API silently rejects one field, I'm a little worried a value in another may be getting silently rejected. |
@rileykarson understood, just was not sure if you had a working example |
@rileykarson or @k-ezis any update on this? |
The official Google documentation says "Deploying from Cloud Source Repositories is not currently supported in Cloud Functions (2nd gen)." So how was it supposed to work in the first place? |
They have also specified that we have to use |
@burnier is correct, Gen2 currently doesn't support deploying from a Cloud Source Repository (docs: https://cloud.google.com/functions/docs/deploy#from-source-repo see note) For Gen2 you'd have to use a source bucket. |
Ideally we'd have omitted the Cloud Source Repositories related fields and added them in later, in order to avoid confusion! Normally we'd consider deprecation for fields that don't currently work, but it sounds like these will start working the future- we could consider amending the docs to state that the feature is currently unavailalable. |
The end-points are (partially) implemented from an API perspective, which is why it was written into the configuration. I'd be good with commenting that functionality out if we think that would clarify this issue. We are doing 2023 planning currently, so the roadmap towards this feature is uncertain at the moment. |
It is pretty sad this wasn't documented because I just rewrote my module to use this after the archive way of handling it failed to work idempotently. I guess API in this case stands for Absolutely Positively Inoperable. :p Hope it is added soon since it would be a much cleaner solution than a zip file in a bucket. |
That google doc comment is odd, because deploying gen2 cloud functions with |
@sharkymcdongles :- Ready condition status changed to False for Revision test-function2-00001-put with message: The user-provided container failed to start and listen on the port defined provided by the PORT=8080 environment variable. Logs for this revision might contain more information. preceded by: Provided module can't be loaded. which I suspect is maybe the result of source code not being pulled in, even though the create payloads between terraform and gcloud look identical if I pass the repo short name in: gcloud functions deploy:
vs. terraform:
so I don't know why there would be a difference in behavior (though I did create a unique user for terraform, so maybe there is a permission breakdown that isn't readily apparent). anyway, wanted to offer the advice of trying the short name to see if things work out better for you. |
I encountered the same issue. However, I am able to successfully deploy it after moving This is my folder structure when error occurs:
This arrangement allows the build to complete and the function works as intended, despite
The partial debug log is as follows:
|
@kylase |
Yes, I was pointing out that it doesn't work if we are using monorepo, unless we can put |
Note: marking as very large because the situation appears fairly complicated w/ the resource |
I discussed this with an API team member and support is blocked on an API change. No known ETA at the moment, but marking upstream until further news. |
This is also true for Node.js runtimes. Hope they can grab some resource and get it to work π . |
Description
It seems its not possible to deploy cloud functions gen 2 using source repositories, there is an error. I am able to deploy a cloud function gen1 using the source repository link but not gen2
Community Note
modular-magician
user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned tohashibot
, a community member has claimed the issue already.Terraform Version
Affected Resource(s)
Terraform Configuration Files
Debug Output
Panic Output
Expected Behavior
Function should deploy as normal
Actual Behavior
Error when deploying cloud function
Steps to Reproduce
terraform apply
Important Factoids
References
b/308248099
The text was updated successfully, but these errors were encountered: