R
Railway7mo ago
werscho

Prisma migrate dev error

the issue is like that; when i start project normally. it works and it connect database . there is no problem. but when i try with custom start command so its like that ; "npx prisma migrate deploy && npm start", it give bug which say it cant connect data base. how can i solve this problem. i have to migrate my prisma changes.. please help me erorr is like that; Prisma schema loaded from prisma/schema.prisma Datasource "db": PostgreSQL database "railway", schema "public" at "viaduct.proxy.rlwy.net:38891" Error: P1001: Can't reach database server at viaduct.proxy.rlwy.net:38891 Please make sure your database server is running at viaduct.proxy.rlwy.net:38891. npm WARN config production Use --omit=dev instead. Environment variables loaded from .env Prisma schema loaded from prisma/schema.prisma
52 Replies
Percy
Percy7mo ago
Project ID: N/A
Brody
Brody7mo ago
are you committing your .env file to your repo?
werscho
werschoOP7mo ago
yes but i delete database_url on my env file should i delete whole .env file
Brody
Brody7mo ago
yes, I'm not saying that fixes your issue, but you never want to commit your .env file
werscho
werschoOP7mo ago
No description
werscho
werschoOP7mo ago
how can i try that
Brody
Brody7mo ago
go into the database's setting and remove the tcp proxy, then add it back
werscho
werschoOP7mo ago
okay im trying now thanks a alot i will come back after i tryt i cant see tcp proxy
Brody
Brody7mo ago
screenshot please
werscho
werschoOP7mo ago
No description
Brody
Brody7mo ago
scroll back to the top
werscho
werschoOP7mo ago
No description
Brody
Brody7mo ago
it's right there under public networking, remove it then add the same 5432 port back
werscho
werschoOP7mo ago
No description
Brody
Brody7mo ago
add it back
werscho
werschoOP7mo ago
No description
werscho
werschoOP7mo ago
i got this error i dont understand really it wasnt like that can i connect server with ssh root @....
Brody
Brody7mo ago
have you added the tcp proxy back to the database?
werscho
werschoOP7mo ago
No description
No description
werscho
werschoOP7mo ago
can you connect to my project ? i can give my project id
Brody
Brody7mo ago
i dont work for railway, so i wouldnt have access to such things can you connect to the database locally from something like dbgate
werscho
werschoOP7mo ago
dude you know whats intersting. when i start project without custom start .it connect succesfully
Brody
Brody7mo ago
that is indeed odd
werscho
werschoOP7mo ago
but when i want to migrate project it give error
Brody
Brody7mo ago
can you try to add a 3 second sleep before the migration command
werscho
werschoOP7mo ago
for backend or for database
werscho
werschoOP7mo ago
No description
Brody
Brody7mo ago
i didnt mention anything about app sleeping
werscho
werschoOP7mo ago
i will freak out
Brody
Brody7mo ago
okay?
werscho
werschoOP7mo ago
it doesnt work
Brody
Brody7mo ago
please try adding a 3 second sleep before the migration command
werscho
werschoOP7mo ago
should i delete and restart project?
Brody
Brody7mo ago
no
werscho
werschoOP7mo ago
bro im so sorry i feel like stupid but i have to ask you how can ii add
Brody
Brody7mo ago
whats your current start command and where is it set
werscho
werschoOP7mo ago
No description
Brody
Brody7mo ago
send the start command here please
werscho
werschoOP7mo ago
i alread do it
Brody
Brody7mo ago
in text
werscho
werschoOP7mo ago
npx prisma migrate dev && npm start
Brody
Brody7mo ago
why send an id?
werscho
werschoOP7mo ago
sorry accidenlty
Brody
Brody7mo ago
sleep 3 && npx prisma migrate dev && npm start
werscho
werschoOP7mo ago
im doing now bro
werscho
werschoOP7mo ago
No description
werscho
werschoOP7mo ago
bro can i connect this server with ssh root ? i have to connect
Brody
Brody7mo ago
you are no longer getting connection errors
werscho
werschoOP7mo ago
is there method like that
Brody
Brody7mo ago
there is not, why is that needed though?
werscho
werschoOP7mo ago
bro i solved that thanks a lot
Brody
Brody7mo ago
awsome!
Want results from more Discord servers?
Add your server