Web2py move to a new server resulted in this <class 'AttributeError'> 'CommonDialect' object has no attribute 'eq'

49 views
Skip to first unread message

vald...@gmail.com

unread,
Oct 21, 2023, 5:45:09 PM10/21/23
to web2py-users
Hi Guys,

I recently upgraded an app I wrote with web2py about 4 years ago to work with Python 3.
I got a lot of this  <class 'AttributeError'> 'CommonDialect' object has no attribute 'eq' error until I removed the requires=IS_IN_DB() references to other tables and put the majority of the references into a separate model file named so it would load last. It now works on my local machine.
I've since moved the code to the production server and it worked at first and then the same error started again, this time with it having a problem with the model file that was set to load last. I have tried deleting the web2py installation downloaded a fresh copy to no avail.

Please help.


vald...@gmail.com

unread,
Oct 22, 2023, 4:53:47 AM10/22/23
to web2py-users
It's as if any attempt to read tables based on the db object causes this error.

I was getting this error where IS_IN_DB that references other tables as base tables. I've moved all those references from the models completely and now I'm getting the error when I attempt to log in to the app.

Very strange

vald...@gmail.com

unread,
Oct 22, 2023, 5:07:32 AM10/22/23
to web2py-users
Whenever I reload, It seems to create a new thread showing this in the CLI.

For example, when I attempt to run the app, the error, shown below, starts with: " ERROR:Rocket.Errors.Thread-2:Traceback (most recent call last):"
The next time it runs showing " ERROR:Rocket.Errors.Thread-4:Traceback (most recent call last):"
Then " ERROR:Rocket.Errors.Thread-6:Traceback (most recent call last):"

And so on.

Here is a dump from the CLI. Everything below the traceback line remains the same:

Starting server...
web2py Web Framework
Created by Massimo Di Pierro, Copyright 2007-2023
Version 2.25.1-stable+timestamp.2023.10.08.18.44.43
Database drivers available: sqlite3, imaplib, pymysql

please visit:
        http://127.0.0.1:8005/
use "kill -SIGTERM 161098" to shutdown the web2py server


ERROR:Rocket.Errors.Thread-2:Traceback (most recent call last):

  File "/home/support/cts-new/cts_py3/web2py/gluon/rocket.py", line 1294, in run
    self.run_app(conn)

  File "/home/support/cts-new/cts_py3/web2py/gluon/rocket.py", line 1796, in run_app
    output = self.app(environ, self.start_response)

  File "/home/support/cts-new/cts_py3/web2py/gluon/main.py", line 648, in app_with_logging
    ret[0] = wsgiapp(environ, responder2)

  File "/home/support/cts-new/cts_py3/web2py/gluon/main.py", line 562, in wsgibase
    return http_response.to(responder, env=env)

  File "/home/support/cts-new/cts_py3/web2py/gluon/http.py", line 129, in to
    responder(status, rheaders)

  File "/home/support/cts-new/cts_py3/web2py/gluon/main.py", line 643, in responder2
    return responder(s, h)

  File "/home/support/cts-new/cts_py3/web2py/gluon/rocket.py", line 1759, in start_response
    self.header_set = Headers(response_headers)

  File "/usr/lib/python3.10/wsgiref/headers.py", line 39, in __init__
    self._convert_string_type(v)

  File "/usr/lib/python3.10/wsgiref/headers.py", line 45, in _convert_string_type
    raise AssertionError("Header names/values must be"

AssertionError: Header names/values must be of type str (got 50)

Massimo Di Pierro

unread,
Oct 29, 2023, 2:29:29 PM10/29/23
to web2py-users
This is a know issue with has been fixed in master. I will release a new version later today.
Reply all
Reply to author
Forward
0 new messages