When I run gcloud preview app deploy with Cloud SDK version 105.0.0, I get the following error message:
ERROR: gcloud crashed (MaxRetrialsException): last_result=(None, (<class 'googlecloudsdk.calliope.exceptions.BadFileException'>, BadFileException('[.../source-context.json] not found or not accessible',), <traceback object at 0x7f7bb4ab07e8>)), last_retrial=3, time_passed_ms=1,time_to_wait=0
This is a known issue, and is fixed in the 106.0.0 Cloud SDK release. Please update to that release.
If you cannot, work around by running:
gcloud config set app/use_gsutil true
This particular issue happens when using gcloud to deploy to a 'standard' (as opposed to a 'managed VM' or 'flexible') App Engine app that has a .git directory.
Related
I have just deployed an app on Google App Engine using gcloud app deploy and I get a warning such as below:
WARNING: There is a dependency on App Engine APIs, but they are not enabled in your app.yaml. Set the app_engine_apis property.
So what I did was to include app_engine_apis: true in the app.yaml, saved it, and proceed to gcloud app deploy again. However I'm still getting the same warning. What am I missing?
I fixed the warning by running:
google beta app deploy
instead of
google app deploy
I got the fix from this document. I believe it's necessary because at the time of this answer the migration of the python2 app_engine_apis to python3 isn't complete.
When I try to publish an ASP.NET Core 2.1 Web Application to Google Cloud Platform App Engine I get the error gcloud crashed (error): bad character range.
I publish with the GCP Visual Studio 2017 extension and I get the above error.
I publish from the cmd with an app.yaml in my project and I get the above error.
In order to deploy the ASP.NET Core 2.1 web application to Google Cloud App Engine I added an app.yaml file with the following contents:
runtime: aspnetcore
env: flex
I did the following:
Added app.yaml with
runtime: aspnetcore
env: flex
Added it to csproj
<ItemGroup>
<None Include="app.yaml" CopyToOutputDirectory="Always" />
</ItemGroup>
And executed the command
gcloud beta app deploy ./bin/release/netcoreapp2.1/publish/app.yaml
However I got the error: gcloud crashed (error): bad character range
Anyone know what I am doing wrong?
I follow the following guide and still get the same error when I try method 1, 2 and 3: https://cloudplatform.googleblog.com/2017/10/4-ways-you-can-deploy-an-ASP.NET-Core-app-to-GCP.html
This issue is being investigated at the moment and a fix should be released soon. As a workaround, please downgrade your Cloud SDK version to 212.0.0 by running the following command:
gcloud components update --version 212.0.0
Downgrading the version of your Cloud SDK to 212.0.0 or lower works because it seems in version 213.0.0 some changes were implemented that caused an issue with the yaml parser used by gcloud.
In addition, please follow this Issue Tracker thread to get updates regarding the status of this issue.
You should navigate to the publish directory first and deploy from there. Make sure the app.yaml file is present in the publish directory.
dotnet publish -c Release
cd ./bin/Release/netcoreapp2.1/publish
gcloud app deploy
When I run gcloud app deploy to deploy my Go application, I get the following error message:
"Please verify that you have execute permission for allfiles in your CLOUD SDK bin folder"
How do I resolve it?
This is due to an issue with the Cloud SDK 160.0.0 release. The bad release has been rolled back. Run:
gcloud components update
and try again.
I have an app that uses "github.com/gorilla/mux" and I am able to deploy it with goapp deploy. But I cannot do the same with gcloud preview app deploy because I am facing this error:
Beginning deployment...
Copying files to Google Cloud Storage...
Synchronizing files to [<googlecloudsdk.api_lib.app.cloud_storage.BucketReference object at 0x10514e790>].
File upload done.
Updating module [api]...failed.
ERROR: (gcloud.preview.app.deploy) Error Response: [9] Deployment contains files that cannot be compiled: Compile failed:
2016/03/22 09:06:40 go-app-builder: build timing: 1×6g (42ms total), 0×6l (0 total)
2016/03/22 09:06:40 go-app-builder: failed running 6g: exit status 1
api.go:29: can't find import: "github.com/gorilla/handlers"
I want to be able to do it because I need to deploy from travisCI on merge and I want to use service-client.json for authorisation.
Is there any way around it?
Since Google Cloud SDK 142.0.0 with app-engine-go 1.9.50, you should be able to deploy your application doing
gcloud beta app deploy
This also enables you to use CI/CD tools
To answer your question directly, the way around this would be to use goapp deploy as is recommended by the App Engine documentation for the Go standard environment, Deploying a Go App. At the time when gcloud preview app deploy was available, goapp was recommended precisely for handling go's specific environment and dependency requirements.
Alternatively, if you're looking to use gcloud, you would need to use gcloud app deploy now. gcloud preview app deploy has been deprecated and/or removed as of June 29, 2016.
I have gcloud installed and working and a service account gets also activated. I run the following and get a success(?):
$ gcloud auth activate-service-account "${GAE_CLIENT_ACCOUNT}" --key-file "${GAE_CLIENT_KEY_JSON_FILE}"
Activated service account credentials for: [xxxxx#developer.gserviceaccount.com]
Then I run this:
$ gcloud preview app deploy app.yaml --project "${GAE_PROJECT_ID}" --quiet --version "${GAE_PROJECT_VERSION}"
You are about to deploy the following modules:
- ricochet-robots/default/dev From: [/home/travis/build/ricochetrobots/ricochetrobots-landing/app.yaml]
Updating module [default]...Go to the following link in your browser:
https://accounts.google.com/o/oauth2/auth?scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fappengine.admin&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&response_type=code&client_id=xxxxxxxx.apps.googleusercontent.com&access_type=offline
Updating module [default].../
As you can see, it prompts me to follow the link and do an oauth. Because I'm on a ci server, it's not possible to follow the link.
How kan I suppress that? Or is there a totally diffrent way of deploying the app automatically.
This is a known issue in version 0.9.61.
For now, you can work around by pinning to a previous version:
gcloud config set component_manager/fixed_sdk_version 0.9.60
gcloud components update
Since you're running in a CI server, you can also set the following environment variable, if you run gcloud components update in your script. This may be an easier fix, depending on your CI server.
CLOUDSDK_COMPONENT_MANAGER_SNAPSHOT_URL=https://dl.google.com/dl/cloudsdk/release/components-v0.9.60.json
Running gcloud preview app deploy --set-default using a service account has the same issue in versions 0.9.57 through 0.9.62. If you'd like to use this command, you can pin to 0.9.56.
We're targeting a fix for version 0.9.63 or shortly thereafter. Follow the issue on the gcloud bug tracker for more updates.
EDIT: This issue was fixed in version 0.9.63.