Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build phase hangs at preBuild step #2181

Closed
4 tasks done
brendan1212 opened this issue Aug 19, 2021 · 6 comments
Closed
4 tasks done

Build phase hangs at preBuild step #2181

brendan1212 opened this issue Aug 19, 2021 · 6 comments
Labels
archived This issue has been locked. backend-builds question Further information is requested

Comments

@brendan1212
Copy link

Before opening, please confirm:

App Id

dbqqcba2g1b6k/staging/22

Region

us-east-2

Amplify Console feature

Custom builds

Describe the bug

My frontend build phase repeats the preBuild step twice, hanging for a few minutes after the first time, then hanging indefinitely after the second until hitting 30m timeout. Using CLI "latest" version (5.3.0). Triggering deploy manually or via PR trigger creates the same behavior. Tried several times over the past couple hours.

Expected behavior

Should complete build step

Reproduction steps

  1. Trigger deploy via PR merge or manually.

Build Settings

version: 1
frontend:
  phases:
    preBuild:
      commands:
        - nvm install 14.17.0
        - yarn install
    build:
      commands:
        - yarn generate
  artifacts:
    # IMPORTANT - Please verify your build output directory
    baseDirectory: dist
    files:
      - '**/*'
  cache:
    paths:
      - node_modules/**/*

Additional information

                                 # Starting phase: preBuild
                                 # Executing command: nvm install 14.17.0
2021-08-18T22:44:56.045Z [INFO]: Downloading and installing node v14.17.0...
2021-08-18T22:44:56.155Z [WARNING]: Downloading https://nodejs.org/dist/v14.17.0/node-v14.17.0-linux-x64.tar.gz...
2021-08-18T22:44:56.270Z [WARNING]: 
2021-08-18T22:44:56.271Z [WARNING]: 0.6%
2021-08-18T22:44:56.371Z [WARNING]: ##############
2021-08-18T22:44:56.371Z [WARNING]: #####                                                       27.1%
2021-08-18T22:44:56.485Z [WARNING]: #################
2021-08-18T22:44:56.485Z [WARNING]: #############################                            64.6%
2021-08-18T22:44:56.584Z [WARNING]: 
2021-08-18T22:44:56.585Z [WARNING]: #######################################################################  100.0%
######################################################################## 100.0%
2021-08-18T22:44:56.611Z [WARNING]: Computing checksum with sha256sum
2021-08-18T22:44:56.723Z [WARNING]: Checksums matched!
2021-08-18T22:44:57.850Z [INFO]: Now using node v14.17.0 (npm v6.14.13)
2021-08-18T22:44:57.878Z [INFO]: # Executing command: yarn install
2021-08-18T22:44:58.446Z [INFO]: yarn install v1.22.0
2021-08-18T22:44:58.540Z [INFO]: [1/5] Validating package.json...
2021-08-18T22:44:58.542Z [INFO]: [2/5] Resolving packages...
2021-08-18T22:44:59.113Z [INFO]: success Already up-to-date.
2021-08-18T22:43:15.873Z [INFO]: Git SSH Key acquired
2021-08-18T22:43:15.947Z [INFO]: # Cloning repository: [email protected]:financialJoe/web.git
2021-08-18T22:43:15.979Z [INFO]: Agent pid 134
2021-08-18T22:43:16.005Z [INFO]: Identity added: /root/.ssh/git_rsa (/root/.ssh/git_rsa)
2021-08-18T22:43:16.232Z [INFO]: Cloning into 'web'...
2021-08-18T22:43:16.536Z [INFO]: Warning: Permanently added the RSA host key for IP address '140.82.114.3' to the list of known hosts.
2021-08-18T22:43:20.250Z [INFO]: # Switching to commit: fc67672d09b21f5f82b971b03added4341bc7d01
2021-08-18T22:43:20.374Z [INFO]: Agent pid 147
2021-08-18T22:43:20.375Z [INFO]: Identity added: /root/.ssh/git_rsa (/root/.ssh/git_rsa)
                                 Note: switching to 'fc67672d09b21f5f82b971b03added4341bc7d01'.
                                 You are in 'detached HEAD' state. You can look around, make experimental
                                 changes and commit them, and you can discard any commits you make in this
                                 state without impacting any branches by switching back to a branch.
                                 If you want to create a new branch to retain commits you create, you may
                                 do so (now or later) by using -c with the switch command. Example:
                                 git switch -c <new-branch-name>
                                 Or undo this operation with:
                                 git switch -
                                 Turn off this advice by setting config variable advice.detachedHead to false
                                 HEAD is now at fc67672 Merge pull request #165 from financialJoe/cleanup
