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
Project ID:
63950aec-c36d-434c-b844-df746f4067f1
id servicio: 63950aec-c36d-434c-b844-df746f4067f1
this server is primarily English, so if you could use English that would be greatly appreciated
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
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
ok correct right away
let me know when done
There I change the error, this new log: npm WARN config production Use
--omit=dev
instead.
[email protected] start index.jssh:1:index.js:Permission denied
the start script would need to be
node index.js
now please send me a screenshot of your service variablesok, corrected!
^
ok
how do you see it?
you haven't sent anything?
I send it to you privately
#🛂|readme #5
it's nothing confidential, send it here
I can't reveal the data here publicly, how do I do it?
I don't want you to reveal anything, just show me a screenshot
just the names?
yes
ok
are ?
Did you add the environment variables as references, or copy them from the database connection tab directly?
please remove all your current database variables and set them back up as variable references
https://docs.railway.app/develop/variables#reference-variables
the name are from my environment variables and the values, which are provided to me by railway
^
ok, thanks
I will read well how to do it
and show me anothor screenshot of just the service variables after you are done, i dont need to see a screenshot of the plugin
ok
hello, good afternoon
I am resuming the deploy of the project if you can continue?
^
This is the message that the build console throws: npm WARN config production Use
--omit=dev
instead.
[email protected] start index.jssh:1:index.js:Permission denied ok
^
that's ok?
I'm already very frustrated I don't understand how it works
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....?
Yes, that is exactly what he was referring to
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
Okay, can you send your connection code?
of course, of course
that?
Is that the database connection?
just use
MYSQL_URL
in your sequlize constructor nowPerfect. 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 toook.
You say that the names of the variables are replaced by the ones provided by railway?
^
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
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, ^
this is what ive been telling you to do
In order to read environment variables with node you need to do
process.env.<variable_name>
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