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

I receive "ERROR: Port should be >= 0 and < 65536. Received NaN." on Elastic Beanstalk #1271

Open
jsindos opened this issue Mar 21, 2023 · 1 comment

Comments

@jsindos
Copy link

jsindos commented Mar 21, 2023

What you are doing?

I'm trying to run npx sequelize-cli db:migrate --env production on an Elastic Beanstalk Node.js instance. The database settings are

  "production": {
    "username": "process.env.RDS_USERNAME",
    "password": "process.env.RDS_PASSWORD",
    "database": "process.env.RDS_DB_NAME",
    "host": "process.env.RDS_HOSTNAME",
    "port": "process.env.RDS_PORT",

What is actually happening?

When I attempt to run the command, I get the following output

npx sequelize-cli db:migrate --env production

Sequelize CLI [Node: 14.18.1, CLI: 6.6.0, ORM: 6.21.0]

Loaded configuration file "settings.json".
Using environment "production".

ERROR: Port should be >= 0 and < 65536. Received NaN.

I've logged process.env.RDS_PORT and am getting the following

console.log('process.env.RDS_PORT', process.env.RDS_PORT)
process.env.RDS_PORT 5432

Dialect: postgres
Sequelize CLI version: 6.6.0
Sequelize version: 6.21.0

@WikiRik
Copy link
Member

WikiRik commented Mar 21, 2023

You are passing a string called "process.env.RDS_PORT", not the actual process.env.RDS_PORT value. Try the following;

  "production": {
    "username": process.env.RDS_USERNAME,
    "password": process.env.RDS_PASSWORD,
    "database": process.env.RDS_DB_NAME,
    "host": process.env.RDS_HOSTNAME,
    "port": process.env.RDS_PORT,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants