ARPA-SIMC / dballe-web

Graphical browser-based interface to DB-All.e
Other
0 stars 0 forks source link

Error when exporting data as BUFR or CSV #8

Closed edigiacomo closed 5 years ago

edigiacomo commented 5 years ago

First, the good news: CREX export works :grimacing:

Using dballe v8.0-1 on Fedora 28 and dballe-web from master branch (2e60c6ae8a4e5c721affe6af42ca48a1e184cc14)

BUFR export (api/1.0/export/bufr):

Traceback (most recent call last):
  File "/usr/lib64/python3.6/site-packages/tornado/web.py", line 1543, in _execute
    result = yield result
  File "/usr/lib64/python3.6/site-packages/tornado/gen.py", line 1099, in run
    value = future.result()
  File "/home/edg/src/dballe-web/dballe_web/webserver.py", line 102, in get
    await self.application.session.export(format, writer)
  File "/home/edg/src/dballe-web/dballe_web/session.py", line 189, in export
    await self.loop.run_in_executor(self.executor, exporter)
  File "/usr/lib64/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/edg/src/dballe-web/dballe_web/session.py", line 187, in exporter
    with self.db.transaction() as tr:
OSError: executing BEGIN:cannot start a transaction within a transaction

CSV export (api/1.0/export/csv):

Traceback (most recent call last):
  File "/usr/lib64/python3.6/site-packages/tornado/web.py", line 1543, in _execute
    result = yield result
  File "/usr/lib64/python3.6/site-packages/tornado/gen.py", line 1099, in run
    value = future.result()
  File "/home/edg/src/dballe-web/dballe_web/webserver.py", line 102, in get
    await self.application.session.export(format, writer)
  File "/home/edg/src/dballe-web/dballe_web/session.py", line 193, in export
    await self.loop.run_in_executor(self.executor, exporter)
  File "/usr/lib64/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/edg/src/dballe-web/dballe_web/session.py", line 192, in exporter
    dbacsv.export(self.db, self.filter.to_record(), out)
  File "/usr/lib/python3.6/site-packages/dballe/dbacsv.py", line 391, in export
    e.output(query, fd)
  File "/usr/lib/python3.6/site-packages/dballe/dbacsv.py", line 357, in output
    self.compute_columns(self.tr, query)
  File "/usr/lib/python3.6/site-packages/dballe/dbacsv.py", line 307, in compute_columns
    for record in tr.query_station_data(query):
OSError: executing BEGIN:cannot start a transaction within a transaction
spanezz commented 5 years ago

To reproduce: export a CSV first, the exception happen. The exception will keep happening from that point on