Replit DB failing 12/14/23-01/16/24 for anyone else?

Question:
my node.js server repl is acting very strangely. I have a program that enters very simple data (words and dates) in json format. It was working fine. Now, when i try to enter new data, it logs successful entry of the data to the date range i want, but the data is simply not there over the same date range, no matter what i do: 12/14/23-1/16/24. I have previously entered data for this range, which is still accessible. I thought maybe my source txt files had some error that was not being parsed correctly at the same interval, but starting at a different date doesnt change the date range that fails (and the data entered is shuffled randomly, and date independent anyway.) To test further, i wrote a simple program to enter dummy entries that should cause no parsing errors at all, since they are all the same. The same result! It’s like the replit.db is failing to accept new data, just over this date range. It is very strange.

Is anyone else having this kind of issue?
Can anyone from Replit tell me if there’s anything special about these dates? I don’t see any way to access replit DB logs or query it any other way than with the kinds of programs i am writing. Are there other ways to do it?
Repl link/Link to where the bug appears:

Screenshots, links, or other helpful context:
here are some logs of the successful addition of dates, which are later not there:

Processing file: wordpairtxts/difficulty_6_5_steps.txt
Word pairs before filtering: 2232
Word pairs after filtering: 2232
Added pair sat-basin for round 3 on 2023-12-19 to both environments
Attempting to write to database for date: 2023-12-19 (dev and prod environments)
Successfully wrote to database for dev-wordpair-5-2023-12-19
Successfully wrote to database for prod-wordpair-5-2023-12-19
Finished processing date: 2023-12-19

Are you doing this in a deployment by chance? Deployment filesystems are non-persistent, and will not save changes. And unless you hard-code the URL to the repl DB, changes there likely won’t be visible either.

2 Likes

no, i’m running the script in the repl shell, to add to the DB. i use an env variable which is set by the source of the query. The data is accessible from my deployed react front end as soon as i enter it, just not for those dates.

Oh. So you can use Replit DB in a deployment?

If you hard-coded the DB URL, or stored it in a custom secret, then yes. That would fail as soon as the DB URLs rolled though. (Which I believe I’ve heard that they do, and is why DB Proxies are so common)

2 Likes

As far as I can tell the dev and deployed version share exactly the same information in Replit db. You can code entries and queries to have an env variable prefix, then direct all routes to use the prefix based on the url from which the request is made. So set it to be prod for your deployed url, and dev for anything else, so even if your front end repl’s .dev url changes it will still work with the right information. You’ll need to be working in the dev editor for it to work though, otherwise it will no longer be “always on” like they used to offer.