google-github-actions / deploy-appengine

A GitHub Action that deploys source code to Google App Engine.
https://cloud.google.com/appengine
254 stars 72 forks source link

Deploy app engine flex just stops half way #349

Closed aaron-tillekeratne closed 9 months ago

aaron-tillekeratne commented 9 months ago

TL;DR

When deploying to app engine flex, logs randomly stop and step errors out.

Expected behavior

Deploy app appropriately.

Observed behavior

Logs stop mid build and errors out. image

Action YAML

name: deploy foo
on:
    push:
        branches: master

permissions:
    id-token: write
    contents: read

jobs:
    deploy:
        runs-on: ubuntu-latest
        environment: 
            name: dev

        steps:
            - name: Checkout repo
              uses: actions/checkout@v4

            - name: Authenticate with Google Cloud
              uses: google-github-actions/auth@v2
              with:
                workload_identity_provider: ${{ secrets.WIF_PROVIDER }}
                service_account: ${{ secrets.DEPLOYER_SA }}

            - name: Build and deploy foo
              uses: google-github-actions/deploy-appengine@v2
              env:
                CLOUDSDK_APP_CLOUD_BUILD_TIMEOUT: 1800
              with:
                build_env_vars: |-
                    BUILD_SECRET=GOES_HERE
                env_vars: |-
                    ENV_VARS=GOES_HERE

Log output

╠═ Uploading 1 file to Google Cloud Storage                 ═╣
╚════════════════════════════════════════════════════════════╝
File upload done.
Updating service [default] (this may take several minutes)...
..........................................done.
----------------------------- REMOTE BUILD OUTPUT ------------------------------
starting build "debe0f91-2eef-4dc2-994f-bd5307f327b6"

FETCHSOURCE
BUILD
Starting Step #0 - "fetcher"
Step #0 - "fetcher": Already have image (with digest): gcr.io/cloud-builders/gcs-fetcher
Step #0 - "fetcher": Fetching manifest gs://staging.****-dev.appspot.com/ae/d501b58b-3da0-4f1c-acf2-52c0be140f86/manifest.json.
Step #0 - "fetcher": Processing 4494 files.
Step #0 - "fetcher": ******************************************************
Step #0 - "fetcher": Status:                      SUCCESS
Step #0 - "fetcher": Started:                     2024-01-19T02:54:55Z
Step #0 - "fetcher": Completed:                   2024-01-19T02:55:05Z
Step #0 - "fetcher": Requested workers:    200
Step #0 - "fetcher": Actual workers:       200
Step #0 - "fetcher": Total files:         4494
Step #0 - "fetcher": Total retries:         77
Step #0 - "fetcher": GCS timeouts:          77
Step #0 - "fetcher": MiB downloaded:       116.08 MiB
Step #0 - "fetcher": MiB/s throughput:      13.98 MiB/s
Step #0 - "fetcher": Time for manifest:   2088.95 ms
Step #0 - "fetcher": Total time:            10.42 s
Step #0 - "fetcher": ******************************************************
Finished Step #0 - "fetcher"
Starting Step #1
Step #1: Already have image (with digest): gcr.io/cloud-builders/docker
Step #1: Sending build context to Docker daemon  125.6MB

Step #1: Step 1/4 : FROM python:3.11
Step #1: 3.11: Pulling from library/python
Step #1: 1b13d4e1a46e: Pulling fs layer
Step #1: 1c74526957fc: Pulling fs layer
Step #1: 30d855997954: Pulling fs layer
Step #1: ad5739181616: Pulling fs layer
Step #1: 75e2b45cbee5: Pulling fs layer
Step #1: ee0d5ad99e90: Pulling fs layer
Step #1: a6382b418b16: Pulling fs layer
Step #1: 31c0f7a3374e: Pulling fs layer
Step #1: ad5739181616: Waiting
Step #1: 75e2b45cbee5: Waiting
Step #1: ee0d5ad99e90: Waiting
Step #1: a6382b418b16: Waiting
Step #1: 31c0f7a3374e: Waiting
Step #1: 1c74526957fc: Verifying Checksum
Step #1: 1c74526957fc: Download complete
Step #1: 1b13d4e1a46e: Verifying Checksum
Step #1: 1b13d4e1a46e: Download complete
Step #1: 30d855997954: Verifying Checksum
Step #1: 30d855997954: Download complete
Step #1: ee0d5ad99e90: Download complete
Step #1: a6382b418b16: Verifying Checksum
Step #1: a6382b418b16: Download complete
Step #1: 75e2b45cbee5: Verifying Checksum
Step #1: 75e2b45cbee5: Download complete
Step #1: 31c0f7a3374e: Verifying Checksum
Step #1: 31c0f7a3374e: Download complete
Step #1: ad5739181616: Verifying Checksum
Step #1: ad5739181616: Download complete
Step #1: 1b13d4e1a46e: Pull complete
Step #1: 1c74526957fc: Pull complete
Step #1: 30d855997954: Pull complete
Step #1: ad5739181616: Pull comple
2024-01-19T02:57:15.5483502Z Post job cleanup.
2024-01-19T02:57:15.6782388Z Removed exported credentials at "/home/runner/work/****/*****/gha-creds-ce94d7e6259e1599.json".
2024-01-19T02:57:15.6958965Z Post job cleanup.
2024-01-19T02:57:15.8260997Z [command]/usr/bin/git version
2024-01-19T02:57:15.8349667Z git version 2.43.0
2024-01-19T02:57:15.8412655Z Temporarily overriding HOME='/home/runner/work/_temp/434a88a9-9943-4813-846f-7a6fec3f52f0' before making global git config changes
2024-01-19T02:57:15.8414523Z Adding repository directory to the temporary git global config as a safe directory
2024-01-19T02:57:15.8419615Z [command]/usr/bin/git config --global --add safe.directory /home/runner/work/*****/*****
2024-01-19T02:57:15.8466223Z [command]/usr/bin/git config --local --name-only --get-regexp core\.sshCommand
2024-01-19T02:57:15.8514580Z [command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
2024-01-19T02:57:15.8852264Z [command]/usr/bin/git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader
2024-01-19T02:57:15.8878170Z http.https://github.com/.extraheader
2024-01-19T02:57:15.8896348Z [command]/usr/bin/git config --local --unset-all http.https://github.com/.extraheader
2024-01-19T02:57:15.8936826Z [command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http\.https\:\/\/github\.com\/\.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
2024-01-19T02:57:15.9592593Z Cleaning up orphan processes

Additional information

No response

sethvargo commented 9 months ago

Can you run with deploy-appengine@main to see if there are more logs in the output?

aaron-tillekeratne commented 9 months ago

interestingly, @main works but if you use with: env_vars: ... it shows the same behaviour as above.

sethvargo commented 9 months ago

main should add more output if you enable debug mode on the GitHub Actions runner.

aaron-tillekeratne commented 9 months ago

Haven't really had a chance to play with this too much; I just created a little script which generated the app.yaml file inside the workflow and deployed the app.

I'll get on to this when I get a bit more time, will close for now.