Error deploying Go apps to Google App Engine - google-app-engine

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.

Related

Why am I still getting a warning after including app_engine_apis in app.yaml?

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.

Deploy ASP.NET Core 2.1 app to Google Cloud App Engine error: bad character range

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

Google Cloud error 13: An internal error occurred when running gcloud app deploy in console

Recently I added a friend to my project and gave her Owner, App engine admin, app engine deploy rights but when she tries to publish her changes and make a current version she gets error 13: An Internal error occurred.
She runs the command gcloud app deploy.
Can someone help us?
Try with a default app.yaml configuration, and then, if ok, put your config line per line.

`gcloud preview app deploy` gives MaxRetrialsException in version 105.0.0

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.

how to deploy golang app with dependencies to the app engine with gcloud?

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.

Resources