Calibre web - Téléversement impossible

Bonjour,

Lors d’un téléversement à partir de n’importe quel navigateur l’erreur suivante apparait :

Erreur de la base de données: (raised as a result of Query-invoked autoflush; consider using a session.no_autoflush block if this flush is occurring prematurely) (sqlite3.OperationalError) disk I/O error [SQL: INSERT INTO books (title, sort, author_sort, timestamp, pubdate, series_index, last_modified, path, has_cover, uuid, isbn, flags) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)] [parameters: (‘Marie d’en haut’, ‘’, ‘Ledig, Agnès’, ‘2021-10-30 09:44:40.687568’, ‘0101-01-01 00:00:00.000000’, ‘1’, ‘2021-10-30 09:44:40.687582’, “Agnes Ledig/Marie d’en haut”, True, None, ‘’, 1)] (Background on this error at: Error Messages — SQLAlchemy 1.4 Documentation).

Sur Raspberry PI3+
Yunohost version 4.2.8.3
Calibre Web version 0.96.13~ynh1

Si vous avez une solution je suis preneur :slight_smile:
Dans l’attente de vous lire
Excellente Journée
Dominique Olivier

Ci-joint le fichier paste de calibre-web

LOGFILE: journalctl
-- Logs begin at Tue 2021-10-26 12:17:01 BST, end at Sat 2021-10-30 12:30:29 BST. --
Oct 26 12:17:11 systemd[1]: Started calibreweb.
Oct 30 11:46:37 systemd[1]: calibreweb.service: Current command vanished from the unit file, execution of the command list won't be resumed.

LOGFILE: /var/log/calibreweb/calibreweb.log
[2021-10-25 17:14:01,533]  INFO {cps.helper:701} Downloading file: /mnt/freebox/Bibliotheque_calibre/Coulon Alain/L'ecole de Chicago (614)/L'ecole de Chicago - Coulon Alain.epub
[2021-10-25 19:05:15,908]  INFO {cps.web:1406} Serving book: Recits avec figures - Antonio Tabucchi
[2021-10-25 19:07:56,921]  INFO {cps.web:1406} Serving book: L'Absolue Simplicite - Lucien Jerphagnon
[2021-10-26 07:49:35,417]  WARN {cps.config_sql:348} invalidating configuration
[2021-10-26 07:49:41,566]  WARN {fake_useragent:184} Error occurred during loading data. Trying to use cache server https://fake-useragent.herokuapp.com/browsers/0.1.11
Traceback (most recent call last):
  File "/var/www/calibreweb/vendor/fake_useragent/utils.py", line 154, in load
    for item in get_browsers(verify_ssl=verify_ssl):
  File "/var/www/calibreweb/vendor/fake_useragent/utils.py", line 99, in get_browsers
    html = html.split('<table class="w3-table-all notranslate">')[1]
IndexError: list index out of range
[2021-10-26 07:49:42,336]  INFO {cps:117} Starting Calibre Web...
[2021-10-26 07:49:43,022]  INFO {cps.server:205} Starting Gevent server on [::]:8083
[2021-10-30 08:11:57,411]  WARN {cps.config_sql:348} invalidating configuration
[2021-10-30 08:12:01,667]  WARN {fake_useragent:184} Error occurred during loading data. Trying to use cache server https://fake-useragent.herokuapp.com/browsers/0.1.11
Traceback (most recent call last):
  File "/var/www/calibreweb/vendor/fake_useragent/utils.py", line 154, in load
    for item in get_browsers(verify_ssl=verify_ssl):
  File "/var/www/calibreweb/vendor/fake_useragent/utils.py", line 99, in get_browsers
    html = html.split('<table class="w3-table-all notranslate">')[1]