2021-08-18T22:43:20.381Z [INFO]: Successfully cleaned up Git credentials
2021-08-18T22:43:20.381Z [INFO]: # Checking for Git submodules at: /codebuild/output/src127723909/src/web/.gitmodules
2021-08-18T22:43:20.401Z [INFO]: # Retrieving environment cache...
2021-08-18T22:43:20.445Z [INFO]: # Retrieved environment cache
2021-08-18T22:43:20.445Z [INFO]: ---- Setting Up SSM Secrets ----
2021-08-18T22:43:20.445Z [INFO]: SSM params {"Path":"/amplify/dbqqcba2g1b6k/staging/","WithDecryption":true}
2021-08-18T22:43:20.497Z [INFO]: # Ensuring NPM package '@aws-amplify/cli' is version: 'latest'
2021-08-18T22:43:25.556Z [INFO]: # Patching NPM package '@aws-amplify/cli' from 4.29.4 to 5.3.0...
2021-08-18T22:44:24.631Z [INFO]: # Done patching NPM package '@aws-amplify/cli'
2021-08-18T22:44:24.714Z [INFO]: # Retrieving cache...
2021-08-18T22:44:28.978Z [INFO]: # Extracting cache...
2021-08-18T22:44:34.243Z [INFO]: # Extraction completed
                                 # Starting phase: preBuild
                                 # Executing command: nvm install 14.17.0
2021-08-18T22:44:56.045Z [INFO]: Downloading and installing node v14.17.0...
2021-08-18T22:44:56.155Z [WARNING]: Downloading https://nodejs.org/dist/v14.17.0/node-v14.17.0-linux-x64.tar.gz...
2021-08-18T22:44:56.270Z [WARNING]: 
2021-08-18T22:44:56.271Z [WARNING]: 0.6%
2021-08-18T22:44:56.371Z [WARNING]: ##############
2021-08-18T22:44:56.371Z [WARNING]: #####                                                       27.1%
2021-08-18T22:44:56.485Z [WARNING]: #################
2021-08-18T22:44:56.485Z [WARNING]: #############################                            64.6%
2021-08-18T22:44:56.584Z [WARNING]: 
2021-08-18T22:44:56.585Z [WARNING]: #######################################################################  100.0%
######################################################################## 100.0%
2021-08-18T22:44:56.611Z [WARNING]: Computing checksum with sha256sum
2021-08-18T22:44:56.723Z [WARNING]: Checksums matched!
2021-08-18T22:44:57.850Z [INFO]: Now using node v14.17.0 (npm v6.14.13)
2021-08-18T22:44:57.878Z [INFO]: # Executing command: yarn install
2021-08-18T22:44:58.446Z [INFO]: yarn install v1.22.0
2021-08-18T22:44:58.540Z [INFO]: [1/5] Validating package.json...
2021-08-18T22:44:58.542Z [INFO]: [2/5] Resolving packages...
2021-08-18T22:44:59.113Z [INFO]: success Already up-to-date.
@github-actions
Copy link

Hi 👋, thanks for opening! While we look into this...

If this issue is related to custom domains, be sure to check the custom domains troubleshooting guide to see if that helps. Also, there is a more general troubleshooting FAQ that may be helpful for other questions.

Lastly, please make sure you've specified the App ID and Region in the issue!

@brendan1212
Copy link
Author

I was able to track down the problem in my nuxt static build. However, the logs in console above never showed several lines that it should have in order to understand the source of the problem right off the bat.

In my specific instance, these lines should have shown in the logs before the "hang":

2021-08-20T00:08:31.775Z [INFO]: Done in 0.64s.
2021-08-20T00:08:31.785Z [INFO]: # Completed phase: preBuild
# Starting phase: build
2021-08-20T00:08:31.785Z [INFO]: # Executing command: yarn generate
2021-08-20T00:08:31.913Z [INFO]: yarn run v1.22.0
2021-08-20T00:08:31.948Z [INFO]: $ yarn memory && yarn tw-compile && nuxt generate
2021-08-20T00:08:32.116Z [INFO]: $ NODE_OPTIONS=--max-old-space-size=2048
2021-08-20T00:08:32.289Z [INFO]: $ rm -rf twSafelist.txt && node buildTWSafeList.js
// Problem exists sometime after the last line, above

Is there anything that can be done about this?

@behrooziAWS
Copy link
Contributor

This is the error on our side:

2021-08-20T00:09:21.929Z [WARNING]: [error]  /register
                                    TypeError: Cannot read property 'resolve' of undefined
                                    at a.render (node_modules/vue-router/dist/vue-router.common.js:1099:0)
                                    at server.js:25330:20
                                    at ke (node_modules/@vue/composition-api/dist/vue-composition-api.common.prod.js:15:0)
                                    at a.r.render (node_modules/@vue/composition-api/dist/vue-composition-api.common.prod.js:15:0)
                                    at a.module.exports.t._render (node_modules/vue/dist/vue.runtime.common.prod.js:6:0)
                                    at resolve (/codebuild/output/src570548618/src/web/node_modules/vue-server-renderer/build.dev.js:8415:27)
                                    at waitForServerPrefetch (/codebuild/output/src570548618/src/web/node_modules/vue-server-renderer/build.dev.js:8287:3)
                                    at renderComponentInner (/codebuild/output/src570548618/src/web/node_modules/vue-server-renderer/build.dev.js:8426:3)
                                    at renderComponent (/codebuild/output/src570548618/src/web/node_modules/vue-server-renderer/build.dev.js:8383:5)
                                    at RenderContext.renderNode (/codebuild/output/src570548618/src/web/node_modules/vue-server-renderer/build.dev.js:8294:5)
                                    at RenderContext.next (/codebuild/output/src570548618/src/web/node_modules/vue-server-renderer/build.dev.js:2598:23)
                                    at RenderContext.cachedWrite [as write] (/codebuild/output/src570548618/src/web/node_modules/vue-server-renderer/build.dev.js:2451:9)
                                    at RenderContext.renderNode (/codebuild/output/src570548618/src/web/node_modules/vue-server-renderer/build.dev.js:8305:13)
                                    at RenderContext.next (/codebuild/output/src570548618/src/web/node_modules/vue-server-renderer/build.dev.js:2598:23)
                                    at cachedWrite (/codebuild/output/src570548618/src/web/node_modules/vue-server-renderer/build.dev.js:2451:9)
                                    at renderElement (/codebuild/output/src570548618/src/web/node_modules/vue-server-renderer/build.dev.js:8544:5)
2021-08-20T00:09:29.583Z [WARNING]: ╭──────────────────────────────────────────────────────────────────────────────╮│                                                                              ││   ⚠ Nuxt Warning                                                             ││                                                                              ││   The command 'nuxt generate' finished but did not exit after 5s             ││   This is most likely not caused by a bug in Nuxt                            ││   Make sure to cleanup all timers and listeners you or your                  ││   plugins/modules start.                                                     ││   Nuxt will now force exit                                                   ││                                                                              ││   DeprecationWarning: Starting with Nuxt version 3 this will be a fatal      ││   error                                                                      ││                                                                              │╰──────────────────────────────────────────────────────────────────────────────╯

It should be possible to surface this, I've added a task to research and fix why it is being suppressed.

@ghost ghost added backend-builds question Further information is requested labels Dec 3, 2021
@ghost ghost added the s2 label Jan 27, 2023
@ghost ghost removed the s2 label Mar 17, 2023
@calavera
Copy link
Contributor

This is not an issue anymore. Running those steps work as expected, and the preBuild phase only runs once.

Copy link

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

Copy link

This issue has been automatically locked.

@github-actions github-actions bot added the archived This issue has been locked. label Feb 22, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Feb 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived This issue has been locked. backend-builds question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants