Page MenuHomePhabricator

Cannot export in EPUB or PDF
Closed, ResolvedPublic

Description

There are two errors that appear when trying to export this page in EPUB or in PDF. Exporting in PDF or in EPUB is thus currently impossible.

EPUB:
Détails de l’erreur : The command "'ebook-convert' '/ws-export/var/file-cache/www-data/ws-c0_La_Divine_ComedieLamennais_1863L_Enfer_Chant_1-3084235824378082.epub' '/ws-export/var/file-cache/www-data/ws-c0_La_Divine_ComedieLamennais_1863L_Enfer_Chant_1-30842351398005587.mobi' '--page-breaks-before' '/'" failed. Exit Code: 1(General error) Working directory: /var/www/tool/public Output: ================ No write access to /var/www/.config/calibre using a temporary dir instead Error Output: ================ Traceback (most recent call last): File "/usr/bin/ebook-convert", line 20, in from calibre.ebooks.conversion.cli import main File "/usr/lib/calibre/calibre/__init__.py", line 18, in from calibre.constants import (iswindows, ismacos, islinux, isfrozen, File "/usr/lib/calibre/calibre/constants.py", line 389, in config_dir = tempfile.mkdtemp(prefix='calibre-config-') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/tempfile.py", line 496, in mkdtemp prefix, suffix, dir, output_type = _sanitize_params(prefix, suffix, dir) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/tempfile.py", line 265, in _sanitize_params dir = gettempdir() ^^^^^^^^^^^^ File "/usr/lib/python3.11/tempfile.py", line 438, in gettempdir return _os.fsdecode(_gettempdir()) ^^^^^^^^^^^^^ File "/usr/lib/python3.11/tempfile.py", line 431, in _gettempdir tempdir = _get_default_tempdir() ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/tempfile.py", line 362, in _get_default_tempdir raise FileNotFoundError(_errno.ENOENT, FileNotFoundError: [Errno 2] No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', '/var/www/tool/public']

PDF:
Détails de l’erreur : The command "'ebook-convert' '/ws-export/var/file-cache/www-data/ws-c0_La_Divine_ComedieLamennais_1863L_Enfer_Chant_1-3084079673891927.epub' '/ws-export/var/file-cache/www-data/ws-c0_La_Divine_ComedieLamennais_1863L_Enfer_Chant_1-30840791348597529.pdf' '--page-breaks-before' '/' '--paper-size' 'a5' '--pdf-page-margin-bottom' '32' '--pdf-page-margin-top' '40' '--pdf-page-margin-left' '24' '--pdf-page-margin-right' '24' '--pdf-page-numbers' '--preserve-cover-aspect-ratio'" failed. Exit Code: 1(General error) Working directory: /var/www/tool/public Output: ================ No write access to /var/www/.config/calibre using a temporary dir instead Error Output: ================ Traceback (most recent call last): File "/usr/bin/ebook-convert", line 20, in from calibre.ebooks.conversion.cli import main File "/usr/lib/calibre/calibre/__init__.py", line 18, in from calibre.constants import (iswindows, ismacos, islinux, isfrozen, File "/usr/lib/calibre/calibre/constants.py", line 389, in config_dir = tempfile.mkdtemp(prefix='calibre-config-') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/tempfile.py", line 496, in mkdtemp prefix, suffix, dir, output_type = _sanitize_params(prefix, suffix, dir) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/tempfile.py", line 265, in _sanitize_params dir = gettempdir() ^^^^^^^^^^^^ File "/usr/lib/python3.11/tempfile.py", line 438, in gettempdir return _os.fsdecode(_gettempdir()) ^^^^^^^^^^^^^ File "/usr/lib/python3.11/tempfile.py", line 431, in _gettempdir tempdir = _get_default_tempdir() ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/tempfile.py", line 362, in _get_default_tempdir raise FileNotFoundError(_errno.ENOENT, FileNotFoundError: [Errno 2] No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', '/var/www/tool/public']

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

The OS filesystem was full. :-( Fixed now.

The /tmp directory was filling up with Calibre config files, e.g.:

calibre-config-zqyjh7hh      calibre_6.13.0_tmp_e5pgym63  calibre_6.13.0_tmp_tjhz2cf8
calibre-config-78mnsl50  calibre-config-l2lb8gvq  calibre-config-zs8raj8_      calibre_6.13.0_tmp_e_lvpyol  calibre_6.13.0_tmp_tnu3bgga
calibre-config-7d6ivk_c  calibre-config-l2ly2xt9  calibre-config-ztev21pp      calibre_6.13.0_tmp_ebj81c79  calibre_6.13.0_tmp_tomeped8
calibre-config-7lrle6a8  calibre-config-l3298isd  calibre-config-zy00wa12      calibre_6.13.0_tmp_egmowgvb  calibre_6.13.0_tmp_tqvxum01
calibre-config-7njqhio5  calibre-config-l62bhiti  calibre_6.13.0_tmp_07dazxdc  calibre_6.13.0_tmp_eniwilxj  calibre_6.13.0_tmp_trz_nkp8
calibre-config-7r33uazf  calibre-config-lb6w2116  calibre_6.13.0_tmp_07ylgs3y  calibre_6.13.0_tmp_envrbvi2  calibre_6.13.0_tmp_tuwv42tj
calibre-config-7s7l8xag  calibre-config-lgkmug_j  calibre_6.13.0_tmp_08ex2h5t  calibre_6.13.0_tmp_eq28t2_v  calibre_6.13.0_tmp_tys5k_0v
calibre-config-7vz3mu2z  calibre-config-lgwdx0mt  calibre_6.13.0_tmp_0_yw9yqc  calibre_6.13.0_tmp_er2q867j  calibre_6.13.0_tmp_u3loqp02
calibre-config-7yg6kmee  calibre-config-liomybdp  calibre_6.13.0_tmp_0d6pykl7

The _tmp_ ones you can see there were being cleaned up daily, but the -config- ones weren't. I think I probably broke this during the upgrade to the new VPS (T332450).

The daily job was

find /tmp -path '*calibre_*_tmp*' -user www-data -mtime +1 -exec rm -r {} \;

So I've changed this to:

find /tmp -path '*calibre*' -user www-data -mtime +1 -exec rm -r {} \;

And updated the docs.

@Samwilson should we close this ticket if the issue is fixed?

Samwilson claimed this task.

Yep! I was just hesitating in case it filled up again overnight. But it's looking good:

samwilson@wsexport-prod02:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1        20G  4.1G   15G  22% /
/dev/sdb         40G   24G   15G  62% /ws-export