Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax Error at or near "DISTINCT" #247

Closed
BeatyThomas opened this issue Feb 20, 2025 · 3 comments
Closed

Syntax Error at or near "DISTINCT" #247

BeatyThomas opened this issue Feb 20, 2025 · 3 comments

Comments

@BeatyThomas
Copy link

rails: 8.0.1
ruby: 3.4.2
solid_queue: 1.1.3
mission_control-jobs: 1.0.2

Postgresql 17.3
vite-rails / sprockets (working to get off this)

Issue: when connecting to /jobs, after being prompted for credentials I am getting:
Information for: ActiveRecord::StatementInvalid (PG::SyntaxError: ERROR: syntax error at or near "DISTINCT" LINE 1: SELECT "solid_queue_jobs"."queue_name", DISTINCT(solid_queue...

and at the DB: 2025-02-20 02:18:26.538 UTC [84718] STATEMENT: SELECT "solid_queue_jobs"."queue_name", DISTINCT(solid_queue_jobs.id), solid_queue_jobs.* FROM "solid_queue_jobs" 2025-02-20T02:18:40.936407428Z 2025-02-20 02:18:40.936 UTC [84718] ERROR: syntax error at or near "DISTINCT" at character 41

I also cannot connect to the jobs server, similar to this: #230
I see the available job server (though I have a bin/jobs instance running on two servers - not sure if I should see two) but cannot connect.

Solid queue, cache, and cable are functioning fine otherwise. One thing I'll mention though - unsure if it is relevant or not - is that I had to setup all three solid services following this: rails/solid_cache#228

Any insight would be much appreciated.

@rosa
Copy link
Member

rosa commented Feb 20, 2025

Hey @BeatyThomas, could you include the full stacktrace for the error? I'd like to know where it's triggering, as it's very strange Rails is generating an invalid query for PostgreSQL.

@BeatyThomas
Copy link
Author

Apologies. Apparently 13 years ago when this application was created someone overrode distinct in an initializer.

@rosa
Copy link
Member

rosa commented Feb 20, 2025

Ohhh, haha! Thanks a lot for letting me know, now it makes sense! Great find!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants