2 years ago
Yesterday, a user of my SubAligner app complained that they were not able to log in. I checked today. There is no record in the user table of their account under their email address or name. Their Stripe customer information is not present in the payments table.
I've never run into a problem like this where the data is just missing and I'm not sure what to do next. I am running weekly backups with the Railway template, but this customer says that the last time he was able to login successfully was 1 month ago. Lots of people have signed up since then. I can't lose all of their data.
This customer is well known to me. He's been using the app for over 1 year, at least. I can see his active subscription in Stripe so I know his email and name are correct.
I haven't updated this app in quite a while, over 4 months. When I look at the postgres deploy logs, there are lots of little error messages, but none of them stand out. They are little things that have always been there. Here's the most recent one:
2024-07-08 14:57:18.357 UTC [32] LOG: checkpoint complete: wrote 6 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.504 s, sync=0.017 s, total=0.529 s; sync files=6, longest=0.013 s, average=0.003 s; distance=8 kB, estimate=91 kB
level:
"error"
replica: 98ebf36b-cc38-411e-8814-1acd9ae270b6What else can I check? Is it possible for a row in a table to disappear?
3 Replies
2 years ago
Hi there,
Error logs from postgres are mostly normal logs being sent to the wrong stream.
In your code, do you create the user in the database or create their stripe user/subscription first ? This might an issue with your application itself. Could you check both your code and backups to confirm the user was created ? It's unlikely for a single row to disappear from the database - a data loss would likely result in many rows missing and not a specific one.
Best,
Nicolas
2 years ago
Thanks Nicolas.
do you create the user in the database or create their stripe user/subscription first ?
Create the user in users table
Check Stripe to see if they have an account already
If so, create payment in payments table
Later, the user can create a subscription through a Stripe checkout and a webhook will update the user and payment table.
This might an issue with your application itself.
I hope so! :)
confirm the user was created ?
Please say more about this. What would I look for in my code to show that a user was created? I could check the logs, but as I mentioned, he's been a user for a long time, over 1 year. There are logs created for each new user and update to their account.
How would I search the backups to confirm this?
I searched the logs for the customers email address within the last year and there were no results.
2 years ago
There would highly unlikely be any data integrity issues because if there was any issue the whole database volume would be corrupted.
Thanks,
Angelo
6 months ago
This thread has been marked as solved automatically due to a lack of recent activity. Please re-open this thread or create a new one if you require further assistance. Thank you!
Status changed to Solved Railway • 6 months ago
