gshang2017 / docker

Synology nas docker
587 stars 108 forks source link

autoaddbooks错误 #198

Closed RBZhu5900 closed 1 year ago

RBZhu5900 commented 1 year ago

往autoaddbooks文件夹里面放书籍之后每次只能导入部分书籍然后服务错误。 针对database is locked,google上有说是网络驱动器的问题,能麻烦优化或者给出解决方法么,感谢! 以下是网页上的部分日志。 Calibre-Web 500 Internal Server Error The server encountered an internal error and was unable to complete your request. There is an error in the application. Traceback (most recent call last): File "/usr/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1900, in _execute_context self.dialect.do_execute( File "/usr/lib/python3.10/site-packages/sqlalchemy/engine/default.py", line 736, in do_execute cursor.execute(statement, parameters) sqlite3.OperationalError: database is locked The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/lib/python3.10/site-packages/flask/app.py", line 2073, in wsgi_app response = self.full_dispatch_request() File "/usr/lib/python3.10/site-packages/flask/app.py", line 1519, in full_dispatch_request rv = self.handle_user_exception(e) File "/usr/lib/python3.10/site-packages/flask/app.py", line 1517, in full_dispatch_request rv = self.dispatch_request() File "/usr/lib/python3.10/site-packages/flask/app.py", line 1503, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(*req.view_args) File "/usr/local/calibre-web/app/cps/usermanagement.py", line 34, in decorated_view return func(args, **kwargs) File "/usr/local/calibre-web/app/cps/web.py", line 790, in index return render_books_list("newest", sort_param, 1, page) File "/usr/local/calibre-web/app/cps/web.py", line 408, in render_books_list entries, random, pagination = calibre_db.fill_indexpage(page, 0, db.Books, True, order[0], File "/usr/local/calibre-web/app/cps/db.py", line 782, in fill_indexpage return self.fill_indexpage_with_archived_books(page, database, pagesize, db_filter, order, False, File "/usr/local/calibre-web/app/cps/db.py", line 792, in fill_indexpage_with_archived_books .limit(self.config.config_random_books).all()) File "/usr/lib/python3.10/site-packages/sqlalchemy/orm/query.py", line 2773, in all return self._iter().all() File "/usr/lib/python3.10/site-packages/sqlalchemy/orm/query.py", line 2916, in _iter result = self.session.execute( File "/usr/lib/python3.10/site-packages/sqlalchemy/orm/session.py", line 1714, in execute result = conn._execute_20(statement, params or {}, execution_options) File "/usr/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1705, in _execute_20 return meth(self, args_10style, kwargs_10style, execution_options) File "/usr/lib/python3.10/site-packages/sqlalchemy/sql/elements.py", line 334, in _execute_on_connection return connection._execute_clauseelement( File "/usr/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1572, in _execute_clauseelement ret = self._execute_context( File "/usr/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1943, in _execute_context self._handle_dbapi_exception( File "/usr/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 2124, in _handle_dbapiexception util.raise( File "/usr/lib/python3.10/site-packages/sqlalchemy/util/compat.py", line 211, in raise_ raise exception File "/usr/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1900, in _execute_context self.dialect.do_execute( File "/usr/lib/python3.10/site-packages/sqlalchemy/engine/default.py", line 736, in do_execute cursor.execute(statement, parameters) sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) database is locked [SQL: SELECT books.id AS books_id, books.title AS books_title, books.sort AS books_sort, books.author_sort AS books_author_sort, books.timestamp AS books_timestamp, books.pubdate AS books_pubdate, books.series_index AS books_series_index, books.last_modified AS books_last_modified, books.path AS books_path, books.has_cover AS books_has_cover, books.uuid AS books_uuid, books.isbn AS books_isbn, books.flags AS books_flags, archived_book.is_archived AS archived_book_is_archived, book_read_link.read_status AS book_read_link_read_status FROM books LEFT OUTER JOIN book_read_link ON book_read_link.user_id = ? AND book_read_link.book_id = books.id LEFT OUTER JOIN archived_book ON books.id = archived_book.book_id AND archived_book.user_id = ? WHERE (books.id NOT IN (SELECT 1 FROM (SELECT 1) WHERE 1!=1)) ORDER BY random() LIMIT ? OFFSET ?] [parameters: (1, 1, 4, 0)] (Background on this error at: https://sqlalche.me/e/14/e3q8) Please report this issue with all related information: 创建问题 回到首页

RBZhu5900 commented 1 year ago

第一次autoaddbooks没有问题,我成功录入了超过1000本书。 可能是因为docker和书籍不在一个volume里面吗?calibre不支持网络驱动器? https://coderwall.com/p/zrxobw/calibre-libraries-on-nas 这是可能的解决方法,但我不是很理解怎么操作。 直接修改容器fstab?我感觉不大行

从calibre-web上传书籍没有问题

RBZhu5900 commented 1 year ago

破案了。是volume的问题。autoaddbooks和docker在同一个volume就可以导入了。但是速度实在是慢的发瘟。导了一天才导入几百本。