question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Deployment failed: Error: Status: 403. Message: Node run failed with exit code 2

See original GitHub issue

I’m having troubles getting beanstalk-deploy to work inside my GitHub Actions, keep getting 403 error.

Run einaregilsson/beanstalk-deploy@v1
  with:
    aws_access_key: ABC123
    aws_secret_key: XYZ789
    application_name: our-beanstalk-app
    environment_name: our-beanstalk-app-env
    region: ca-central-1
    version_label: 8
    deployment_package: deploy.zip
  env:
    CI: true
    AWS_ACCESS_KEY_ID: ABC123
    AWS_SECRET_ACCESS_KEY: XYZ789
Uploading file to bucket elasticbeanstalk-ca-central-1-302080953439
##[error]Deployment failed: Error: Status: 403. Message: 
##[error]Node run failed with exit code 2

I installed the package locally and able to successfully run it from the command line:

AWS_ACCESS_KEY_ID=ABC123 AWS_SECRET_ACCESS_KEY=XYZ789 beanstalk-deploy our-beanstalk-app our-beanstalk-app-env 8 ca-central-1 deploy.zip

Any ideas why it’s working from the command line but not via GitHub Actions?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:18 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
varlcommented, Feb 28, 2020

I also got 403 errors when I used $GITHUB_RUN_ID

I changed it to ${{ github.run_id }} and it worked correctly.

I noticed a similar problem when I was using a env var $AWS_REGION for the region key, and that also worked when I changed to use the context syntax: ${{ env.AWS_REGION }}.

1reaction
einaregilssoncommented, Feb 29, 2020

@varl Ah ok I understand. Of course, it makes sense. Can’t use $ENVVAR syntax in parameter values, since that’s not bash, only in strings that are evaluated in the bash shell, e.g. anywhere in a - run: some comand that goes to bash $ENVVAR . In parameter values you must use ${{ env.VAR_NAME }}syntax.

Oh, and by the way, it is possible to just pass in a Dockerrun.aws.json file instead of a zip as well:

Good to know. People read these issues, so good to have this info here 🙂

Read more comments on GitHub >

github_iconTop Results From Across the Web

[error]Deployment failed: Error: Status: 403. Message: #28
im runing a single container with dockerrun.aws.json Hello guys in receiving that error when i use a new version label with: aws_access_key: ${{...
Read more >
node.js - Azure YAML Deployment failing with "Error: Failed to ...
Restarting the App Service solved my problem. My App Service Plan was already a paid subscription and there was no issue with the...
Read more >
Debugging "Make Failed with Exit Code 2" Error - CodeForGeek
The “Make Failed with Exit Code 2” error occurs during the node modules installation. We see lots of stack trace including the one...
Read more >
Command failed with exit code 1: npm run build - Netlify fix 2020
Udemy Courses:- 9 React Projects on Udemy - https://bit.ly/2D83M8c- 9 React Projects on Gumroad ...
Read more >
Troubleshooting Cloud Functions - Google Cloud
Cloud Functions deployment can fail if the entry point to your code, that is, the exported function name, is not specified correctly. The...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found