contribsys / faktory

Language-agnostic persistent background job server
https://contribsys.com/faktory/
Other
5.71k stars 228 forks source link

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

Closed ppires closed 2 years ago

ppires commented 2 years ago

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??

mperham commented 2 years ago

Send me a PR?

mperham commented 2 years ago

I think technically this issue belongs in fwr's repo.

ppires commented 2 years ago

I think technically this issue belongs in fwr's repo.

You're right, the problem is here, the password must be url-decoded before computing the hash.

Send me a PR?

It looks like a simple fix, I'll work on the PR. 😃

ppires commented 2 years ago

Migrated to https://github.com/contribsys/faktory_worker_ruby/issues/68