Google App Engine: "GET /_ah/start HTTP/1.1" 500 - google-app-engine

I have a Google App Engine python apps deployed without problems. I changed some logging and redeployed, two things happened:
The endpoint keep returning "GET /_ah/start HTTP/1.1" 500
On GCP dashboard under App/Version I see that there are not instances on the latest version of my app. (I manually migrated the service on the last version of working in the image below)
This looks like they are having internal problems Google Cloud, or I am doing something wrong? Is there a way to manually allocate instance on the latest version of my GAE? It should be automatic to my understanding.

Automatically migrating the traffic to a newly deployed version depends on the options used for deployment. From gcloud app deploy:
--promote
Promote the deployed version to receive all traffic. Overrides the
default app/promote_by_default property value for this command
invocation. Use --no-promote to disable.

Related

Set goproxy in cloud build on deploying to appengine

We are deploying our Go app to Google app engine with the command: gcloud app deploy
This creates a cloud build, which normally works fine. However, sometimes there are some dependencies which are flaky (sometimes unavailable or down) or gone (revision no longer existing).
These issues break our complete deploy and build and we can only get rid of the dependency or wait until it is fixed on that side.
Solution for this is using a proxy for the go dependencies (like https://proxy.golang.org/), but I don't have any way of setting this setting for our app engine deployments.
Does anyone know how I can use a proxy for google app engine deploys to make our builds more stable?

Google App Engine: Build Timed Out during Deployment

Edit: Google Cloud at its finest. Made absolutely no changes but deployed fine this morning.
Error after ~10m of deployment (10+ deploy attempts).
I've changed the app to add a simply function with less than 10 lines of code. It has no affect on libraries and uses native python only and hence I'm not sure how it can affect the deployment.
I've tested the app and it runs fine locally.
Here is the error that I get:
ERROR: (gcloud.app.deploy) Cloud build failed. Check logs at
https://console.cloud.google.com/xxxxxxxx/ Failure status: UNKNOWN:
Error Response: [4] DEADLINE_EXCEEDED
Previously to that, logs don't show any errors, in fact everything is going as expected.
Newest entries first:
9302e2430a0e: Pushed
4f56eb74b6bf: Pushed
21df82f90a72: Layer already exists
f0e2b3558b28: Layer already exists
99c71ba2c817: Layer already exists
2483da9621d1: Layer already exists
af09d2110abe: Layer already exists
d968669f4b42: Pushed
4b1e707066a6: Layer already exists
55530b72c8c8: Layer already exists
62c169a7d462: Layer already exists
According to this you can change the build timeout setting with:
gcloud config set app/cloud_build_timeout 1000
Setting it to 1000 seconds in this example.
I have this problem too when deploying my custom image to AppEngine flex. My image requires a few ML models and takes around 2 hours to build and GAE does not seem to like it.
To build your container images outside of Google Cloud Platform, you must first upload your images to a container image repository before you can deploy your images to App Engine with the gcloud app deploy command.
In short, push your image to Google Container Registry or container image repository of your choice, then deploy with this command
gcloud app deploy --image-url gcr.io/YOUR_PROJECT_ID/YOUR_CONTAINER_IMAGE
More info here and here
For my case, I've found out the problem was that I have the same version for all gcloud app deploy command.
When there's traffic, the deployment will timeout.

Deploying Push Queues in Google Cloud

I'm deploying an app in Google Cloud that has multiple microservices. For one of them, I wish to use a push queue. I configured my queue.yaml file as follows:
queue:
- name: equeue
rate: 10/s
retry_parameters:
task_retry_limit: 1
task_age_limit: 2d
I spin up the SDK and the queue is working fine, just as it should. But then I go to push it to my app on Google Cloud using:
gcloud app deploy --project=<projectname> --promote --stop-previous-version
The code all loads correctly, but the queue never gets created. I am getting errors from my code as follows:
API error 1 (taskqueue: UNKNOWN_QUEUE)
And when I look in the console, on https://console.cloud.google.com/appengine/taskqueues, the queue has not been created.
I've read the documentation and it seems to indicate that all I need to do is create the queue.yaml file and deploy the app (and that has worked for me in the past, albeit with an older version of the SDK.)
In case it helps, here are the components I'm running locally:
Google Cloud SDK 164.0.0
app-engine-go
app-engine-python 1.9.57
bq 2.0.24
core 2017.07.25
gcloud
gsutil 4.27
Thanks!
Dan
The queue.yaml is an app-level configuration file, not a service-specific one. See (marginally related) Why do I need to deploy a "default" app before I can deploy multiple services in GCP?
While in a single service app case deploying the default service might also update one or more of these app-level configs that is not guaranteed in a multi-service app case. Which is why each of these configs also comes with an individual dedicated method of deployment which can be performed independently of and/or without updating any of the app's services.
For queue.yaml in particular deployment can be done using gcloud app deploy:
gcloud app deploy [...] queues.yaml
or, if you're using the GAE SDK, using appcfg.py update_queues:
appcfg.py update_queues -A <app_id>

Google App Engine Flex Throws 502 After adding Cloud Endpoints

I have an app running on App Engine Flex (Google Go Runtime with a couple extra file in the docker runtime). It was working fine, with no issues.
I then added Google Cloud Endpoints and all of a sudden I was getting 502s for every request, both going directly to the app & going through Cloud Endpoints.
Logging into the instance, it looks like the nginx-proxy itself is throwing errors.
Downloading Endpoints Service Configuration to /etc/nginx/endpoints/service.json
curl: (22) The requested URL returned error: 403 Forbidden
Failed to obtain Endpoints Service Configuration from Service Management API
/sbin/start-stop-daemon: warning: failed to kill 26: No such process
The only addition to the app.yaml is
endpoints_api_service:
name: "redacted.appspot.com"
config_id: "2017-06-01r0"
I'm running the latest version of gcloud. I was getting 403 forbidden when deploying the openapi.yaml file, and then I updated to the latest gcloud which fixed that issue. Not sure if that's related or not.
Has anyone even encountered this before?
From Cloud Console UI, could you double check if your project has "Google Service Management API" enabled?
If already enabled, you can SSH into your Flex vm, and fetch the access token by:
curl -H "Metadata-Flavor: Google" http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/token
Then you can use this URL to check its scopes
https://www.googleapis.com/oauth2/v3/tokeninfo?access_token=
Turns out the core issue was that the version of gcloud I first used to upload google cloud endpoints allowed me to use an unsupported parameter (File). After switching to a wildcard, everything worked.

Why is appengine serving an old version of my nodejs express app on https but the latest one properly on http appspot?

I have run gcloud app deploy many times over the past 12 hours. When I run gcloud app browse my browser opens up https://mysite.appspot.com with some old version of my app from hours ago. I Can't even tell which at this point. However, if I visit http://mysite.appspot.com (wihout TLS) I get my new, expected version.
I've restarted the versions with the GCP console but have had no success in seeing my latest version at https://mysite.appspot.com. The console even says that the proper version is serving with 100% allocation, and indeed it is, over at http but not at https.
my app.yaml has only these 2 lines per the documentation
env: flex
runtime: nodejs
What am I doing wrong?

Resources