Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update from admin view failing #488

Closed
simkin opened this issue Apr 10, 2018 · 4 comments
Closed

Update from admin view failing #488

simkin opened this issue Apr 10, 2018 · 4 comments
Labels

Comments

@simkin
Copy link

simkin commented Apr 10, 2018

Stuck after "Files have been replaced" message
Debian: Linux 4.13.13-6-pve #1 SMP PVE 4.13.13-41 (Wed, 21 Feb 2018 10:07:54 +0100) x86_64 GNU/Linux
Python: 2.7.13

Apr 10 16:25:26 vault13.eu python[22104]: Traceback (most recent call last):
Apr 10 16:25:26 vault13.eu python[22104]: File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
Apr 10 16:25:26 vault13.eu python[22104]: self.run()
Apr 10 16:25:26 vault13.eu python[22104]: File "/opt/calibre-web4/cps/helper.py", line 394, in run
Apr 10 16:25:26 vault13.eu python[22104]: self.update_source(os.path.join(tmp_dir, os.path.splitext(fname)[0]), ub.config.get_main_dir)
Apr 10 16:25:26 vault13.eu python[22104]: File "/opt/calibre-web4/cps/helper.py", line 517, in update_source
Apr 10 16:25:26 vault13.eu python[22104]: self.moveallfiles(source, destination)
Apr 10 16:25:26 vault13.eu python[22104]: File "/opt/calibre-web4/cps/helper.py", line 489, in moveallfiles
Apr 10 16:25:26 vault13.eu python[22104]: + str(permission.st_uid) + ':' + str(permission.st_gid) + ' error: '+str(e))
Apr 10 16:25:26 vault13.eu python[22104]: NameError: global name 'e' is not defined

@OzzieIsaacs
Copy link
Collaborator

It's indeed a bug. Please replace the file /cps/helper.py with current one:
https://github.com/janeczku/calibre-web/blob/master/cps/helper.py
and try update afterwards.
Then the correct error message should appear (seems the user running calibre-web has no rights to change file permissions of the replaced files.)

@simkin
Copy link
Author

simkin commented Apr 10, 2018

Now I see this in my log. I needed to kill the pid and restart teh service before I could access the (upgraded) instance

[2018-04-10 19:35:33,838] {/usr/local/lib/python2.7/dist-packages/sqlalchemy/pool.py:696} ERROR - Exception during reset or similar
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 687, in _finalize_fairy
fairy._reset(pool)
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 827, in _reset
self._reset_agent.rollback()
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1621, in rollback
self._do_rollback()
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1659, in _do_rollback
self.connection._rollback_impl()
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 703, in _rollback_impl
self._handle_dbapi_exception(e, None, None, None, None)
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1402, in _handle_dbapi_exception
exc_info
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/util/compat.py", line 203, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb, cause=cause)
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 701, in _rollback_impl
self.engine.dialect.do_rollback(self.connection)
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 440, in do_rollback
dbapi_connection.rollback()
ProgrammingError: (pysqlite2.dbapi2.ProgrammingError) SQLite objects created in a thread can only be used in that same thread.The object was created in thread id 139707407021824 and this is thread id 139707213207296
[2018-04-10 19:35:33,838] {/usr/local/lib/python2.7/dist-packages/sqlalchemy/pool.py:591} INFO - Invalidate connection <pysqlite2.dbapi2.Connection object at 0x7f10265763b0> (reason: ProgrammingError:(pysqlite2.dbapi2.ProgrammingError) SQLite objects created in a thread can only be used in that same thread.The object was created in thread id 139707407021824 and this is thread id 139707213207296)
[2018-04-10 19:35:33,838] {/usr/local/lib/python2.7/dist-packages/sqlalchemy/pool.py:297} DEBUG - Closing connection <pysqlite2.dbapi2.Connection object at 0x7f10265763b0>
[2018-04-10 19:35:33,839] {/usr/local/lib/python2.7/dist-packages/sqlalchemy/pool.py:303} ERROR - Exception closing connection <pysqlite2.dbapi2.Connection object at 0x7f10265763b0>
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 300, in _close_connection
self._dialect.do_close(connection)
File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 446, in do_close
dbapi_connection.close()
ProgrammingError: SQLite objects created in a thread can only be used in that same thread.The object was created in thread id 139707407021824 and this is thread id 139707213207296
[2018-04-10 19:35:33,839] {/usr/local/lib/python2.7/dist-packages/sqlalchemy/pool.py:1232} INFO - Pool recreating

@OzzieIsaacs
Copy link
Collaborator

OzzieIsaacs commented Apr 10, 2018

There is a problem accessing the database (seems some dead thread is holding the database open).
Could you please restart the whole device and try again.

@simkin
Copy link
Author

simkin commented Apr 10, 2018

Will retest as soon as a new version becomes available

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants