chdsbd / kodiak

🔮 A bot to automatically update and merge GitHub PRs
https://kodiakhq.com
GNU Affero General Public License v3.0
1.03k stars 65 forks source link

Redis password doesn't seem to work anymore after upgrade 0.45 > 0.47 upgrade #753

Closed etiennetremel closed 2 years ago

etiennetremel commented 2 years ago

I'm using a self-hosted Kodiak and after upgrading from 0.45 to 0.47 Kodiak cannot connect to Redis using password authentication. I'm using a Redis URL with the following format: REDIS_URL=redis://:secret123@localhost:6379.

Looking at the diff between both versions, I'm seeing the following line which append .encode() to the password variable. But if I use the same code locally and remove the .encode() it works fine.

Was there a specific reason to use .encode(), is it necessary or am I missing something?

chdsbd commented 2 years ago

Oh, I think that's a mistake.

I think I copied the code from the queue.py, which uses the BytesEncoder and requires converting the string to bytes.

https://github.com/chdsbd/kodiak/blob/9dce1bccf95b48afa552ec179477a47eaae7dc83/bot/kodiak/entrypoints/ingest.py#L44-L46

I think we can remove the .encode() from the following three places

https://github.com/chdsbd/kodiak/blob/9a8ca6e68e6493455b3fe4977270fdee6b4a14dc/bot/kodiak/entrypoints/ingest.py#L45 https://github.com/chdsbd/kodiak/blob/9a8ca6e68e6493455b3fe4977270fdee6b4a14dc/bot/kodiak/redis_client.py#L17 https://github.com/chdsbd/kodiak/blob/38db2d2097001dfbec44f6f31722c37c84801d26/bot/kodiak/test_queries.py#L270

etiennetremel commented 2 years ago

Thanks for the quick reply and review @chdsbd !