Skip to content
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

workwebui: first path segment in URL cannot contain colon #164

Closed
Lavode opened this issue Aug 7, 2020 · 1 comment
Closed

workwebui: first path segment in URL cannot contain colon #164

Lavode opened this issue Aug 7, 2020 · 1 comment

Comments

@Lavode
Copy link

Lavode commented Aug 7, 2020

Error

When starting the web UI, and subsequently opening / reloading its web UI, the following error is shown:

› workwebui -redis='127.0.0.1:16379' -ns=test
Starting workwebui:
redis =  127.0.0.1:16379
database =  0
namespace =  test
listen =  :5040
ERROR: worker_observations.worker_pool_heartbeats - parse "127.0.0.1:16379": first path segment in URL cannot contain colon

The UI does also not list any pending jobs / worker processes / etc, so it seems to be an actual error.

For reference, the contents of said Redis server right after having started the worker pool:

› redis-cli -h 127.0.0.1 -p 16379
127.0.0.1:16379> KEYS *
1) "test:worker_pools"
2) "test:known_jobs"
3) "test:last_periodic_enqueue"
4) "test:jobs:check_last_replay:max_concurrency"
5) "test:worker_pools:2a56fe07ad1b5106a1d20207"

Reproduce

  • Start redis server
  • Fire up example shown in README.md (you'll have to fix some missing imports, and unused variables ;))
  • Start worker pool
  • Enqueue a few jobs
  • Start workwebui and open it in a browser

Versions

Go:

› go version
go version go1.14.7 linux/amd64

Redis:

127.0.0.1:16379> INFO
# Server
redis_version:6.0.5

go.mod:

github.com/gocraft/work v0.5.1
github.com/gomodule/redigo v1.8.2
@Lavode
Copy link
Author

Lavode commented Aug 7, 2020

Right, a bit of digging in the code later I've figured out the cause - a case of unclear documentation.

workwebui uses the DialURL() method of redisgo: https://pkg.go.dev/github.com/gomodule/redigo@v2.0.0+incompatible/redis?tab=doc#DialURL

This one expects a URL according to the following spec: https://www.iana.org/assignments/uri-schemes/prov/redis
As such the example URL in README.md is an incorrect example. Rather one must supply URIs such as the following:

  • redis://127.0.0.1:6379
  • redis://user:secret@localhost:6379/0?foo=bar&qux=baz
  • redis://:6379
    Etc

I'll be submitting a short PR to fix the example in README.md.

@Lavode Lavode closed this as completed Aug 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant