Skip to content

PG::UnableToSend: no connection to the server #628

@fullofcaffeine

Description

@fullofcaffeine

When I try to run delayed_job in the foreground, using:

$ RAILS_ENV=development script/delayed_job run

I get:

✗ RAILS_ENV=development script/delayed_job run
[deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message.
delayed_job: process with pid 56692 started.
PG::UnableToSend: no connection to the server
: UPDATE "delayed_jobs" SET locked_by = null, locked_at = null WHERE (locked_by = 'delayed_job host:myhost pid:56692')

The error happens in the delayed_job_activerecord backend, in this method:

     # When a worker is exiting, make sure we don't have any locked jobs.
        def self.clear_locks!(worker_name)
          update_all("locked_by = null, locked_at = null", ["locked_by = ?", worker_name])
        end

It works fine until there, but for some reason it says there's no db connection when it calls update_all.

  • delayed_job (3.0.3)
  • delayed_job_active_record (0.3.2)
  • PostgreSAL 9.3.2
  • Mavericks
  • Ruby 2.0.0p353 (2013-11-22 revision 43784) [x86_64-darwin13.0.0]

Any ideas?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions