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
Project ID:
N/A
are you committing your .env file to your repo?
yes but i delete database_url on my env file
should i delete whole .env file
yes, I'm not saying that fixes your issue, but you never want to commit your .env file
how can i try that
go into the database's setting and remove the tcp proxy, then add it back
okay im trying now
thanks a alot
i will come back
after i tryt
i cant see tcp proxy
screenshot please
scroll back to the top
it's right there under public networking, remove it then add the same 5432 port back
add it back
i got this error
i dont understand really
it wasnt like that
can i connect server with ssh root @....
have you added the tcp proxy back to the database?
can you connect to my project ?
i can give my project id
i dont work for railway, so i wouldnt have access to such things
can you connect to the database locally from something like dbgate
dude
you know whats intersting. when i start project without custom start .it connect succesfully
that is indeed odd
but when i want to migrate project
it give error
can you try to add a 3 second sleep before the migration command
for backend or for database
i didnt mention anything about app sleeping
i will freak out
okay?
it doesnt work
please try adding a 3 second sleep before the migration command
should i delete and restart project?
no
bro im so sorry i feel like stupid but i have to ask you how can ii add
whats your current start command and where is it set
send the start command here please
i alread do it
in text
npx prisma migrate dev && npm start
why send an id?
sorry
accidenlty
sleep 3 && npx prisma migrate dev && npm start
im doing now bro
bro can i connect this server with ssh root
?
i have to connect
you are no longer getting connection errors
is there method like that
there is not, why is that needed though?
bro i solved that thanks a lot
awsome!