[go: nahoru, domu]

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

Buildpack cannot find vendored dependencies despite them being included #342

Closed
5 tasks
jamesrwu opened this issue Sep 5, 2023 · 1 comment
Closed
5 tasks
Labels
kind/bug Something isn't working

Comments

@jamesrwu
Copy link
jamesrwu commented Sep 5, 2023

Describe the bug
I am building a POC cloud function that has private dependencies and so have to rely on vendoring my dependencies. However, when trying to deploy the function, buildpack complains that it cannot find vendored dependencies for "github.com/GoogleCloudPlatform/functions-framework-go" despite it being used as an import and seeing the vendored files in the repo.

Full error message:

ERROR: (gcloud.functions.deploy) OperationError: code=3, message=Build failed with status: FAILURE and message: vendored dependencies must include "github.com/GoogleCloudPlatform/functions-framework-go"; if your function does not depend on the module, please add a blank import: _ "github.com/GoogleCloudPlatform/functions-framework-go/funcframework". For more details see the logs at https://console.cloud.google.com/cloud-build/builds;region=.

Additional context
How are you using GCP buildpacks?

  • pack and the gcr.io/buildpacks/builder
  • [:heavy_check_mark:] Cloud Functions
  • Cloud Run
  • Cloud Build
  • App Engine Standard
  • App Engine Flex

Did this used to work?
(Yes/No)
Not sure, this is my first time trying.

What language is your project primarily written in?
Go 1.21.0

Steps To Reproduce
Steps to reproduce the behavior:

  1. gcloud command used:

gcloud functions deploy
${NAME}
--gen2
--no-allow-unauthenticated
--source .
--entry-point=${ENTRYPOINT}
--region=${REGION}
--trigger-http
--runtime=${RUNTIME}
--memory=${MEMORY}
--service-account=${SERVICE_ACCOUNT}
--env-vars-file=env-vars.yaml
${SECRETS_ARGS}

Expected behavior
Expected gcloud deploy command to be successful, or the error message to be correct or more descriptive.

Actual behavior
What actually happened?
Saw the following error message instead of a successful deploy:

ERROR: (gcloud.functions.deploy) OperationError: code=3, message=Build failed with status: FAILURE and message: vendored dependencies must include "github.com/GoogleCloudPlatform/functions-framework-go"; if your function does not depend on the module, please add a blank import: _ "github.com/GoogleCloudPlatform/functions-framework-go/funcframework". For more details see the logs at https://console.cloud.google.com/cloud-build/builds;region=.

If applicable, add screenshots / logs / error messages

@jamesrwu jamesrwu added the kind/bug Something isn't working label Sep 5, 2023
@jamesrwu
Copy link
Author
jamesrwu commented Sep 5, 2023

I realized I was importing "github.com/GoogleCloudPlatform/functions-framework-go/functions" instead of "github.com/GoogleCloudPlatform/functions-framework-go/funcframework". 🤦
Closing this ticket.

@jamesrwu jamesrwu closed this as completed Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant