You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Put your logs below this line
2023-06-22T15:45:42.639Z [INFO]: Git SSH Key acquired
2023-06-22T15:45:42.742Z [INFO]: # Cloning repository: git@gitlab.com:user/repo.git
2023-06-22T15:45:46.656Z [INFO]: Agent pid 157
2023-06-22T15:45:46.740Z [INFO]: Identity added: /root/.ssh/git_rsa (/root/.ssh/git_rsa)
Cloning into 'repo'...
Warning: Permanently added the ECDSA host key for IP address '172.65.251.78' to the list of known hosts.
2023-06-22T15:45:46.741Z [INFO]: # Switching to commit: [COMMIT-HASH]
2023-06-22T15:45:46.894Z [INFO]: Agent pid 170
2023-06-22T15:45:46.895Z [INFO]: Identity added: /root/.ssh/git_rsa (/root/.ssh/git_rsa)
Note: switching to '[COMMIT-HASH]'.
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 [SHORT-COMMIT-HASH] remove spaces added to trigger backend-name graphql/pt lambda push
2023-06-22T15:45:46.905Z [INFO]: Successfully cleaned up Git credentials
2023-06-22T15:45:46.906Z [INFO]: # Checking for Git submodules at: /codebuild/output/src654124366/src/repo/.gitmodules
2023-06-22T15:45:46.912Z [INFO]: # Retrieving environment cache...
2023-06-22T15:45:46.965Z [INFO]: # Retrieved environment cache
2023-06-22T15:45:46.965Z [INFO]: ---- Setting Up SSM Secrets ----
2023-06-22T15:45:46.965Z [INFO]: SSM params {"Path":"/amplify/hash/backend-name/","WithDecryption":true}
2023-06-22T15:45:47.024Z [INFO]: # Determining if there are buildable backend changes in the amplify directory of the repository...
2023-06-22T15:45:47.037Z [INFO]: # Last built commit: [COMMIT-HASH]
2023-06-22T15:45:47.046Z [INFO]: # No differences detected.
2023-06-22T15:45:47.055Z [WARNING]: Command failed: source ~/.bashrc 2> /dev/null || true && nvm current
2023-06-22T15:45:47.056Z [INFO]: # Patching NPM package '@aws-amplify/cli' to 12.0.3...
2023-06-22T15:45:47.317Z [INFO]: npm
2023-06-22T15:45:47.318Z [INFO]: ERR! `user` is not a valid npm option
2023-06-22T15:45:47.319Z [INFO]:
2023-06-22T15:45:47.320Z [INFO]: npm ERR! A complete log of this run can be found in: /root/.npm/_logs/2023-06-22T15_45_47_248Z-debug-0.log
2023-06-22T15:45:47.322Z [ERROR]: !!! Error patching NPM package '@aws-amplify/cli' to version 12.0.3. Verify the package name and version are correct, and retry the build. For help see our docs: https://docs.aws.amazon.com/amplify/latest/userguide/custom-build-image.html
2023-06-22T15:45:47.323Z [WARNING]: ! Unable to patch packages...
2023-06-22T15:45:47.323Z [INFO]: # Starting environment caching...
2023-06-22T15:45:47.323Z [INFO]: # Uploading environment cache artifact...
2023-06-22T15:45:47.425Z [INFO]: # Uploaded environment cache artifact
2023-06-22T15:45:47.425Z [INFO]: # Environment caching completed
Hi @mohammedsahl 👋 , thanks for reaching out. I observed that the latest builds on your Amplify app d2d6ty1wlg8jch have completed successfully. Also, I wasn't able to reproduce the outlined behavior when using a custom build image with npm v9. By default, the Amazon Linux:2023 build image has npm v9 and Amplify CLI v12.8.2 installed. Now, if you add a live package override to set the Amplify CLI package to the latest version, the patching does complete successfully at build time:
# Patching NPM package ‘@aws-amplify/cli’ from 12.8.2 to 12.10.1...
2024-02-14T19:35:38.559Z [INFO]: # Installed ‘@aws-amplify/cli@12.10.1’
2024-02-14T19:35:38.711Z [INFO]: # Done patching NPM package ‘@aws-amplify/cli’ to version 12.10.1
I see that your app is using a custom image hosted on Amazon ECR and the root cause seems related to the npm configuration on the custom image. Its very likely that this breaking change introduced with npm v9 led to the patching to fail.
I am going to close this thread since the latest builds have succeeded.
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.
Before opening, please confirm:
App Id
d2d6ty1wlg8jch
AWS Region
us-east-1
Amplify Hosting feature
Build settings, Deployments, Frontend builds
Frontend framework
Angular
Next.js version
N/A
Next.js router
N/A
Describe the bug
Amplify CD fails when trying to patch Amplify CLI to 12.0.3. This started after our build image upgraded the version of npm being used to 9
Expected behavior
The build runs to completion without failing
Reproduction steps
Build Settings
Log output
Additional information
I suspect it has something to do with this
The text was updated successfully, but these errors were encountered: