My server failed to response after migrating to new database
Checking the log is still ok but calling the custom domain (as well as
my-server.up.railway.app
domain) still can not response. It happens on production! Please help!67 Replies
Project ID:
28677a80-2aaf-46d7-8fff-e2898fa09eb1
28677a80-2aaf-46d7-8fff-e2898fa09eb1
I tried to restart, as well as redeployed, still not respond. 🥹
nothing bad in the logs at all?
yeah, the log is green, just fail when trying to reach the domain
the last thing I did is
Migrate your plugin to a V2 database
the log is green? have you check the deployment logs though?
hmm, let me double check
I found
and this
think I'm gonna tag in @jr here
the migration look like ok
Do I HAVE TO delete old services?
no
ok I will leave it there at least for a couple days
Hey, Just checking things out here. The migration and databases look okay
after migrating the Postgres, I do the Redis as well
It looks like the server is just failing to start fully
But there are no errors or anything. Can you trying to kick off another deployment
I see one thing
where do you see that? Perhaps I am looking at the wrong deployment
like the server can not connect to redis server (while on migration...)
can you send the full link to these logs please
ty
those errors appear to be from an older deployment
Can you try redeploying plz
yeah, I will do it now
hmm yeah, so seems to just halt after initialing the
FilesModule
. Can we try changing the start command to sleep 3 && node apps/server/dist/main.js
still the same
hmm its hanging at the same spot. Can you try pointing at the previous databases. Trying to narrow down what the issue is. You can update the variables
If possible it might also be useful to increase the verbosity of Nestjs logging?
I will update the db url first
Interesting, so that is fully crashing around the same spot. Likely the same thing
6379 is the redis, right?
oh mb! It should be
${{ Redis Legacy.REDIS_URL }}
. Not DATABASE_URL
I've updated thisoh damn I did not see it
let's wait for it redeploys
ah okay that works. So it must be an issue connecting to one of the databases. Can you try just connecting to the new postgres? So we can narrow it down
using the new DATABASE_URL, I can connect using TablePlus app
Yeah both of the migrated databases look okay
It seems to be an issue with the app connecting
is there anything change (in technology) with the new?
we use Prisma with PostgresQL client adapter under the hood
pg 14 to pg 15 is one thing i can think of
Can you try narrowing down which database is having the issue
actually I can not log in using old database 😦
I still can see the tables using TablePlus, but my NestJS app authentication can not login
do you know where the auth is failing? Nothing was changed on the old database at all
1 sec
my bad, it works well with old database
I was using wrong username/password
so, the old db works perfect
I am unsure if it is failing to connect to redis or postgres
hmmm
the new redis
should I try to redeploy the new redis?
Can you connect with that command?
I need to install redis cli
1 min
I think that UI is timing out. But I'm not sure why the legacy one is not
yes I can connect to it
Hmm. Can you try deploying the server while only connecting to one of the new databases?
ok I will swithc to use Postgres with the new one first
yes it works with only new Postgres
okay so it is a problem connecting to the redis. How does your app connect to it?
ah and the module after the
FileModule
is the CacheModule
, so that makes senseare you using something like the redis or ioredis npm packages
let me check the name
-
@nestjs/cache-manager
- redisStore
from 'cache-manager-redis-yet';
that cache-manager-redis-yet
uses:
Look like it uses Redis under the hoodhmm. testing a few things out
my cache module is simple
I'm trying to reproduce this locally with the new redis database and am unable to. Can you connect to them locally?
We can try restarting/redeploying the redis database as well
I still use redis in my docker for development
but I can connect to it using the redis-cli
let's redeploy the new redis
What is so confusing is that there are no errors or anything
I am not that familiar with NestJS, but if there is anyway to get more debug info, that would be really helpful
We could also try deploying the same app to another prjoect with a new postgres/redis to see if that works. That would let us know if it is that specific redis, or if it is all of the new redis's that are not connectable by this server
I am not expert in nestjs as well, 30 mins ago I read the doc again and might try to push it if the redeploy does not help
yeah, so strange!
oh, look like it works
oh wat
have no idea
thats... good
haha I'm so confused
Solution
look like redeploy the redis helps
very strange. Glad it worked. I'll definitely keep this in mind in the future
And will explore some things later to see if I can determine what happened (not using your databases of course)
I guess because I redeployed the server right after the redis deploying, so it has something...
awesome! glad everything is working now
Feel free to keep the legacy databases around for a bit so you know everything is all good with the new ones
thanks for your patient
I have to go to bed, it's 2:00 AM here 😄
Good night 😴 👋