OctoPrint-PrintJobHistory icon indicating copy to clipboard operation
OctoPrint-PrintJobHistory copied to clipboard

CSV Export not working

Open spsijsr-rnd-kunald opened this issue 1 year ago • 4 comments

Upon clicking the CSV Export button the webpage shows that the link is loading and perpetually keeps buffering.

spsijsr-rnd-kunald avatar May 23 '24 05:05 spsijsr-rnd-kunald

I'm also experiencing this problem. Have only recently added this plugin, so my first time attempting export.

I note the plugin calls URL: /plugin/PrintJobHistory/exportPrintJobHistory/CSV

It appears to just timeout.

Anywhere I can look to post logs?

rtrout avatar Jun 27 '24 12:06 rtrout

Same here !

Log from octorpint:

2024-12-06 08:11:42,204 - octoprint.server.util.tornado - ERROR - Exception in WSGI application
Traceback (most recent call last):
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint/server/util/tornado.py", line 782, in handle_request
    chunk = await loop.run_in_executor(self.executor, next_chunk)
  File "/usr/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint/server/util/tornado.py", line 777, in next_chunk
    return next(app_response_iter)
  File "/home/pi/oprint/lib/python3.7/site-packages/werkzeug/wsgi.py", line 500, in __next__
    return self._next()
  File "/home/pi/oprint/lib/python3.7/site-packages/werkzeug/wrappers/response.py", line 50, in _iter_encoded
    for item in iterable:
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint_PrintJobHistory/common/CSVExportImporter.py", line 457, in transform2CSV
    for job in allJobsDict:
  File "/home/pi/oprint/lib/python3.7/site-packages/peewee.py", line 4408, in next
    self.cursor_wrapper.iterate()
  File "/home/pi/oprint/lib/python3.7/site-packages/peewee.py", line 4319, in iterate
    row = self.cursor.fetchone()
sqlite3.ProgrammingError: SQLite objects created in a thread can only be used in that same thread. The object was created in thread id 1700729952 and this is thread id 1650373728.

vojtakaniok avatar Dec 06 '24 08:12 vojtakaniok

Ok, my github detective fu is poor. This version of printjobhistory is abandoned, https://github.com/dojohnso/OctoPrint-PrintJobHistory is the latest fork but also abandoned, but probably where this issue should be reported (if it wasn't abandoned).

rtrout avatar Dec 07 '24 08:12 rtrout

@spsijsr-rnd-kunald Should be fixed in my new release, feel free to update

vojtakaniok avatar Feb 24 '25 20:02 vojtakaniok