URL Export 502 Bad Gateway

Hi,
I am getting “502 http Error Bad Gateway” when trying to export an list of records (amount doesn’t matter) via URL-Export. I am using the standard docker LTS 7.0 Image behind an nginx docker container and the sao client.
Is there something to configure to get this feature working?
Any hints how to debug?

Regards Jakob

Probably you are hitting the gunicorn timeout as it should take a while to export the records. IIRC the default timeout is 60seconds, so if you get the error after waiting such time this confirms my teory. In this case you will find the solution here:

The error appears instantly. When clicking the button “export to url” , a new tab opens, my credentials are asked for, the error appears.

Found this on second glance in the tryton log.

9 140677994274880 [2025-04-11 09:38:07,714] ERROR trytond.protocols.wrappers <JSONRequest 172.18.0.4 'http://---- my url---- /mydb/timesheet/employee/1/lines/2025-04-11' [GET]>

Traceback (most recent call last):

  File "/usr/local/lib/python3.11/dist-packages/trytond/protocols/wrappers.py", line 200, in wrapper

    return func(request, pool, *args, **kwargs)

           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/usr/local/lib/python3.11/dist-packages/trytond/protocols/wrappers.py", line 250, in wrapper

    result = func(request, pool, *args, **kwargs)

             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/usr/local/lib/python3.11/dist-packages/trytond/protocols/wrappers.py", line 281, in wrapper

    UserApplication = pool.get('res.user.application')

                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/usr/local/lib/python3.11/dist-packages/trytond/pool.py", line 190, in get

    return self._pool[self.database_name][type][name]

           ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^

KeyError: 'mydb'

So you are using the timesheet user application.

I suspect that the pool of your database did not initialized correctly at some point which created an empty pool which stays.
So I do not think it is directly related to the user application call but to something that happened before (maybe the database was not available at startup etc.)

This has been improved by Refresh pool can break any code at any time (#11401) · Issues · Tryton / Tryton · GitLab in later versions.

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