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
Percy17mo ago
Project ID: 63950aec-c36d-434c-b844-df746f4067f1
gaby_devrock73
gaby_devrock73OP17mo ago
id servicio: 63950aec-c36d-434c-b844-df746f4067f1
Brody
Brody17mo ago
this server is primarily English, so if you could use English that would be greatly appreciated
gaby_devrock73
gaby_devrock73OP17mo 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
Brody17mo 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_devrock73OP17mo ago
ok correct right away
Brody
Brody17mo ago
let me know when done
gaby_devrock73
gaby_devrock73OP17mo 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
Brody17mo ago
the start script would need to be node index.js now please send me a screenshot of your service variables
gaby_devrock73
gaby_devrock73OP17mo ago
ok, corrected!
Brody
Brody17mo ago
^
gaby_devrock73
gaby_devrock73OP17mo ago
ok how do you see it?
Brody
Brody17mo ago
you haven't sent anything?
gaby_devrock73
gaby_devrock73OP17mo ago
I send it to you privately
Brody
Brody17mo ago
#🛂|readme #5 it's nothing confidential, send it here
gaby_devrock73
gaby_devrock73OP17mo ago
I can't reveal the data here publicly, how do I do it?
Brody
Brody17mo ago
I don't want you to reveal anything, just show me a screenshot
gaby_devrock73
gaby_devrock73OP17mo ago
just the names?
Brody
Brody17mo ago
yes
gaby_devrock73
gaby_devrock73OP17mo ago
ok
gaby_devrock73
gaby_devrock73OP17mo ago
gaby_devrock73
gaby_devrock73OP17mo ago
are ?
MantisInABox
MantisInABox17mo ago
Did you add the environment variables as references, or copy them from the database connection tab directly?
Brody
Brody17mo 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_devrock73OP17mo ago
the name are from my environment variables and the values, which are provided to me by railway
Brody
Brody17mo ago
^
gaby_devrock73
gaby_devrock73OP17mo ago
ok, thanks I will read well how to do it
Brody
Brody17mo 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_devrock73OP17mo ago
ok hello, good afternoon I am resuming the deploy of the project if you can continue?
Brody
Brody17mo ago
^
gaby_devrock73
gaby_devrock73OP17mo 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
Brody17mo ago
^
gaby_devrock73
gaby_devrock73OP17mo ago
gaby_devrock73
gaby_devrock73OP17mo ago
that's ok? I'm already very frustrated I don't understand how it works
gaby_devrock73
gaby_devrock73OP17mo 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
MantisInABox17mo ago
Yes, that is exactly what he was referring to
gaby_devrock73
gaby_devrock73OP17mo 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
MantisInABox17mo ago
Okay, can you send your connection code?
gaby_devrock73
gaby_devrock73OP17mo ago
of course, of course
gaby_devrock73
gaby_devrock73OP17mo ago
gaby_devrock73
gaby_devrock73OP17mo ago
that?
MantisInABox
MantisInABox17mo ago
Is that the database connection?
gaby_devrock73
gaby_devrock73OP17mo ago
Brody
Brody17mo ago
just use MYSQL_URL in your sequlize constructor now
MantisInABox
MantisInABox17mo 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_devrock73OP17mo ago
ok. You say that the names of the variables are replaced by the ones provided by railway?
Brody
Brody17mo ago
^
MantisInABox
MantisInABox17mo 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_devrock73OP17mo 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
Brody17mo ago
new Sequelize(process.env.MYSQL_URL);
new Sequelize(process.env.MYSQL_URL);
this is what ive been telling you to do
MantisInABox
MantisInABox17mo ago
In order to read environment variables with node you need to do process.env.<variable_name>
Brody
Brody17mo 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