error al iniciar bbdd en deploy id project: 63950aec-c36d-434c-b844-df746f4067f1

buenas tardes si me pueden orientar, agradezco la ayuda, adjunto los logs: npm WARN config production Use --omit=dev instead.
[email protected] start nodemon index.js
[nodemon] 3.0.1 [nodemon] to restart at any time, enter rs [nodemon] watching path(s): . [nodemon] watching extensions: js,mjs,cjs,json [nodemon] starting node index.js /app/node_modules/sequelize/lib/dialects/postgres/connection-manager.js:147 reject(new sequelizeErrors.ConnectionError(err)); ^ ConnectionError [SequelizeConnectionError]: There was an error establishing an SSL connection at Client._connectionCallback (/app/node_modules/sequelize/lib/dialects/postgres/connection-manager.js:147:20) at Client._handleErrorWhileConnecting (/app/node_modules/pg/lib/client.js:327:19) .... Node.js v18.12.1 [nodemon] app crashed - waiting for file changes before starting... Estaran mal las variables de entorno?
52 Replies
Percy
Percy16mo ago
Project ID: 63950aec-c36d-434c-b844-df746f4067f1
gaby_devrock73
gaby_devrock7316mo ago
id servicio: 63950aec-c36d-434c-b844-df746f4067f1
Brody
Brody16mo ago
this server is primarily English, so if you could use English that would be greatly appreciated
gaby_devrock73
gaby_devrock7316mo ago
please, if you can guide me in the deploy of this project, attach the logs, I have doubts if the error comes from the environment variables, thanks
Brody
Brody16mo ago
this won't fix your issue, but first, please don't use nodemon in your start script on railway, let me know when you have removed nodemon from your start command
gaby_devrock73
gaby_devrock7316mo ago
ok correct right away
Brody
Brody16mo ago
let me know when done
gaby_devrock73
gaby_devrock7316mo ago
There I change the error, this new log: npm WARN config production Use --omit=dev instead.
[email protected] start index.js
sh:1:index.js:Permission denied
Brody
Brody16mo ago
the start script would need to be node index.js now please send me a screenshot of your service variables
gaby_devrock73
gaby_devrock7316mo ago
ok, corrected!
Brody
Brody16mo ago
^
gaby_devrock73
gaby_devrock7316mo ago
ok how do you see it?
Brody
Brody16mo ago
you haven't sent anything?
gaby_devrock73
gaby_devrock7316mo ago
I send it to you privately
Brody
Brody16mo ago
#🛂|readme #5 it's nothing confidential, send it here
gaby_devrock73
gaby_devrock7316mo ago
I can't reveal the data here publicly, how do I do it?
Brody
Brody16mo ago
I don't want you to reveal anything, just show me a screenshot
gaby_devrock73
gaby_devrock7316mo ago
just the names?
Brody
Brody16mo ago
yes
gaby_devrock73
gaby_devrock7316mo ago
ok
gaby_devrock73
gaby_devrock7316mo ago
gaby_devrock73
gaby_devrock7316mo ago
are ?
MantisInABox
MantisInABox16mo ago
Did you add the environment variables as references, or copy them from the database connection tab directly?
Brody
Brody16mo ago
please remove all your current database variables and set them back up as variable references https://docs.railway.app/develop/variables#reference-variables
gaby_devrock73
gaby_devrock7316mo ago
the name are from my environment variables and the values, which are provided to me by railway
Brody
Brody16mo ago
^
gaby_devrock73
gaby_devrock7316mo ago
ok, thanks I will read well how to do it
Brody
Brody16mo ago
and show me anothor screenshot of just the service variables after you are done, i dont need to see a screenshot of the plugin
gaby_devrock73
gaby_devrock7316mo ago
ok hello, good afternoon I am resuming the deploy of the project if you can continue?
Brody
Brody16mo ago
^
gaby_devrock73
gaby_devrock7316mo ago
This is the message that the build console throws: npm WARN config production Use --omit=dev instead.
[email protected] start index.js
sh:1:index.js:Permission denied ok
Brody
Brody16mo ago
^
gaby_devrock73
gaby_devrock7316mo ago
gaby_devrock73
gaby_devrock7316mo ago
that's ok? I'm already very frustrated I don't understand how it works
gaby_devrock73
gaby_devrock7316mo ago
So I modified, eliminated the variables and added them but with the references, I don't know if that is what he was referring to....?
MantisInABox
MantisInABox16mo ago
Yes, that is exactly what he was referring to
gaby_devrock73
gaby_devrock7316mo ago
hi Vin, yes but I'm still getting an error in the build
[email protected] start node index.js
/app/node_modules/sequelize/lib/dialects/postgres/connection-manager.js:131 reject(new sequelizeErrors.ConnectionRefusedError(err)); ^ ConnectionRefusedError [SequelizeConnectionRefusedError]: connect ECONNREFUSED ::1:5432 I have the error in the database connection I think, there it crashes
MantisInABox
MantisInABox16mo ago
Okay, can you send your connection code?
gaby_devrock73
gaby_devrock7316mo ago
of course, of course
gaby_devrock73
gaby_devrock7316mo ago
gaby_devrock73
gaby_devrock7316mo ago
that?
MantisInABox
MantisInABox16mo ago
Is that the database connection?
Brody
Brody16mo ago
just use MYSQL_URL in your sequlize constructor now
MantisInABox
MantisInABox16mo ago
Perfect. Thank you. Can you try commenting out the line at the top that says const { DB_USER, DB_PASSWORD, DB_HOST, DB_NAME, DB_PORT } = process.env; And then replace each of the variables in the connection string to be process.env.DB_<name of variable> This too
gaby_devrock73
gaby_devrock7316mo ago
ok. You say that the names of the variables are replaced by the ones provided by railway?
Brody
Brody16mo ago
^
MantisInABox
MantisInABox16mo ago
If you are going to be the environment variable names you have setup on the service Or do like Brody suggested and use the MYSQL_URL variable
gaby_devrock73
gaby_devrock7316mo ago
I give up, I really don't know how to do it friends, thanks anyway but it keeps crashing:
[email protected] start nodeindex.js
/app/src/db.js:11 database: MYSQLDATABASE, ^
Brody
Brody16mo ago
new Sequelize(process.env.MYSQL_URL);
new Sequelize(process.env.MYSQL_URL);
this is what ive been telling you to do
MantisInABox
MantisInABox16mo ago
In order to read environment variables with node you need to do process.env.<variable_name>
Brody
Brody16mo ago
const { DB_USER, DB_PASSWORD, DB_HOST, DB_NAME, DB_PORT } = process.env; can work, they are just reading the wrong variables from the environment
Want results from more Discord servers?
Add your server