{"action":"created","issue":{"url":"https://api.github.com/repos/janeczku/calibre-web/issues/531","repository_url":"https://api.github.com/repos/janeczku/calibre-web","labels_url":"https://api.github.com/repos/janeczku/calibre-web/issues/531/labels{/name}","comments_url":"https://api.github.com/repos/janeczku/calibre-web/issues/531/comments","events_url":"https://api.github.com/repos/janeczku/calibre-web/issues/531/events","html_url":"https://github.com/janeczku/calibre-web/issues/531","id":335159217,"node_id":"MDU6SXNzdWUzMzUxNTkyMTc=","number":531,"title":"Editing categories gives '500 Internal Server Error'","user":{"login":"Jucgshu","id":3890387,"node_id":"MDQ6VXNlcjM4OTAzODc=","avatar_url":"https://avatars1.githubusercontent.com/u/3890387?v=4","gravatar_id":"","url":"https://api.github.com/users/Jucgshu","html_url":"https://github.com/Jucgshu","followers_url":"https://api.github.com/users/Jucgshu/followers","following_url":"https://api.github.com/users/Jucgshu/following{/other_user}","gists_url":"https://api.github.com/users/Jucgshu/gists{/gist_id}","starred_url":"https://api.github.com/users/Jucgshu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jucgshu/subscriptions","organizations_url":"https://api.github.com/users/Jucgshu/orgs","repos_url":"https://api.github.com/users/Jucgshu/repos","events_url":"https://api.github.com/users/Jucgshu/events{/privacy}","received_events_url":"https://api.github.com/users/Jucgshu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-06-24T07:44:04Z","updated_at":"2018-07-08T07:30:02Z","closed_at":null,"author_association":"NONE","body":"Hi guys,\r\n\r\nEach time I try to edit a category's book, Calibre-web crashes with a 500 error.\r\n\r\nIs it just me?\r\n\r\n```[2018-06-24 08:31:03,355] ERROR in app: Exception on /admin/book/994 [POST]\r\nTraceback (most recent call last):\r\n  File \"/usr/lib/python2.7/site-packages/flask/app.py\", line 2292, in wsgi_app\r\n    response = self.full_dispatch_request()\r\n  File \"/usr/lib/python2.7/site-packages/flask/app.py\", line 1815, in full_dispatch_request\r\n    rv = self.handle_user_exception(e)\r\n  File \"/usr/lib/python2.7/site-packages/flask/app.py\", line 1718, in handle_user_exception\r\n    reraise(exc_type, exc_value, tb)\r\n  File \"/usr/lib/python2.7/site-packages/flask/app.py\", line 1813, in full_dispatch_request\r\n    rv = self.dispatch_request()\r\n  File \"/usr/lib/python2.7/site-packages/flask/app.py\", line 1799, in dispatch_request\r\n    return self.view_functions[rule.endpoint](**req.view_args)\r\n  File \"/app/calibre-web/cps/web.py\", line 393, in decorated_view\r\n    return login_required(func)(*args, **kwargs)\r\n  File \"/usr/lib/python2.7/site-packages/flask_login/utils.py\", line 261, in decorated_view\r\n    return func(*args, **kwargs)\r\n  File \"/app/calibre-web/cps/web.py\", line 516, in inner\r\n    return f(*args, **kwargs)\r\n  File \"/app/calibre-web/cps/web.py\", line 3092, in edit_book\r\n    if len(book.comments):\r\n  File \"/usr/lib/python2.7/site-packages/sqlalchemy/orm/attributes.py\", line 242, in __get__\r\n    return self.impl.get(instance_state(instance), dict_)\r\n  File \"/usr/lib/python2.7/site-packages/sqlalchemy/orm/attributes.py\", line 599, in get\r\n    value = self.callable_(state, passive)\r\n  File \"/usr/lib/python2.7/site-packages/sqlalchemy/orm/strategies.py\", line 630, in _load_for_state\r\n    session, state, primary_key_identity, passive)\r\n  File \"<string>\", line 1, in <lambda>\r\n  File \"/usr/lib/python2.7/site-packages/sqlalchemy/orm/strategies.py\", line 764, in _emit_lazyload\r\n    result = q(session).with_post_criteria(set_default_params).all()\r\n  File \"/usr/lib/python2.7/site-packages/sqlalchemy/ext/baked.py\", line 439, in all\r\n    return list(self)\r\n  File \"/usr/lib/python2.7/site-packages/sqlalchemy/ext/baked.py\", line 341, in __iter__\r\n    self.session._autoflush()\r\n  File \"/usr/lib/python2.7/site-packages/sqlalchemy/orm/session.py\", line 1444, in _autoflush\r\n    util.raise_from_cause(e)\r\n  File \"/usr/lib/python2.7/site-packages/sqlalchemy/util/compat.py\", line 203, in raise_from_cause\r\n    reraise(type(exception), exception, tb=exc_tb, cause=cause)\r\n  File \"/usr/lib/python2.7/site-packages/sqlalchemy/orm/session.py\", line 1434, in _autoflush\r\n    self.flush()\r\n  File \"/usr/lib/python2.7/site-packages/sqlalchemy/orm/session.py\", line 2254, in flush\r\n    self._flush(objects)\r\n  File \"/usr/lib/python2.7/site-packages/sqlalchemy/orm/session.py\", line 2380, in _flush\r\n    transaction.rollback(_capture_exception=True)\r\n  File \"/usr/lib/python2.7/site-packages/sqlalchemy/util/langhelpers.py\", line 66, in __exit__\r\n    compat.reraise(exc_type, exc_value, exc_tb)\r\n  File \"/usr/lib/python2.7/site-packages/sqlalchemy/orm/session.py\", line 2344, in _flush\r\n    flush_context.execute()\r\n  File \"/usr/lib/python2.7/site-packages/sqlalchemy/orm/unitofwork.py\", line 391, in execute\r\n    rec.execute(self)\r\n  File \"/usr/lib/python2.7/site-packages/sqlalchemy/orm/unitofwork.py\", line 556, in execute\r\n    uow\r\n  File \"/usr/lib/python2.7/site-packages/sqlalchemy/orm/persistence.py\", line 177, in save_obj\r\n    mapper, table, update)\r\n  File \"/usr/lib/python2.7/site-packages/sqlalchemy/orm/persistence.py\", line 768, in _emit_update_statements\r\n    execute(statement, multiparams)\r\n  File \"/usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py\", line 948, in execute\r\n    return meth(self, multiparams, params)\r\n  File \"/usr/lib/python2.7/site-packages/sqlalchemy/sql/elements.py\", line 269, in _execute_on_connection\r\n    return connection._execute_clauseelement(self, multiparams, params)\r\n  File \"/usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py\", line 1060, in _execute_clauseelement\r\n    compiled_sql, distilled_params\r\n  File \"/usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py\", line 1200, in _execute_context\r\n    context)\r\n  File \"/usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py\", line 1413, in _handle_dbapi_exception\r\n    exc_info\r\n  File \"/usr/lib/python2.7/site-packages/sqlalchemy/util/compat.py\", line 203, in raise_from_cause\r\n    reraise(type(exception), exception, tb=exc_tb, cause=cause)\r\n  File \"/usr/lib/python2.7/site-packages/sqlalchemy/engine/base.py\", line 1193, in _execute_context\r\n    context)\r\n  File \"/usr/lib/python2.7/site-packages/sqlalchemy/engine/default.py\", line 508, in do_execute\r\n    cursor.execute(statement, parameters)\r\nOperationalError: (raised as a result of Query-invoked autoflush; consider using a session.no_autoflush block if this flush is occurring prematurely) (sqlite3.OperationalError) attempt to write a readonly database [SQL: u'UPDATE books SET series_index=? WHERE books.id = ?'] [parameters: (u'1.0', 994)] (Background on this error at: http://sqlalche.me/e/e3q8)\r\n::ffff:172.19.0.2 - - [2018-06-24 08:31:03] \"POST /admin/book/994 HTTP/1.1\" 500 412 0.050423```"},"comment":{"url":"https://api.github.com/repos/janeczku/calibre-web/issues/comments/403268731","html_url":"https://github.com/janeczku/calibre-web/issues/531#issuecomment-403268731","issue_url":"https://api.github.com/repos/janeczku/calibre-web/issues/531","id":403268731,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMzI2ODczMQ==","user":{"login":"OzzieIsaacs","id":6438895,"node_id":"MDQ6VXNlcjY0Mzg4OTU=","avatar_url":"https://avatars1.githubusercontent.com/u/6438895?v=4","gravatar_id":"","url":"https://api.github.com/users/OzzieIsaacs","html_url":"https://github.com/OzzieIsaacs","followers_url":"https://api.github.com/users/OzzieIsaacs/followers","following_url":"https://api.github.com/users/OzzieIsaacs/following{/other_user}","gists_url":"https://api.github.com/users/OzzieIsaacs/gists{/gist_id}","starred_url":"https://api.github.com/users/OzzieIsaacs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OzzieIsaacs/subscriptions","organizations_url":"https://api.github.com/users/OzzieIsaacs/orgs","repos_url":"https://api.github.com/users/OzzieIsaacs/repos","events_url":"https://api.github.com/users/OzzieIsaacs/events{/privacy}","received_events_url":"https://api.github.com/users/OzzieIsaacs/received_events","type":"User","site_admin":false},"created_at":"2018-07-08T07:30:02Z","updated_at":"2018-07-08T07:30:02Z","author_association":"COLLABORATOR","body":"I checked it, for me no error occours. Nonetheless I improved the error handling during editing books. If the error still persits I need the calibre database for debugging. If you are willing to hand it over to me, please send my a email (email adress in my profile"}}
{"actor":{"display_login":"OzzieIsaacs"}}