Internal server error when running SQL query on base

Hi,

We already reported this issue to SeaTable support last Thursday evening [Ticket#33972], but given that we still haven’t received a response and this is seriously hampering our SeaTable workflows, I am posting this here as well:

Since last Thursday, we are getting a “ConnectionError: [Errno 500] internal server error” response whenever we try to run an SQL query from the Python API, and the query does not run. Given that we are using the cloud edition, we cannot get much more insight into this or resolve this ourselves, but we are heavily reliant on SQL query for our table automations, so this is really inconvenient.

For some context, the following is what one of our employees was doing just before the error started occurring: “I was just testing a script that uses the SeaTable Python API which was uploading a small number (6) of rows to a test table, and deleting them by hand in the web app. This was working fine until I attempted to use the base.update_links() method. I am not certain if that is what caused the issue, but the error did start happening around the time I added that to my script and somehow accidentally created a few empty links on one row so perhaps is what did it.”

Best wishes,
Bram

Hey Bram,
thanks for sending me the base and the python script. I already answered you via your ticket system. As soon as we found the reason for your problems, I will also post them here.
Best regards
Christoph

1 Like

Hey Bram,

the problem is fixed and your python script should work again now.


Here a description of problem and solution just for documentation…

Description of the problem:

Bram reported the problem that the execution of the following python code did not work anymore:

from seatable_api import Base
base = Base('...removed-base-api-token...', 'https://cloud.seatable.io')
base.auth()
results = base.query("SELECT question_id FROM Questions LIMIT 10")
for row in results:
     print(row)

The python error message was like this, no matter if he executed the code inside cloud.seatable.io or via local python-bash:

Traceback (most recent call last):
File "index.py", line 16, in <module>
results = base.query("SELECT question_id from Questions LIMIT 1")
File "/usr/local/lib/python3.7/site-packages/seatable_api/main.py", line 795, in query
data = parse_response(response)
File "/usr/local/lib/python3.7/site-packages/seatable_api/main.py", line 31, in parse_response
raise ConnectionError(response.status_code, response.text)
ConnectionError: [Errno 500] internal server error

The solution:

We analyzed the problem and this problem was only related to this specific base. Other bases were not affected and the same code delivered results.

We finally found the reason. The root cause was a malformed operation record in the operations table of SeaTable. dtable-db failed to parse that operation and reports a 500 error.

We could remove this malformated error. This problem is now will be fixed with SeaTable 2.8. and should not occur again.

Best regards
Christoph

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.