Closed gottafixthat closed 3 weeks ago
Seems likely you’re using the dbsql driver? This appears to be a bug with that driver not handling duration types as db interval types correctly.
I tried both, actually. I thought it might have been the dbsql driver at first so I refactored to use riverpgxv5 and it was the same result.
Hmm, you must have at least gotten a different error when using pgx? The message above is specific to pq which isn’t used at all by the pgx driver.
I'll verify this tomorrow morning. It's entirely possible that I'm mixing things in the wrong way.
It occurred to me while looking at this that 15000000000 is the elector's default 15 second interval in nanoseconds, so 15 * 1_000_000_000.
You can see here that when pgx encodes a duration, it encodes it as microseconds, which is the maximum precision that Postgres will accept:
For some reason your pgx is trying to write nanoseconds instead of microseconds. Do you have a custom encoding override somewhere?
So it turns out I hadn't had enough coffee when I was testing this. I had set things up twice in different packages, and had forgotten to update the consumer's connection. Once I updated the consumer to correctly use the riverpgxv5 connector everything is working.
Thanks for your quick responses, RiverQueue is a very clean queue system to configure and use.
@brandur hmm, wondering if there still might be a dbsql-specific issue here given that the "fix" was to use the pgx driver 🤔
It may be that River doesn't function when using lib/pq. I'm going to wait and see if we get anymore bug reports about that before actioning though — it's going to be a yak shave, and lib/pq's been deprecated for so long that I suspect a lot of people have since dropped it.
I was evaluating riverqueue for use in one of my projects and after attempting to run it for the first time, I'm getting the following error:
Postgres logs:
I have validated that my migrations worked correctly.
Postgres v14.6 (I'm locked to this version at the moment) Go v1.23.0 River v0.11.4
Any suggestions?