conn.encoders[SafeBytes] = conn.encoders[bytes] error

533 views
Skip to first unread message

Shubha Ramani

unread,
Dec 14, 2021, 2:26:35 PM12/14/21
to Review Board Community
I am using RHEL 8 (8.5)
Unfortunately a very old mysql db server 5.7.18 MySQL Community Server
Had to change the /etc/openssl.conf to handle TLS version 1.0
ReviewBoard-4.0.4-venv/bin/rb-site install succeeded.

I'm getting:
Something broke! (Error 500)

It appears something broke when you tried to go to here. This is either a bug in Review Board or a server configuration error. Please report this to your administrator.

However
 ReviewBoard-4.0.4-venv/bin/rb-site /webapp/reviewboard/site_prod/ list-siteconfig 
produces:
  File "/webapp/PYTHON_VENVS/ReviewBoard-4.0.4-venv/lib/python3.9/site-packages/django/db/models/sql/compiler.py", line 887, in execute_sql
    cursor = self.connection.cursor()
  File "/webapp/PYTHON_VENVS/ReviewBoard-4.0.4-venv/lib/python3.9/site-packages/django/db/backends/base/base.py", line 254, in cursor
    return self._cursor()
  File "/webapp/PYTHON_VENVS/ReviewBoard-4.0.4-venv/lib/python3.9/site-packages/django/db/backends/base/base.py", line 229, in _cursor
    self.ensure_connection()
  File "/webapp/PYTHON_VENVS/ReviewBoard-4.0.4-venv/lib/python3.9/site-packages/django/db/backends/base/base.py", line 213, in ensure_connection
    self.connect()
  File "/webapp/PYTHON_VENVS/ReviewBoard-4.0.4-venv/lib/python3.9/site-packages/django/db/backends/base/base.py", line 189, in connect
    self.connection = self.get_new_connection(conn_params)
  File "/webapp/PYTHON_VENVS/ReviewBoard-4.0.4-venv/lib/python3.9/site-packages/django/db/backends/mysql/base.py", line 276, in get_new_connection
    conn.encoders[SafeBytes] = conn.encoders[bytes]
KeyError: <class 'bytes'>

Christian Hammond

unread,
Dec 15, 2021, 5:42:50 AM12/15/21
to revie...@googlegroups.com
Looks like it's trying to access something from the MySQLdb module that isn't available on your install.

Can you run the following and show the results:

    pip3.9 list | grep -i mysql

Christian

--
Supercharge your Review Board with Power Pack: https://www.reviewboard.org/powerpack/
Want us to host Review Board for you? Check out RBCommons: https://rbcommons.com/
Happy user? Let us know! https://www.reviewboard.org/users/
---
You received this message because you are subscribed to the Google Groups "Review Board Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to reviewboard...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/reviewboard/7029df4f-6442-41c6-88ef-24ddf28c83een%40googlegroups.com.


--
Christian Hammond
President/CEO of Beanbag
Makers of Review Board

Franco Sabini

unread,
Dec 28, 2021, 10:02:00 AM12/28/21
to Review Board Community
Hello,
I'm on RHEL 8.5 too and getting the same error.

pip3.8 list|grep -i mysql
mysqlclient             2.1.0

thanks
Franco

Franco Sabini

unread,
Dec 28, 2021, 11:35:30 AM12/28/21
to Review Board Community
Hello,
apparently the issue was that we have mysql 8 installed on our host.
Is there any way to have reviewboard working with that version ?

thanks
Franco

Christian Hammond

unread,
Dec 29, 2021, 6:41:43 AM12/29/21
to revie...@googlegroups.com
Looks like it's an incompatibility with mysqlclient 2.1 and MySQL. Technically, a compatibility change/workaround that was removed. We'll be making a change in Review Board 4.0.5 to the dependency to cap it, but for now, both of you can try:

    pip3 install "mysqlclient~=2.0"

(Use pip3 or pip3.9 or whatever is appropriate for your setup.)

Restart your web server, and things should work again.

Christian

Franco Sabini

unread,
Dec 31, 2021, 5:28:51 AM12/31/21
to Review Board Community
Hello Christian,
I'll try downgrading mysqlclient, thanks
We have installed reviewboard with sqlite for evaluation. We'll use mysql for production.

thanks!

Vlad S.

unread,
Jan 31, 2022, 9:10:06 AM1/31/22
to Review Board Community
Thanks

 pip install mysqlclient==2.0.3 worked for me with python 3.8 venv.

пятница, 31 декабря 2021 г. в 13:28:51 UTC+3, franco...@gmail.com:
Reply all
Reply to author
Forward
0 new messages