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

deploy cloudrun error: invalid value specified for memory #137

Open
dcaud opened this issue Oct 23, 2021 · 5 comments
Open

deploy cloudrun error: invalid value specified for memory #137

dcaud opened this issue Oct 23, 2021 · 5 comments
Labels
bug Something isn't working
Milestone

Comments

@dcaud
Copy link

dcaud commented Oct 23, 2021

cr_setup_test() passed with flying colors, but with a custom plumber deploy, I get the following error:

starting build "f0asdf6ea9-8174-4052-ab0f-9d4f912asdf108a"

FETCHSOURCE
BUILD
Starting Step #0 - "deploy cloudrun"
Step #0 - "deploy cloudrun": Already have image (with digest): gcr.io/cloud-builders/gcloud
Step #0 - "deploy cloudrun": Deploying container to Cloud Run service [name] in project [name] region [us-east1]
Step #0 - "deploy cloudrun": Deploying...
Step #0 - "deploy cloudrun": failed
Step #0 - "deploy cloudrun": Deployment failed
Step #0 - "deploy cloudrun": ERROR: (gcloud.beta.run.deploy) Invalid value specified for memory with gen2 execution environment. For 1.0 CPU, memory must be between 512Mi and 4Gi inclusive.
Finished Step #0 - "deploy cloudrun"
ERROR
ERROR: build step 0 "gcr.io/cloud-builders/gcloud" failed: step exited with non-zero status: 1

Any ideas how to troubleshoot this?

@dcaud
Copy link
Author

dcaud commented Oct 23, 2021

The error here stems from the fact that in the Cloud Run UI (after a prior successful deployment using cr_deploy_plumber) I went to EDIT & DEPLOY NEW VERSION and selected this option:

"Second generation PREVIEW
File system access, full Linux compatibility, faster CPU performance, slower cold starts."

When I went to redeploy using cr_deploy_plumber it didn't like the second generation. So, I changed it back to first generation and then everything worked.

@MarkEdmondson1234
Copy link
Owner

Can I see the code that you built with? It's saying the CPU/Memory configuration is not the right syntax.

@dcaud
Copy link
Author

dcaud commented Oct 23, 2021

I don't think it was a syntax problem (see my comment above that I posted just before you did). But a problem with "Second Generation."

This works:

cr <- cr_deploy_plumber(my_plumber_folder,
                        cpu = 4,
                        memory= "8Gi",
                        timeout = 3500,
                        max_instances = 20
                        )

(Note that in order for the above to work I changed cr_deploy_plumber according to #126)

@MarkEdmondson1234
Copy link
Owner

Ok interesting looks like I'll need to keep an eye on this new version to see how it affects deployments. Thanks for info!

@MarkEdmondson1234 MarkEdmondson1234 added the bug Something isn't working label Nov 15, 2021
@MarkEdmondson1234 MarkEdmondson1234 added this to the CRAN 0.5.0 milestone Dec 3, 2021
@MarkEdmondson1234
Copy link
Owner

Existing gcloud run docs: https://cloud.google.com/sdk/gcloud/reference/run/deploy
Beta gcloud run docs: https://cloud.google.com/sdk/gcloud/reference/beta/run/deploy

I guess perhaps original error was because "8Gi" was too big when max was "4Gi" according to error message?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants