Howdy! I have some Mongo/Prisma code that uses th...
# mongodb
d
Howdy! I have some Mongo/Prisma code that uses the transaction API. The tests are failing with the following error, unless I insert a few seconds of timeout between each test:
Copy code
ConnectorError(ConnectorError { user_facing_error: None, kind: RawDatabaseError { code: "unknown", message: "Command failed (SnapshotUnavailable): Unable to read from a snapshot due to pending collection catalog changes; please retry the operation. Snapshot timestamp is Timestamp(1652874614, 25). Collection minimum is Timestamp(1652874614, 33))" } })
I’m using in-memory mongo for tests, which I instantiate programmatically. I have a feeling that Prisma is trying to create some collections behind the scenes which leads to the mentioned error. Is there some kind of way to make Prisma provision db contents programmatically? Kinda like
prisma db push
, but smth I could call via Prisma client?
j
Not yet, usually you have to put something into these collections to be able to create them.
But your use case might be worth an issue, so we can look at it a a bit deeper. Using a in-memory MongoDB for tests sounds like a pretty smart thing to do, so we should probably be able to support that.
d
Oh sorry missed you reply. In my case I just implemented a retrial of this particular error in tests, had no time to dig to the bottom of this 🙈
👍 1
j
That is actually also worth to include in an issue if someone else encounters the same error (and sooner or later someone will).
d
Hah don’t think it’s a very good advise to spread, I did it out of despair 😄
j
Yeah, better that not having any solution. The workaround could also help us understand the problem better.
Actually just having an issue is probably the most important bit, with or without the workaround.