IndexError: list index out of range
[2021-10-30 08:12:02,480]  INFO {cps:117} Starting Calibre Web...
[2021-10-30 08:12:03,305]  INFO {cps.server:205} Starting Gevent server on [::]:8083
[2021-10-30 09:49:35,675]  WARN {cps.web:1577} Login failed for user "dominique" IP-address: 192.168.0.254,192.168.0.254
[2021-10-30 09:54:17,086]  INFO {cps.web:1406} Serving book: Je M'En Vais - Jean Echenoz
[2021-10-30 10:01:11,657]  INFO {cps.shelf:265} Shelf Non terminé (Dominique) created
[2021-10-30 10:01:55,864]  INFO {cps.ub:829} Book 8800 archivebit toggled
[2021-10-30 10:02:22,473]  INFO {cps.shelf:265} Shelf A lire (Dominique) created
[2021-10-30 10:02:44,491]  INFO {cps.shelf:265} Shelf Lu (Dominique) created
[2021-10-30 10:04:24,196]  INFO {cps.ub:829} Book 11152 readbit toggled
[2021-10-30 10:08:57,050]  INFO {cps.helper:701} Downloading file: /mnt/freebox/Bibliotheque_calibre/Bonzon, Paul-Jacques/Les Six Compagnons a Scotland Yard (11690)/Les Six Compagnons a Scotland Yard - Bonzon, Paul-Jacques.epub
[2021-10-30 10:09:28,864] ERROR {cps.editbooks:1055} Database error: (raised as a result of Query-invoked autoflush; consider using a session.no_autoflush block if this flush is occurring prematurely)
(sqlite3.OperationalError) disk I/O error
[SQL: INSERT INTO books (title, sort, author_sort, timestamp, pubdate, series_index, last_modified, path, has_cover, uuid, isbn, flags) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]
[parameters: ('Les Six Compagnons à Scotland Yard', '', 'Bonzon, Paul-Jacques', '2021-10-30 09:09:28.815980', '0101-01-01 00:00:00.000000', '14', '2021-10-30 09:09:28.815995', 'Paul-Jacques Bonzon/Les Six Compagnons a Scotland Yard', True, None, '', 1)]
(Background on this error at: https://sqlalche.me/e/14/e3q8)
[2021-10-30 10:19:12,672] ERROR {cps.editbooks:1055} Database error: (sqlite3.OperationalError) disk I/O error
[SQL: INSERT INTO authors (name, sort, link) VALUES (?, ?, ?)]
[parameters: ('Inconnu', 'Inconnu', '')]
(Background on this error at: https://sqlalche.me/e/14/e3q8)
[2021-10-30 10:27:32,415]  INFO {cps.admin:1335} Missing entries on new user
[2021-10-30 10:27:52,087] ERROR {cps.helper:533} Invalid e-mail address format
[2021-10-30 10:32:55,132]  WARN {cps.web:1577} Login failed for user "freebox" IP-address: 192.168.0.254,192.168.0.254
[2021-10-30 10:39:19,892]  INFO {cps.web:1406} Serving book: Un noel so british - Caroline W. Barnes
[2021-10-30 10:44:40,711] ERROR {cps.editbooks:1055} Database error: (raised as a result of Query-invoked autoflush; consider using a session.no_autoflush block if this flush is occurring prematurely)
(sqlite3.OperationalError) disk I/O error
[SQL: INSERT INTO books (title, sort, author_sort, timestamp, pubdate, series_index, last_modified, path, has_cover, uuid, isbn, flags) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]
[parameters: ('Marie d’en haut', '', 'Ledig, Agnès', '2021-10-30 09:44:40.687568', '0101-01-01 00:00:00.000000', '1', '2021-10-30 09:44:40.687582', "Agnes Ledig/Marie d'en haut", True, None, '', 1)]
(Background on this error at: https://sqlalche.me/e/14/e3q8)
[2021-10-30 10:45:34,942]  INFO {cps.web:1406} Serving book: Juste avant le bonheur - Agnes Ledig

Hello
Peux tu vérifier les autorisations sur la base de données?
ls -la /var/www/calibreweb/app.db

Arrives tu à modifier des livres existants?

Les autorisations sont 444:
-rw-r–r-- 1 calibreweb calibreweb 98304 Oct 30 13:24 /var/www/calibreweb/app.db
j’ai les mêmes soucis pour modifier les métadonnées
en mettant 666 ou 777
ici 666
-rw-rw-rw- 1 calibreweb calibreweb 98304 Oct 30 13:24 /var/www/calibreweb/app.db
j’ai les mêmes soucis

Capture du navigateur

disk I/O error

naively that sounds like an hardware error regarding the disk the data are stored to …

Thanks for your suggest.
I have no error found on this disk

Bonjour
J’ai toujour les mêmes erreurs même en écrivant dans la fiche des métadonnées ( ex texte libre, série, etc). Les seules écritures qui fonctionnent sont sur app.db (étagères, etc).
Via Sqlite studio 3.3.3, j’écris parfaitement dans metadata.db (voir capture)

Pour me connecter à la db j’utilise cette ligne de commande:

sudo mount -t cifs //freebox-server.local/freebox /mnt/freebox -o user=freebox,password=XXXXXXXX,iocharset=utf8,file_mode=0777,dir_mode=0777,vers=1.0

ou

sudo mount -t cifs -o ,username=freebox,password=XXXXXXX,vers=1.0,uid=1000,gid=1000 //192.168.0.254/Freebox /mnt/freebox

les 2 fonctionnent.

Par contre l’erreur en écrivant via n’importe quel navigateur est la suivante (ou téléversement):
→ voir post suivant

Bonne journée
Merci

Ci-joint

LOGFILE: journalctl
-- Logs begin at Thu 2021-11-04 08:22:04 GMT, end at Thu 2021-11-04 08:51:36 GMT. --
Nov 04 08:22:14 systemd[1]: Started calibreweb.

LOGFILE: /var/log/calibreweb/calibreweb.log
[2021-11-04 08:49:18,677] ERROR {cps:1458} Exception on / [GET]
Traceback (most recent call last):
  File "/var/www/calibreweb/cps/db.py", line 711, in fill_indexpage_with_archived_books
    len(query.all()))
  File "/var/www/calibreweb/vendor/sqlalchemy/orm/query.py", line 2711, in all
    return self._iter().all()
  File "/var/www/calibreweb/vendor/sqlalchemy/orm/query.py", line 2849, in _iter
    execution_options={"_sa_orm_load_options": self.load_options},
  File "/var/www/calibreweb/vendor/sqlalchemy/orm/session.py", line 1688, in execute
    conn = self._connection_for_bind(bind)
  File "/var/www/calibreweb/vendor/sqlalchemy/orm/session.py", line 1530, in _connection_for_bind
    engine, execution_options
  File "/var/www/calibreweb/vendor/sqlalchemy/orm/session.py", line 721, in _connection_for_bind
    self._assert_active()
  File "/var/www/calibreweb/vendor/sqlalchemy/orm/session.py", line 608, in _assert_active
    code="7s2a",
sqlalchemy.exc.PendingRollbackError: This Session's transaction has been rolled back due to a previous exception during flush. To begin a new transaction with this Session, first issue Session.rollback(). Original exception was: (raised as a result of Query-invoked autoflush; consider using a session.no_autoflush block if this flush is occurring prematurely)
(sqlite3.OperationalError) disk I/O error
[SQL: UPDATE books SET author_sort=? WHERE books.id = ?]
[parameters: ('Yourcenar, Marguerite', 11914)]
(Background on this error at: https://sqlalche.me/e/14/e3q8) (Background on this error at: https://sqlalche.me/e/14/7s2a)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/var/www/calibreweb/vendor/flask/app.py", line 2073, in wsgi_app
    response = self.full_dispatch_request()
  File "/var/www/calibreweb/vendor/flask/app.py", line 1518, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/var/www/calibreweb/vendor/flask/app.py", line 1516, in full_dispatch_request
    rv = self.dispatch_request()
  File "/var/www/calibreweb/vendor/flask/app.py", line 1502, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "/var/www/calibreweb/cps/usermanagement.py", line 39, in decorated_view
    return login_required(func)(*args, **kwargs)
  File "/var/www/calibreweb/vendor/flask_login/utils.py", line 272, in decorated_view
    return func(*args, **kwargs)
  File "/var/www/calibreweb/cps/web.py", line 752, in index
    return render_books_list("newest", sort_param, 1, page)
  File "/var/www/calibreweb/cps/web.py", line 416, in render_books_list
    db.Series)
  File "/var/www/calibreweb/cps/db.py", line 679, in fill_indexpage
    return self.fill_indexpage_with_archived_books(page, pagesize, database, db_filter, order, False, *join)
  File "/var/www/calibreweb/cps/db.py", line 714, in fill_indexpage_with_archived_books
    log.debug_or_exception(ex)
  File "/var/www/calibreweb/cps/logger.py", line 51, in debug_or_exception
    self.error(message, stacklevel=2, *args, **kwargs)
  File "/usr/lib/python3.7/logging/__init__.py", line 1412, in error
    self._log(ERROR, msg, args, **kwargs)
TypeError: _log() got an unexpected keyword argument 'stacklevel'

Of course, I asked you to check app.db but the error is on metadata.db :roll_eyes:
Can you check if, from your yunohost instance, the disk is set in read/write? For example can you try to create a file in the same folder with touch /mnt/freebox/test?
When you test with sqlite studio, is it from the same computer from which your Yunohost instance is running?

I know that I had to change my freebox mount to vers=2.0 recently due to some upgrade on the freebox side that was putting my freebox HDD to read only otherwise.
For reference, my fstab:

//mafreebox.freebox.fr/Disque\040dur /media/freebox cifs vers=2.0,nofail,x-systemd.automount,x-systemd.device-timeout=10,username=freebox,password=XXXXXXX,cache=none,uid=1000,,iocharset=utf8,file_mode=0777,dir_mode=0777 0 0

Is it an (USB) SSD/HDD, or uSD card? SD-cards are not so fast, and no perfect targets for databases. Maybe the filesystem is OK, but the card too slow to keep up with changes in the SQLite-database.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.