Page MenuHomePhabricator

Wikisource PDF export fails with No space left on device
Closed, ResolvedPublic

Description

  1. Wikisource
  2. Some book e.g. Woman of the Century
  3. Generate PDF.
  4. https://ws-export.wmcloud.org/?format=pdf&lang=en&page=Woman_of_the_Century

Another example: https://ws-export.wmcloud.org/tool/book.php?lang=pl&format=pdf-a5&page=W+lesie+(Junosza%2C+1878)

Error message:

An error occurred

Error details: The command "'ebook-convert' '/ws-export/var/file-cache/www-data/ws-c0_W_lesieJunosza1878_-238501914433147.epub' '/ws-export/var/file-cache/www-data/ws-c0_W_lesieJunosza1878_-238501324677027.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: ================ Conversion options changed from defaults: pdf_page_margin_left: 24.0 paper_size: u'a5' pdf_page_margin_right: 24.0 pdf_page_numbers: True pdf_page_margin_bottom: 32.0 preserve_cover_aspect_ratio: True pdf_page_margin_top: 40.0 Error Output: ================ Traceback (most recent call last): File "site.py", line 77, in main File "site-packages/calibre/ebooks/conversion/cli.py", line 401, in main File "site-packages/calibre/ebooks/conversion/plumber.py", line 1083, in run File "site-packages/calibre/ptempfile.py", line 204, in PersistentTemporaryDirectory File "site-packages/calibre/ptempfile.py", line 123, in base_dir File "tempfile.py", line 339, in mkdtemp OSError: [Errno 28] No space left on device: '/var/www/tool/var/calibre-temp/calibre_4.13.0_tmp_FM5YyW'

Related Objects

Event Timeline

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

I think the two-day window for clearing the cache files is now too much. I decreased it to 1.5 and it only cleared a little bit:

$ sudo find /ws-export/ -path '*calibre*' -user www-data -mtime +1.5 -exec rm -rv {} \;
$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/vdb         40G   35G  2.8G  93% /ws-export

Dropping it to one day only reduced the data volume to 88%.

Ah, this is a big part of it:

$ ls -hl /ws-export/var/log/prod.log 
-rw-r--r-- 1 www-data www-data 18G Dec 12 02:00 /ws-export/var/log/prod.log

Deleted that, and things are fine. I'll leave the cache-clearing at 1 day, and add logrotation for the above file.

Disk usage is now fine:

$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/vdb         40G   12G   26G  32% /ws-export

This is all sorted, at least for now.