contribsys / faktory_worker_ruby

Faktory worker for Ruby
GNU Lesser General Public License v3.0
214 stars 31 forks source link

Error fetching job: Invalid password - password with invalid URL characters #68

Closed ppires closed 2 years ago

ppires commented 2 years ago

Issue migrated from https://github.com/contribsys/faktory/issues/411


Are you using an old version? No


I'm using Faktory docker image version 1.6.1 (contribsys/faktory:1.6.1) and FWR 1.1.1

When I set a password for Faktory (using the env var FAKTORY_PASSWORD on the server) and the password has an invalid URL character (eg: @), when I connect to the server with FWR, I get the invalid password error. If I use a password without any URL invalid characters, everything works fine.

In the FAKTORY_URL I used the url-encoded password.

This docker compose file reproduces the error. If the password is changed to password (in both FAKTORY_PASSWORD and FAKTORY_URL), FWR can fetch jobs.

version: '3'
services:
  faktory:
    image: contribsys/faktory
    environment:
      - FAKTORY_PASSWORD=p@ssword
    command: /faktory

  example:
    image: ruby:2.7.6
    depends_on: [faktory]
    environment:
      - FAKTORY_URL=tcp://:p%40ssword@faktory:7419
    command: bash -c "gem install faktory_worker_ruby && ruby -r faktory_worker_ruby -e Faktory::Client.new"

Maybe a url-decode is missing before computing the password hash??