Git Product home page Git Product logo

Comments (24)

floydj avatar floydj commented on September 14, 2024 1

Is it possible that action mailer is using a different queue adapter? Or are you setting solid_queue as the adapter for everything?

I'm not using a different adapter for action mailer, at least not purposely. I'm just calling the deliver_later method "bare", without any parameters. And searching through my config files, the only thing I've set is the overall queue adapter in config/production.rb, per the solid queue instructions.

from solid_queue.

floydj avatar floydj commented on September 14, 2024 1

This is related to the environment variable. If I temporarily plug in the actual password in my config/database.yml file, solid queue starts up without issue:

85028 May  6 16:03:00 purchasing systemd[1]: Started solid_queue for Purchasing.
85029 May  6 16:03:05 purchasing solid_queue[12380]: [SolidQueue] Starting Dispatcher(pid=12380, hostname=redacted.com, metadata={:polling_interval=>1, :batch_size=>500})
85030 May  6 16:03:05 purchasing solid_queue[12386]: [SolidQueue] Starting Worker(pid=12386, hostname=redacted.com, metadata={:polling_interval=>0.1, :queues=>"*", :thread_pool
85031 May  6 16:03:19 purchasing systemd[1]: Started Session 10 of User deployer.
85032 May  6 16:03:21 purchasing systemd[1]: session-10.scope: Deactivated successfully.
85033 May  6 16:03:21 purchasing systemd[1]: session-10.scope: Consumed 1.484s CPU time.
85034 May  6 16:07:27 purchasing solid_queue[1201]: [SolidQueue] Claimed 1 jobs

But I can't figure out why it isn't finding that ENV["POSTGRES_PASSWORD"]. It is available if I login as the deployer user that is running the solid queue process. And the process itself seems to be running alright:

systemctl --user status solid_queue
● solid_queue.service - solid_queue for Purchasing
     Loaded: loaded (/home/deployer/.config/systemd/user/solid_queue.service; enabled; vendor preset: enabled)
     Active: active (running) since Mon 2024-05-06 15:20:08 UTC; 50min ago
   Main PID: 665 (bundle)
      Tasks: 19 (limit: 4666)
     Memory: 282.1M
        CPU: 1min 8.084s
     CGroup: /user.slice/user-1001.slice/[email protected]/app.slice/solid_queue.service
             ├─ 665 "solid-queue-supervisor(0.2.2): supervising 1195, 1201"
             ├─1195 "solid-queue-dispatcher(0.2.2): waiting"
             └─1201 "solid-queue-worker(0.2.2): waiting for jobs in *"

May 06 15:20:08 purchasing.camfildev.com systemd[627]: Started solid_queue for Purchasing.
May 06 15:20:15 purchasing.camfildev.com solid_queue[1195]: [SolidQueue] Starting Dispatcher(pid=1195, hostname=redacted.com, metadata={:poll>
May 06 15:20:15 purchasing.camfildev.com solid_queue[1201]: [SolidQueue] Starting Worker(pid=1201, hostname=redacted.com, metadata={:polling_>
May 06 16:07:27 purchasing.camfildev.com solid_queue[1201]: [SolidQueue] Claimed 1 jobs

from solid_queue.

carsoncole avatar carsoncole commented on September 14, 2024

Looks like it can't find a server at "DB SERVER IP". Is this an ENV var and should it be <%= ENV["DB_SERVER_IP"] %> ?

PG::ConnectionBad: connection to server at "<<DB SERVER IP>>"

from solid_queue.

floydj avatar floydj commented on September 14, 2024

@carsoncole - Sorry, it has the actual IP address there, I've just redacted for Github. I could have been more clear on that.

from solid_queue.

rosa avatar rosa commented on September 14, 2024

I'm assuming Solid Queue is using the config/database.yml from my Rails app to connect to Postgres

Yes, this is correct. It should Just Work.

Oddly enough, when I send email with the deliver_later method, the emails are properly sent. So it seems that Solid Queue is processing something, but not able to connect to the database? What am I missing here?

Is it possible that action mailer is using a different queue adapter? Or are you setting solid_queue as the adapter for everything?

from solid_queue.

rosa avatar rosa commented on September 14, 2024

How strange! That does suggest that your only Solid Queue process is able to connect to the DB just fine. Checking again the logs that you get in syslog... do you have any other clues about these coming from Solid Queue? In these logs there's nothing that would indicate that:

ActiveRecord::DatabaseConnectionError: There is an issue connecting with your hostname: <<DB SERVER IP>>. (ActiveRecord::DatabaseConnectionError)
Please check your database configuration and ensure there is a valid connection to your database.
...stack trace removed...
PG::ConnectionBad: connection to server at "<<DB SERVER IP>>", port 5432 failed: fe_sendauth: no password supplied (PG::ConnectionBad)

Since the error is about the password missing, and that lives in an environment variable, I wonder if you have something running somewhere for your app that's trying to connect to the DB in a place where the environment variable is not set, and that's not necessarily Solid Queue 🤔

from solid_queue.

floydj avatar floydj commented on September 14, 2024

do you have any other clues about these coming from Solid Queue?

Sorry. I should have included more context from the syslog:

3555501 May  1 20:58:43 purchasing solid_queue[423333]: ActiveRecord::DatabaseConnectionError: There is an issue connecting with your hostname: REDACTED. (ActiveRecord::DatabaseConnectionError)
3555502 May  1 20:58:43 purchasing solid_queue[423333]: Please check your database configuration and ensure there is a valid connection to your database.
-- stack trace removed --
3555570 May  1 20:58:43 purchasing solid_queue[423333]: Caused by:
3555571 May  1 20:58:43 purchasing solid_queue[423333]: PG::ConnectionBad: connection to server at "REDACTED", port 5432 failed: fe_sendauth: no password supplied (PG::ConnectionBad)

This does appear to be coming from Solid Queue?

from solid_queue.

rosa avatar rosa commented on September 14, 2024

@floydj, could you share some bits from the stacktrace, redacting any data you don't want to share? From these logs above, I'm not sure what might be happening 😕

from solid_queue.

floydj avatar floydj commented on September 14, 2024

Here's the full trace:

16657082 May  6 14:29:26 purchasing solid_queue[1972630]: rake aborted!
16657083 May  6 14:29:26 purchasing solid_queue[1972630]: ActiveRecord::DatabaseConnectionError: There is an issue connecting with your hostname: (READACT). (ActiveRecord::DatabaseConnectionError)
16657084 May  6 14:29:26 purchasing solid_queue[1972630]: Please check your database configuration and ensure there is a valid connection to your database.
16657085 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:78:in `rescue in new_client'
16657086 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:68:in `new_client'
16657087 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:980:in `connect'
16657088 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:992:in `reconnect'
16657089 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:685:in `block in reconnect!'
16657090 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activesupport/lib/active_support/concurrency/null_lock.rb:9:in `synchronize'
16657091 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:684:in `reconnect!'
16657092 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:786:in `block in verify!'
16657093 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activesupport/lib/active_support/concurrency/null_lock.rb:9:in `synchronize'
16657094 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:777:in `verify!'
16657095 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:794:in `connect!'
16657096 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:1000:in `block in with_raw_connection'
16657097 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activesupport/lib/active_support/concurrency/null_lock.rb:9:in `synchronize'
16657098 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:999:in `with_raw_connection'
16657099 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:1112:in `valid_raw_connection'
16657100 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:616:in `get_database_version'
16657101 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/connection_adapters/schema_cache.rb:374:in `database_version'
16657102 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/connection_adapters/schema_cache.rb:70:in `database_version'
16657103 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/connection_adapters/schema_cache.rb:200:in `database_version'
16657104 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:870:in `database_version'
16657105 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:644:in `check_version'
16657106 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:678:in `new_connection'
16657107 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:723:in `checkout_new_connection'
16657108 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:702:in `try_to_checkout_new_connection'
16657109 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:654:in `acquire_connection'
16657110 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:353:in `checkout'
16657111 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:182:in `connection'
16657112 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/connection_adapters/abstract/connection_handler.rb:246:in `retrieve_connection'
16657113 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/connection_handling.rb:287:in `retrieve_connection'
16657114 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/connection_handling.rb:254:in `connection'
16657115 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/model_schema.rb:622:in `load_schema!'
16657116 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/attributes.rb:264:in `load_schema!'
16657117 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/encryption/encryptable_record.rb:127:in `load_schema!'
16657118 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/model_schema.rb:567:in `block in load_schema'
16657119 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/model_schema.rb:564:in `synchronize'
16657120 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/model_schema.rb:564:in `load_schema'
16657121 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/model_schema.rb:445:in `attribute_types'
16657122 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/attribute_methods.rb:256:in `_has_attribute?'
16657123 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/inheritance.rb:61:in `new'
16657124 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/persistence.rb:54:in `create!'
16657125 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/gems/solid_queue-0.2.2/app/models/solid_queue/process.rb:15:in `register'
16657126 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/gems/solid_queue-0.2.2/lib/solid_queue/processes/registrable.rb:24:in `register'
16657127 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activesupport/lib/active_support/callbacks.rb:403:in `block in make_lambda'
16657128 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activesupport/lib/active_support/callbacks.rb:274:in `block in simple'
16657129 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activesupport/lib/active_support/callbacks.rb:602:in `block in invoke_after'
16657130 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activesupport/lib/active_support/callbacks.rb:602:in `each'
16657131 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activesupport/lib/active_support/callbacks.rb:602:in `invoke_after'
16657132 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activesupport/lib/active_support/callbacks.rb:111:in `run_callbacks'
16657133 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/gems/solid_queue-0.2.2/lib/solid_queue/supervisor.rb:24:in `start'
16657134 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/gems/solid_queue-0.2.2/lib/solid_queue/supervisor.rb:14:in `start'
16657135 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/gems/solid_queue-0.2.2/lib/solid_queue/tasks.rb:4:in `block (2 levels) in <main>'
16657136 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/gems/rake-13.1.0/exe/rake:27:in `<top (required)>'
16657137 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/gems/bundler-2.4.14/lib/bundler/cli/exec.rb:58:in `load'
16657138 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/gems/bundler-2.4.14/lib/bundler/cli/exec.rb:58:in `kernel_load'
16657139 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/gems/bundler-2.4.14/lib/bundler/cli/exec.rb:23:in `run'
16657140 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/gems/bundler-2.4.14/lib/bundler/cli.rb:492:in `exec'
16657141 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/gems/bundler-2.4.14/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
16657142 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/gems/bundler-2.4.14/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
16657143 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/gems/bundler-2.4.14/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
16657144 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/gems/bundler-2.4.14/lib/bundler/cli.rb:34:in `dispatch'
16657145 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/gems/bundler-2.4.14/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
16657146 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/gems/bundler-2.4.14/lib/bundler/cli.rb:28:in `start'
16657147 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/gems/bundler-2.4.14/exe/bundle:37:in `block in <top (required)>'
16657148 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/gems/bundler-2.4.14/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
16657149 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/gems/bundler-2.4.14/exe/bundle:29:in `<top (required)>'
16657150 May  6 14:29:26 purchasing solid_queue[1972630]: /usr/local/bin/bundle:25:in `load'
16657151 May  6 14:29:26 purchasing solid_queue[1972630]: /usr/local/bin/bundle:25:in `<main>'
16657152 May  6 14:29:26 purchasing solid_queue[1972630]: Caused by:
16657153 May  6 14:29:26 purchasing solid_queue[1972630]: PG::ConnectionBad: connection to server at "(READACTED)", port 5432 failed: fe_sendauth: no password supplied (PG::ConnectionBad)
16657154 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/gems/pg-1.5.6/lib/pg/connection.rb:701:in `async_connect_or_reset'
16657155 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/gems/pg-1.5.6/lib/pg/connection.rb:833:in `connect_to_hosts'
16657156 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/gems/pg-1.5.6/lib/pg/connection.rb:764:in `new'
16657157 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/gems/pg-1.5.6/lib/pg.rb:63:in `connect'
16657158 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:69:in `new_client'
16657159 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:980:in `connect'
16657160 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:992:in `reconnect'
16657161 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:685:in `block in reconnect!'
16657162 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activesupport/lib/active_support/concurrency/null_lock.rb:9:in `synchronize'
16657163 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:684:in `reconnect!'
16657164 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:786:in `block in verify!'
16657165 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activesupport/lib/active_support/concurrency/null_lock.rb:9:in `synchronize'
16657166 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:777:in `verify!'
16657167 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:794:in `connect!'
16657168 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:1000:in `block in with_raw_connection'
16657169 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activesupport/lib/active_support/concurrency/null_lock.rb:9:in `synchronize'
16657170 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:999:in `with_raw_connection'
16657171 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:1112:in `valid_raw_connection'
16657172 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:616:in `get_database_version'
16657173 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/connection_adapters/schema_cache.rb:374:in `database_version'
16657174 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/connection_adapters/schema_cache.rb:70:in `database_version'
16657175 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/connection_adapters/schema_cache.rb:200:in `database_version'
16657176 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:870:in `database_version'
16657177 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:644:in `check_version'
16657178 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:678:in `new_connection'
16657179 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:723:in `checkout_new_connection'
16657180 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:702:in `try_to_checkout_new_connection'
16657181 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:654:in `acquire_connection'
16657182 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:353:in `checkout'
16657183 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:182:in `connection'
16657184 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/connection_adapters/abstract/connection_handler.rb:246:in `retrieve_connection'
16657185 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/connection_handling.rb:287:in `retrieve_connection'
16657186 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/connection_handling.rb:254:in `connection'
16657187 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/model_schema.rb:622:in `load_schema!'
16657188 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/attributes.rb:264:in `load_schema!'
16657189 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/encryption/encryptable_record.rb:127:in `load_schema!'
16657190 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/model_schema.rb:567:in `block in load_schema'
16657191 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/model_schema.rb:564:in `synchronize'
16657192 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/model_schema.rb:564:in `load_schema'
16657193 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/model_schema.rb:445:in `attribute_types'
16657194 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/attribute_methods.rb:256:in `_has_attribute?'
16657195 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/inheritance.rb:61:in `new'
16657196 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activerecord/lib/active_record/persistence.rb:54:in `create!'
16657197 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/gems/solid_queue-0.2.2/app/models/solid_queue/process.rb:15:in `register'
16657198 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/gems/solid_queue-0.2.2/lib/solid_queue/processes/registrable.rb:24:in `register'
16657199 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activesupport/lib/active_support/callbacks.rb:403:in `block in make_lambda'
16657200 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activesupport/lib/active_support/callbacks.rb:274:in `block in simple'
16657201 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activesupport/lib/active_support/callbacks.rb:602:in `block in invoke_after'
16657202 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activesupport/lib/active_support/callbacks.rb:602:in `each'
16657203 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activesupport/lib/active_support/callbacks.rb:602:in `invoke_after'
16657204 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/bundler/gems/rails-e58d59ce489f/activesupport/lib/active_support/callbacks.rb:111:in `run_callbacks'
16657205 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/gems/solid_queue-0.2.2/lib/solid_queue/supervisor.rb:24:in `start'
16657206 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/gems/solid_queue-0.2.2/lib/solid_queue/supervisor.rb:14:in `start'
16657207 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/gems/solid_queue-0.2.2/lib/solid_queue/tasks.rb:4:in `block (2 levels) in <main>'
16657208 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/gems/rake-13.1.0/exe/rake:27:in `<top (required)>'
16657209 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/gems/bundler-2.4.14/lib/bundler/cli/exec.rb:58:in `load'
16657210 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/gems/bundler-2.4.14/lib/bundler/cli/exec.rb:58:in `kernel_load'
16657211 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/gems/bundler-2.4.14/lib/bundler/cli/exec.rb:23:in `run'
16657212 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/gems/bundler-2.4.14/lib/bundler/cli.rb:492:in `exec'
16657213 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/gems/bundler-2.4.14/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
16657214 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/gems/bundler-2.4.14/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
16657215 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/gems/bundler-2.4.14/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
16657216 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/gems/bundler-2.4.14/lib/bundler/cli.rb:34:in `dispatch'
16657217 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/gems/bundler-2.4.14/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
16657218 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/gems/bundler-2.4.14/lib/bundler/cli.rb:28:in `start'
16657219 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/gems/bundler-2.4.14/exe/bundle:37:in `block in <top (required)>'
16657220 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/gems/bundler-2.4.14/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
16657221 May  6 14:29:26 purchasing solid_queue[1972630]: /home/deployer/purchasing/shared/bundle/ruby/3.3.0/gems/bundler-2.4.14/exe/bundle:29:in `<top (required)>'
16657222 May  6 14:29:26 purchasing solid_queue[1972630]: /usr/local/bin/bundle:25:in `load'
16657223 May  6 14:29:26 purchasing solid_queue[1972630]: /usr/local/bin/bundle:25:in `<main>'
16657224 May  6 14:29:26 purchasing solid_queue[1972630]: Tasks: TOP => solid_queue:start
16657225 May  6 14:29:26 purchasing solid_queue[1972630]: (See full trace by running task with --trace)
16657226 May  6 14:29:26 purchasing systemd[1]: Starting Cleanup of Temporary Directories...
16657227 May  6 14:29:26 purchasing systemd[1]: solid_queue.service: Main process exited, code=exited, status=1/FAILURE
16657228 May  6 14:29:26 purchasing systemd[1]: solid_queue.service: Failed with result 'exit-code'.
16657229 May  6 14:29:26 purchasing systemd[1]: solid_queue.service: Consumed 8.735s CPU time.

from solid_queue.

rosa avatar rosa commented on September 14, 2024

Thanks @floydj! It definitely looks like your database.yml configuration there is missing the password for your DB.

I have checked that the POSTGRES_PASSWORD environment variable is set.

How did you check this?

from solid_queue.

floydj avatar floydj commented on September 14, 2024

How did you check this?

There are only three user accounts in the system. I logged into each, used the env command to verify. To be specific, the "deployer" user is what the app runs under, and that env is set for the account.

from solid_queue.

rosa avatar rosa commented on September 14, 2024

Could you try something like this in your app to debug whether ENV["POSTGRES_PASSWORD"] is really set when the Solid Queue supervisor process is started?
File lib/tasks/solid_queue.rake:

namespace :solid_queue do
  task :log_env_variable_present do
    Rails.logger.warn('ENV["POSTGRES_PASSWORD"] defined? ' + ENV["POSTGRES_PASSWORD"].present?)
    Rails.logger.warn("Testing DB connection: #{SolidQueue::Process.count}")
  end
end

Rake::Task["solid_queue:work"].enhance [ "solid_queue:log_env_variable_present" ]

from solid_queue.

floydj avatar floydj commented on September 14, 2024

Please forgive my ignorance, but once I add that file to my app, is there any kind of task or command for me to run?

from solid_queue.

rosa avatar rosa commented on September 14, 2024

Oh, no, no worries! This would run when solid_queue:start task runs, so when you start Solid Queue as before, and it should be logged to wherever you're sending your Rails logs.

from solid_queue.

floydj avatar floydj commented on September 14, 2024

Well, it's not popping up in my logs, but when I run the command directly:

bundle exec rails solid_queue:log_env_variable_present
bin/rails aborted!
TypeError: no implicit conversion of true into String (TypeError)

    Rails.logger.warn('ENV["POSTGRES_PASSWORD"] defined? ' + ENV["POSTGRES_PASSWORD"].present?)
                                                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/home/deployer/purchasing/releases/20240506150430/lib/tasks/solid_queue.rake:3:in `+'
/home/deployer/purchasing/releases/20240506150430/lib/tasks/solid_queue.rake:3:in `block (2 levels) in <main>'
Tasks: TOP => solid_queue:log_env_variable_present
(See full trace by running task with --trace)

from solid_queue.

rosa avatar rosa commented on September 14, 2024

Oops, sorry, my mistake! Anyway, that means the variable is defined..... Hmm... what happens if you start Solid Queue directly, then?

bundle exec rails solid_queue:start

from solid_queue.

floydj avatar floydj commented on September 14, 2024

This is odd. It's returning that it's looking for 127.0.0.1 and port 5434, which isn't even in my database.yml:

bundle exec rails solid_queue:start
bin/rails aborted!
ActiveRecord::ConnectionNotEstablished: connection to server at "127.0.0.1", port 5434 failed: Connection refused (ActiveRecord::ConnectionNotEstablished)
	Is the server running on that host and accepting TCP/IP connections?


Caused by:
PG::ConnectionBad: connection to server at "127.0.0.1", port 5434 failed: Connection refused (PG::ConnectionBad)
	Is the server running on that host and accepting TCP/IP connections?

Tasks: TOP => solid_queue:start
(See full trace by running task with --trace)

from solid_queue.

rosa avatar rosa commented on September 14, 2024

This sounds like it's using some default 🤔 Are you sure you haven't configured Solid Queue to use a different database?

from solid_queue.

floydj avatar floydj commented on September 14, 2024

On the other hand, if I add the production RAILS_ENV:

RAILS_ENV=production bundle exec rake solid_queue:start
[SolidQueue] Starting Dispatcher(pid=9454, hostname=REDACTED, metadata={:polling_interval=>1, :batch_size=>500})
[SolidQueue] Starting Worker(pid=9457, hostname=REDACTED, metadata={:polling_interval=>0.1, :queues=>"*", :thread_pool_size=>5})

That seems to be ok?

Are you sure you haven't configured Solid Queue to use a different database?

I haven't knowingly configured it differently. In my config/application.rb:

    config.active_job.queue_adapter = :solid_queue

Which is all I've really configured. I haven't made any changes to the solid queue config file, etc.

I use the following service file to start solid queue on boot, but I'm not seeing anything there that could be the problem:

[Unit]
Description=solid_queue for app
After=syslog.target network.target

[Service]
Type=simple
Environment=RAILS_ENV=production
WorkingDirectory=/home/deployer/purchasing/current
ExecStart=bundle exec rake solid_queue:start
ExecReload=/bin/kill -TSTP $MAINPID
ExecStop=/bin/kill -TERM $MAINPID

Environment=MALLOC_ARENA_MAX=2

RestartSec=1
Restart=on-failure

SyslogIdentifier=solid_queue

[Install]
WantedBy=default.target

from solid_queue.

rosa avatar rosa commented on September 14, 2024

It's so odd! I'm not familiar with systemctl myself, unfortunately, but I found this answer in StackOverflow that might help. Does it ring a bell?

from solid_queue.

floydj avatar floydj commented on September 14, 2024

yeah, I've been thinking this is one of those logged-in-vs-non-interactive-shell things. I'll do some digging and report back here.

Does the Solid Core team have any recommendations on how to start it on boot? I'm not really married to systemd, but couldn't find a documented way of running it, other than manually starting it.

from solid_queue.

floydj avatar floydj commented on September 14, 2024

So that is the issue - the environment variable was not being set correctly. My research told me that if I set it in /etc/environment, then it was good in any situation, but that's obviously not true.

Adding the following line to the above service service made things work:

Environment=POSTGRES_PASSWORD=my_redacted_password

Is there a more "official" recommendation on starting at boot?

from solid_queue.

hecbuma avatar hecbuma commented on September 14, 2024

I'm seeing a similar issue. Currently I'm adding stress to my solid queue setup. I'm using it to process CSV file to ingest them to a mongodb. the process itself doesn't have big impact into Postgres.

At some moment I start to get the following error and the worker container with the EC2 instance where this is running becomes inaccessible. I need to reboot the instance and then it pick up again and continues.

I, [2024-07-23T14:50:56.640378 #17]  INFO -- : SolidQueue-0.3.3 Replaced terminated Worker (5.4ms)  pid: 10570, status: 1, pid_from_status: 10570, signaled: false, stopsig: nil, termsig: nil, hostname: "10.0.XX.80-82c40617ab2c"
I, [2024-07-23T14:51:36.787079 #10585]  INFO -- : SolidQueue-0.3.3 Register Worker (70195.5ms)  pid: 10585, hostname: "10.0.XX.80-82c40617ab2c"
W, [2024-07-23T14:51:36.795630 #10585]  WARN -- : SolidQueue-0.3.3 Error registering Worker (0.1ms)  pid: 10585, hostname: "10.0.38.XX-82c40617ab2c", error: "ActiveRecord::DatabaseConnectionError There is an issue connecting to your database with your username/password, username: solorails.\n\nPlease check your database configuration to ensure the username/password are valid.\n"
I, [2024-07-23T14:51:36.815607 #10585]  INFO -- : SolidQueue-0.3.3 Started Worker (70214.6ms)  pid: 10585, hostname: "10.0.38.XX-82c40617ab2c", polling_interval: 0.1, queues: "high", thread_pool_size: 4
/usr/local/bundle/gems/activerecord-7.1.3.4/lib/active_record/connection_adapters/postgresql_adapter.rb:76:in `rescue in new_client': There is an issue connecting to your database with your username/password, username: solorails. (ActiveRecord::DatabaseConnectionError)

Please check your database configuration to ensure the username/password are valid.
...

This is my solid queue config

staging:
  dispatchers:
    - polling_interval: 1
      batch_size: 500
      recurring_tasks: *recurring_tasks
  workers:
    - queues: "high"
      threads: 4
      processes: 2
      polling_interval: 0.1
    - queues: "default"
      threads: 2
      processes: 1
      polling_interval: 0.1
    - queues: "gush"
      threads: 2
      processes: 2 
      polling_interval: 1

I'm running a docker container in a t3.medium EC2 instance

from solid_queue.

kaka-ruto avatar kaka-ruto commented on September 14, 2024

My problem was that solid queue was using old env values stored on the server. I ssh-ed into it, and manually had to check the envs with cat ~/.kamal/env/roles/solid_queue.env and it was using a previous IP address!

So all I had to do was to run kamal env push on the terminal again, to upload all new env values to the serve for the worker to use, and the restart the web server with kamal app boot

from solid_queue.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.