all logs show success but db on neon does not update.
i. am. so. done. with. this.
I have a db which has a table called
users
, when i login with clerk, it makes a user. after login, the website takes the user to /onboarding
where the user has to enter additional information like phone number, postcode and "about me." on submit, the db should be updated with the new details, for the same user, on the same users
table. but it is not happening.
I have taken logs from the frontend and the backend with all returning status 200 with all the right details in json format. the db connection is working as well, checked with a simple GET API route and by running pnpm prisma studio
. The status 200 logs:
4 Replies
rival-blackOP•3mo ago
other things i have tried:
- nuking the db and adding tables again
- updating tables with postman (works)
@Ask Inkeep
Thanks for tagging me @xyzmani. I'll look through relevant sources and get back to you shortly.
Answer
Based on your logs, the database update is actually working successfully - the Prisma query is executing and returning the updated record (1) . This appears to be a caching issue similar to what was discussed in a previous case .
The issue is likely Next.js caching your API routes or data fetching. Try adding this to your API route:
This forces Next.js to always perform a fresh query against the database instead of serving cached responses . The previous user had the exact same symptoms - updates were working in the database but not reflected in the application - and this solution resolved it .
Since your Postman updates work and the Prisma logs show successful updates, this confirms it's a Next.js caching issue rather than a database problem .
To learn more, see the sources I considered:
[1] Can't get updated data after update data in production
Feel free to tag @Ask Inkeep with additional questions.
rival-blackOP•3mo ago
the issue isn't that the app is showing old data, but the db itself not updating despite the logs showing that the db is connected and the app is sending the right data to the db @Ask Inkeep
Thanks for the follow-up, @xyzmani. I'll get back to you soon.
Answer
Based on your logs, the Prisma UPDATE query is executing successfully and returning the expected fields (1) . However, if the database itself isn't reflecting the changes despite successful logs, here are some troubleshooting steps:
1. Verify the data in Neon directly - Check the actual data in your Neon database using the Neon SQL Editor or psql to confirm whether the update is persisting (2) .
2. Test with a simplified approach - Try using a direct PostgreSQL connection to isolate whether this is a Prisma-specific issue :
3. Check for transaction rollbacks - Even though your logs show success, ensure there are no silent transaction rollbacks occurring after the update.
Since your Postman updates work correctly (1) , this suggests the issue might be in how your application is handling the database transaction or connection pooling.
If you're still seeing the same behavior, click the "Ask for help" button to tag a team member for further investigation.
To learn more, see the sources I considered:
[1] all logs show success but db on neon does not update.
[2] Can't get updated data after update data in production
Feel free to tag @Ask Inkeep with additional questions.