-
Notifications
You must be signed in to change notification settings - Fork 137
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
Solid Queue Update to 1.0.0 #377
Comments
From what version are you updating?
What documentation are you referring to? The one under upgrading? What part doesn't make any sense? Could you be more specific? The reason the docs don't mention development is that we generally don't recommend running solid queue in development because Rails already provides a perfect adapter for that, the async adapter. If you want to run it in development, you just need to configure it like production. In your DB configuration, there's no separate DB for Solid Queue in development. Just follow the same instructions here to add the |
I was updating from 0.3.0, I went straight to 1.0.0, then saw that I had to go to 0.6.0 first so I went back, did that and then back to 1.0.0. Things are all a bit confused. right now. Please explain this line: I'll remove solid queue from development if that's not typically the correct solution. I didn't realise this. It may be good to put these small bits of knowledge that us less knowledgeable about background job processing may not realise that's plainly obvious to you. Any idea how to fix the production issue I am hitting? |
@rosa Any suggestions for this? On deploy I just keep getting: -----> Running Rails db:migrate PG::UndefinedTable: ERROR: relation "solid_queue_processes" does not exist |
@rctneil did you run |
@rosa Yes, that's where the error was caused. |
🤔 Hmmm... but you're running |
I deployed, then got a DB error which prompted me to go and run db:prepare, then came back and deployed again. Yes, I did run db:prepare. |
@rosa I've been thinking about this and this is just a guess about what may be happening: I deploy using Hatchbox.io. Hatchbox runs the migrations as part of this. If I deploy, it tries to run them and fails. the deploy is rolled back, I try to run db:prepare but there's nothing to prepare as the deploy failed. Does this sound feasible? How can I get around this? |
Hi! I got the same error but using solid queue in development env. Looks like |
Could you just do the same like for any other migration change that needs two step? You deploy first the DB changes (in this case the schema), and the database config changes, but without connecting to this new DB yet, then |
I had a similar issue. Didn't have enough bandwidth to track down the problem but here is the migration that causes the deployment to fail 2024-10-17 16:22:31] I, [2024-10-17T17:22:30.665094 #13] INFO -- : Migrating to MakeNameNotNull (20241017154832)
[2024-10-17 16:22:31] == 20241017154832 MakeNameNotNull: migrating ==================================
[2024-10-17 16:22:31] D, [2024-10-17T17:22:30.706504 #13] DEBUG -- : TRANSACTION (1.8ms) BEGIN
[2024-10-17 16:22:31] D, [2024-10-17T17:22:30.745620 #13] DEBUG -- : SolidQueue::Process Load (2.1ms) SELECT "solid_queue_processes".* FROM "solid_queue_processes" WHERE "solid_queue_processes"."name" IS NULL ORDER BY "solid_queue_processes"."id" ASC LIMIT $1 [["LIMIT", 1000]]
[2024-10-17 16:22:31] -- change_column(:solid_queue_processes, :name, :string, {:null=>false})
[2024-10-17 16:22:31] D, [2024-10-17T17:22:30.751894 #13] DEBUG -- : (3.5ms) ALTER TABLE "solid_queue_processes" ALTER COLUMN "name" TYPE character varying, ALTER COLUMN "name" SET NOT NULL
[2024-10-17 16:22:31] D, [2024-10-17T17:22:30.755876 #13] DEBUG -- : TRANSACTION (2.7ms) ROLLBACK
[2024-10-17 16:22:31] D, [2024 Now I don't know why this What I've done to get around this is to just replace the ApplicationRecord.connection.execute("ALTER TABLE solid_queue_processes ALTER COLUMN name SET NOT NULL") @rosa I wonder if this information is enough to help figure out what is going on |
Hey @SageOfTixPaths, thanks for writing this up; it's very strange indeed 😕 Did you copy the whole log? I can't see the error raised there. Did it happen after the transaction was rolled back? My only guess there would be that you have processes with a In any case, this seems different from the original issue, where the migration couldn't be run because the table didn't exist in the first place. |
Unfortunately, I couldn't retrieve the full logs but the transaction rollback happened because of a
Yes you are right. I just read through the thread again and realised it is most likely unrelated. I think I saw something about the migrations being rolled back and I assumed it was a similar issue |
More data points for debugging... I am in a similar boat to the folks above. I'm using Rails Jumpstart Pro by @excid3 and I've done a: When I try to run I get the error:
I am running on:
My database.yml (from Jumpstart) is as follows:
The solid queue db looks pretty empty: I note that: queue_schema.rb is pretty empty:
Running
...however running
|
@schappim, you're running into this Rails bug: rails/rails#52829. You need to restore the schema and load the DB with |
I tested the other day with this PR and it seems to fix it: rails/rails#53320 |
Oh nice! I hadn't seen that PR. Thanks a lot for sharing @excid3! 🙏 |
I just migrated from 0.3 to 1.0 and ran in the same issues. The new migrations weren't added with Deployment failed due to what @Michael-Tix reported above. Using |
@danielpuglisi thanks so much for posting this, fixed all my issues. Hopefully this can get resolved soon, I'm really excited to start building with this!
|
This was a very useful comment to find when hitting this issue. Is it accurate that this rails bug exists in 8.0, but is fixed in main and will presumably be fixed either in 8.1 or an 8.0.x release? Might make a good readme side note next to the existing db:prepare guidance. |
@mjankowski I think the Rails bug should have been fixed in 8.0 😕 At least the PR fixing it was merged before 🤔 About the README, yeah, it's possible, but the thing is that the README doesn't tell you anywhere to run |
Hi,
In an existing app i'm updating to version 1.0.0 and it's sooo confusing. I notice that you now recommend a separate database for queue tables. This is fine but the documentation for updating doesn't make any sense.
It doesn't explain whether I need a separate data in development. It doesn't explain how to get that etc.
I've set my DB config to be:
default: &default
adapter: postgresql
encoding: unicode
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
<% if ENV["DB_HOST"] %>
host: <%= ENV["DB_HOST"] %>
username: postgres
password: postgres
<% end %>
development:
<<: *default
database: family_media_development
test:
<<: *default
database: family_media_test
production:
primary: &primary_production
<<: *default
url: <%= ENV["DATABASE_URL"] %>
queue:
<<: *primary_production
url: <%= ENV["QUEUE_DATABASE_URL"] %>
migrations_paths: db/queue_migrate
I've created a queue DB as configured above but when I run db:prepare it does nothing. I've connected to the queue DB in TablePlus and it's empty.
The documentation makes absolutely no mention of what
migrations_paths: db/queue_migrate
does. I don't have anything that exists in my app as db/queue_migrate.Do I have to make a separate DB in development too? I'd like both to work in the same way.
I'm very confused. The app i've updated is now failing to deploy with the error:
-----> Running Rails db:migrate
-----> /home/deploy/.asdf/bin/asdf exec bundle exec rake db:migrate
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled: (StandardError)
PG::UndefinedTable: ERROR: relation "solid_queue_processes" does not exist
LINE 10: WHERE a.attrelid = '"solid_queue_processes"'::regclass
^
Sorry for the two issues created today. These are both separate apps and solid_queue is causing issues across both of them in different ways!
The text was updated successfully, but these errors were encountered: