简体   繁体   中英

gcloud deploy never finish with Updating service

I'm trying to deploy a python app to App Engine. I've already deploy this app before but for some reason now it upload the files but then write Updating service [default].../ and never finishes.

I'm using Windows 10 and all I can see after few minutes it is running is ERROR: (gcloud.app.deploy) .

The command I run is gcloud app deploy --project my-proj -v 1 --quiet server/app.yaml

I have the server side app in server sub directory.

Any ideas how to diagnose this problem?

UPDATE1 I've run the command with debug flag and I see this come every 5 seconds:

Updating service [default].../DEBUG: Received operation: [apps/my-app/operations/b0647556-93af-4fd8-b0a7-f4ae43393e1e]

DEBUG: Operation [apps/my-app/operations/b0647556-93af-4fd8-b0a7-f4ae43393e1e] not complete. Waiting 5s.

Updating service [default]...-DEBUG: Operation [apps/my-app/operations/b0647556-93af-4fd8-b0a7-f4ae43393e1e] not complete. Waiting 5s.

Updating service [default]...\DEBUG: Operation [apps/my-app/operations/b0647556-93af-4fd8-b0a7-f4ae43393e1e] not complete. Waiting 5s.

Updating service [default].../DEBUG: Operation [apps/my-app/operations/b0647556-93af-4fd8-b0a7-f4ae43393e1e] not complete. Waiting 5s.

DEBUG: Operation [apps/my-app/operations/b0647556-93af-4fd8-b0a7-f4ae43393e1e] not complete. Waiting 5s.

Updating service [default]...|DEBUG: Operation [apps/my-app/operations/b0647556-93af-4fd8-b0a7-f4ae43393e1e] not complete. Waiting 5s.

在我们的例子中,这是由导致 500 错误的软件错误引起的 - 例如,我相信在部署过程中 App Engine 会进行简单的健康检查以验证应用程序是否已成功部署,如果失败,它将永远循环。

I had the same problem, so the solution for me was to deploy the app from console ( https://console.cloud.google.com ). I cloned my git repo in the source code folder, after installing project, I run the command: gcloud app deploy --project [google-project-name]

This was happening to me with the v2 endpoints. For backwards compatibility, I had added the old Servlet mapping of _ah/spi in my web.xml. This caused the application to get stuck at Updating service [default]... and never finish. It looks like just having the mapping for _ah/api works for backwards compatibility, so there must be some backend magic that is happening on the appengine side.

I had exactly the same issue. This is what I found out:

I followed @Daniel Hernandez's suggestion and uploaded the app from a cloned git repository inside cloud shell. It worked.

Then I went ahead and cloned that same repository that was working in cloud shell, but instead I cloned it into another folder in my computer. I deployed the app without any problem.

This made me suspicious so I started looking into what files were different from these two setups. I found out that in my original setup (the one that was failing) I had two extra folders:

env/
lib/

These correspond to the local development folders for virtualenv and the extra libraries. Note that these files were "ignored" from both .gitignore and the skip_files directive in app.yaml .

I deleted these two directories and tried to upload again and it worked.

If you have a new project in my case it was a flag

I had:

"deploy": "gcloud app deploy --project quantified-self-io --quiet --promote --stop-previous-version --version=v1 --verbosity=info",

The flag --stop-previous-version was causing my issue since there was no prev version running I suppose.

Updating Gcloud SDK fixed the issue for me: gcloud components update

As per https://stackoverflow.com/a/52428069/219657

There are probably many different things that can cause this problem, so even though there is an already accepted answer in the OP's case I think it's worth documenting other possibilities on this question.

In my case it occurred because of pip's relatively new backtracking dependency resolver which, due to some underconstrained dependencies in my requirements.txt file, was causing pip to download many versions of some packages in order to determine the right dependencies. This can be very slow and was causing the build to time out. Better constraining my dependencies resolved the issue.

You can see what the build is doing in the Cloud Logs Explorer filtered by the "Cloud Build" resource type. If there is a way to stream these logs via the CLI I'm not sure, but would love to be enlightened if so.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM