lbryio / hub

MIT License
16 stars 15 forks source link

--daemon_url option can fail to parse <USER>:<PASS> causing aiohttp post() to fail #79

Closed moodyjon closed 2 years ago

moodyjon commented 2 years ago

Saw this while trying to start scribe using autogenerated rpcuser/rpcpass from lbcd.conf.

--daemon_url=https://FQYAibqCp/zFfOSbxaB7K4=:<password>@127.0.0.1:9245

2022-08-17 15:33:30,709 ERROR hub.scribe.daemon:137: connection problem - is your daemon running?  Retrying occasionally...
2022-08-17 15:34:30,763 ERROR hub.scribe.daemon:137: connection problem - is your daemon running?  Retrying occasionally...

Root cause of this is some restrictions on the character classes that can be in the username & password that are embedded in the URL string. Aiohttp appears to use yarl.URL to parse the URL. In my case '/' was the offending character.

>>> x = yarl.URL("https://FQYAibqCp/zFfOSbxaB7K4=:<password>@127.0.0.1:9245")
>>> x.user
>>> x.password
>>> x = yarl.URL("https://FQYAibqCpzFfOSbxaB7K4=:<password>@127.0.0.1:9245")
>>> x.user
'FQYAibqCpzFfOSbxaB7K4='
>>> x.password
'<password>'