Skip to content

Corrupted preview *-max.png blocks generation of other previews #7749

Description

@streckus

Steps to reproduce

  1. Upload around 100 pictures in a folder
  2. Visit folder in files or gallery app
  3. If resources are limited preview generation for some files might crash, resulting in a corrupted *-max.png file.

Expected behaviour

When visiting the folder again and that broken preview is detected (e.g. Gallery app throws "Exception: Preview generation has failed"), the broken file should be regenerated to not block generation of other previews.

Actual behaviour

The software seems to assume the only cause for the broken preview can be a broken file in the first place, so the broken preview file blocks further preview generation. Manually removing the corrupted preview file and running occ files:scan-app-data to update the cache enables new preview generation at next folder visit.

Server configuration

Operating system: Arch Linux ARM (on Raspberry Pi 3)

Web server: Apache 2.4.29

Database: MariaDB 10.1.30

PHP version: 7.0.26

Nextcloud version: 12.0.4

Updated from an older Nextcloud/ownCloud or fresh install: fresh install

Where did you install Nextcloud from: Arch Repositories

Signing status:

Signing status
No errors have been found.

List of activated apps:

App list
Enabled:
  - activity: 2.5.2
  - comments: 1.2.0
  - dav: 1.3.0
  - federatedfilesharing: 1.2.0
  - federation: 1.2.0
  - files: 1.7.2
  - files_pdfviewer: 1.1.1
  - files_sharing: 1.4.0
  - files_texteditor: 2.4.1
  - files_trashbin: 1.2.0
  - files_versions: 1.5.0
  - files_videoplayer: 1.1.0
  - firstrunwizard: 2.1
  - gallery: 17.0.0
  - logreader: 2.0.0
  - lookup_server_connector: 1.0.0
  - music: 0.5.5
  - nextcloud_announcements: 1.1
  - notifications: 2.0.0
  - oauth2: 1.0.5
  - password_policy: 1.2.2
  - provisioning_api: 1.2.0
  - serverinfo: 1.2.0
  - sharebymail: 1.2.0
  - survey_client: 1.0.0
  - systemtags: 1.2.0
  - theming: 1.3.0
  - twofactor_backupcodes: 1.1.1
  - updatenotification: 1.2.0
  - workflowengine: 1.2.0
Disabled:
  - admin_audit
  - encryption
  - files_external
  - user_external
  - user_ldap

Nextcloud configuration:

Config report
{
    "system": {
        "instanceid": "ocmuug5kqo74",
        "apps_paths": [
            {
                "path": "\/usr\/share\/webapps\/nextcloud\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/mnt\/nextcloud_data\/nextcloud\/apps2",
                "url": "\/apps2",
                "writable": true
            }
        ],
        "datadirectory": "\/mnt\/nextcloud_data\/nextcloud\/data",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "streckemich.ddns.net"
        ],
        "overwrite.cli.url": "https:\/\/streckemich.ddns.net",
        "dbtype": "mysql",
        "version": "12.0.4.3",
        "dbname": "nextcloud",
        "dbhost": "localhost",
        "dbport": "",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "memcache.local": "\\OC\\Memcache\\APCu",
        "mail_smtpmode": "sendmail",
        "mail_smtpauthtype": "LOGIN",
        "mail_smtpauth": 1,
        "mail_smtphost": "securesmtp.t-online.de",
        "mail_smtpport": "465",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpsecure": "ssl",
        "mail_from_address": "nextcloud",
        "mail_domain": "streckemich.ddns.net",
        "enable_previews": true,
        "enabledPreviewProviders": [
            "OC\\Preview\\PNG",
            "OC\\Preview\\JPEG",
            "OC\\Preview\\GIF",
            "OC\\Preview\\BMP",
            "OC\\Preview\\XBitmap",
            "OC\\Preview\\MP3",
            "OC\\Preview\\TXT",
            "OC\\Preview\\MarkDown",
            "OC\\Preview\\Movie",
            "OC\\Preview\\PDF"
        ],
        "maintenance": false,
        "log_level": 0
    },
    "apps": {
        "activity": {
            "enabled": "yes",
            "installed_version": "2.5.2",
            "types": "filesystem"
        },
        "backgroundjob": {
            "lastjob": "823"
        },
        "bruteforcesettings": {
            "enabled": "no",
            "installed_version": "1.0.3",
            "types": ""
        },
        "comments": {
            "enabled": "yes",
            "installed_version": "1.2.0",
            "types": "logging"
        },
        "core": {
            "installed.bundles": "[\"CoreBundle\"]",
            "installedat": "1514663107.139",
            "lastcron": "1515452039",
            "lastupdateResult": "[]",
            "lastupdatedat": "1515451325",
            "oc.integritycheck.checker": "[]",
            "public_files": "files_sharing\/public.php",
            "public_webdav": "dav\/appinfo\/v1\/publicwebdav.php",
            "scss.variables": "1f5da376b00eb86a92030ba656c8f86c",
            "vendor": "nextcloud"
        },
        "dav": {
            "enabled": "yes",
            "installed_version": "1.3.0",
            "types": "filesystem"
        },
        "federatedfilesharing": {
            "enabled": "yes",
            "installed_version": "1.2.0",
            "types": ""
        },
        "federation": {
            "enabled": "yes",
            "installed_version": "1.2.0",
            "types": "authentication"
        },
        "files": {
            "cronjob_scan_files": "500",
            "enabled": "yes",
            "installed_version": "1.7.2",
            "types": "filesystem"
        },
        "files_pdfviewer": {
            "enabled": "yes",
            "installed_version": "1.1.1",
            "ocsid": "166049",
            "types": ""
        },
        "files_sharing": {
            "enabled": "yes",
            "installed_version": "1.4.0",
            "types": "filesystem"
        },
        "files_texteditor": {
            "enabled": "yes",
            "installed_version": "2.4.1",
            "ocsid": "166051",
            "types": ""
        },
        "files_trashbin": {
            "enabled": "yes",
            "installed_version": "1.2.0",
            "types": "filesystem"
        },
        "files_versions": {
            "enabled": "yes",
            "installed_version": "1.5.0",
            "types": "filesystem"
        },
        "files_videoplayer": {
            "enabled": "yes",
            "installed_version": "1.1.0",
            "types": ""
        },
        "firstrunwizard": {
            "enabled": "yes",
            "installed_version": "2.1",
            "types": "logging"
        },
        "folderplayer": {
            "enabled": "no",
            "installed_version": "10.0.0",
            "types": ""
        },
        "gallery": {
            "enabled": "yes",
            "installed_version": "17.0.0",
            "types": ""
        },
        "logreader": {
            "enabled": "yes",
            "installed_version": "2.0.0",
            "ocsid": "170871",
            "types": ""
        },
        "lookup_server_connector": {
            "enabled": "yes",
            "installed_version": "1.0.0",
            "types": "authentication"
        },
        "music": {
            "enabled": "yes",
            "installed_version": "0.5.5",
            "types": "filesystem"
        },
        "nextcloud_announcements": {
            "enabled": "yes",
            "installed_version": "1.1",
            "pub_date": "Sat, 10 Dec 2016 00:00:00 +0100",
            "types": "logging"
        },
        "notifications": {
            "enabled": "yes",
            "installed_version": "2.0.0",
            "types": "logging"
        },
        "oauth2": {
            "enabled": "yes",
            "installed_version": "1.0.5",
            "types": "authentication"
        },
        "password_policy": {
            "enabled": "yes",
            "installed_version": "1.2.2",
            "types": ""
        },
        "previewgenerator": {
            "enabled": "no",
            "heightSizes": "256",
            "installed_version": "1.0.9",
            "squareSizes": "32",
            "types": "filesystem",
            "widthSizes": "256"
        },
        "provisioning_api": {
            "enabled": "yes",
            "installed_version": "1.2.0",
            "types": "prevent_group_restriction"
        },
        "radio": {
            "enabled": "no",
            "installed_version": "0.6.0",
            "types": ""
        },
        "serverinfo": {
            "enabled": "yes",
            "installed_version": "1.2.0",
            "types": ""
        },
        "sharebymail": {
            "enabled": "yes",
            "installed_version": "1.2.0",
            "types": "filesystem"
        },
        "survey_client": {
            "enabled": "yes",
            "installed_version": "1.0.0",
            "types": ""
        },
        "systemtags": {
            "enabled": "yes",
            "installed_version": "1.2.0",
            "types": "logging"
        },
        "theming": {
            "cachebuster": "2",
            "enabled": "yes",
            "installed_version": "1.3.0",
            "types": "logging"
        },
        "twofactor_backupcodes": {
            "enabled": "yes",
            "installed_version": "1.1.1",
            "types": ""
        },
        "updatenotification": {
            "enabled": "yes",
            "installed_version": "1.2.0",
            "types": "",
            "update_check_errors": "0"
        },
        "workflowengine": {
            "enabled": "yes",
            "installed_version": "1.2.0",
            "types": "filesystem"
        }
    }
}

Are you using external storage, if yes which one: no

Are you using encryption: no

Are you using an external user-backend, if yes which one: no

Client configuration

Browser: Opera (Also tested on Firefox)

Operating system: Arch Linux, Windows 10, Linux Mint 17.3

Logs

Nextcloud log (data/nextcloud.log)

Nextcloud log
{"reqId":"AxdzGrAhccjYzDD3OWH2","level":3,"time":"2018-01-08T20:41:18+00:00","remoteAddr":"192.168.2.114","user":"NextAdmin","app":"gallery","method":"GET","url":"\/index.php\/apps\/gallery\/thumbnails?ids=16859%3B16858%3B16860%3B16861%3B16864%3B16863&scale=1&square=0&requesttoken=CKVhdQsuNWUWsbnz9xfVO8THE3LxiAqz2uka3Bd%2BI3Y%3D%3AacJUBTlDclBH%2FPiip2W2DoyWJEbF%2BEaD7p8vjEJGYRk%3D","message":"Exception: Preview generation has failed","userAgent":"Mozilla\/5.0 (X11; Linux x86_64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/63.0.3239.108 Safari\/537.36 OPR\/50.0.2762.45","version":"12.0.4.3"}
{"reqId":"kvT8wGniKAZx1EE62Mw8","level":3,"time":"2018-01-08T20:41:19+00:00","remoteAddr":"192.168.2.114","user":"NextAdmin","app":"gallery","method":"GET","url":"\/index.php\/apps\/gallery\/thumbnails?ids=16866%3B16867%3B16870%3B16872%3B16874%3B16875&scale=1&square=0&requesttoken=CKVhdQsuNWUWsbnz9xfVO8THE3LxiAqz2uka3Bd%2BI3Y%3D%3AacJUBTlDclBH%2FPiip2W2DoyWJEbF%2BEaD7p8vjEJGYRk%3D","message":"Exception: Preview generation has failed","userAgent":"Mozilla\/5.0 (X11; Linux x86_64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/63.0.3239.108 Safari\/537.36 OPR\/50.0.2762.45","version":"12.0.4.3"}
{"reqId":"ettJH94uoCs3ffS2rRjh","level":3,"time":"2018-01-08T20:42:03+00:00","remoteAddr":"192.168.2.114","user":"NextAdmin","app":"gallery","method":"GET","url":"\/index.php\/apps\/gallery\/thumbnails?ids=16859%3B16858%3B16860%3B16861%3B16864%3B16863&scale=1&square=0&requesttoken=DBC0o0npm8JVwTl4mwq%2Fg0Fd76TAhqBveBQpVDDDAg8%3D%3AbXeB03uE3PcEjHgpy3jctgkM2JD09uxfTGIcBGX7QGA%3D","message":"Exception: Preview generation has failed","userAgent":"Mozilla\/5.0 (X11; Linux x86_64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/63.0.3239.108 Safari\/537.36 OPR\/50.0.2762.45","version":"12.0.4.3"}
{"reqId":"o8SDlmDBrAcUxrw2r2tC","level":3,"time":"2018-01-08T20:42:03+00:00","remoteAddr":"192.168.2.114","user":"NextAdmin","app":"gallery","method":"GET","url":"\/index.php\/apps\/gallery\/thumbnails?ids=16866%3B16867%3B16870%3B16872%3B16874%3B16875&scale=1&square=0&requesttoken=DBC0o0npm8JVwTl4mwq%2Fg0Fd76TAhqBveBQpVDDDAg8%3D%3AbXeB03uE3PcEjHgpy3jctgkM2JD09uxfTGIcBGX7QGA%3D","message":"Exception: Preview generation has failed","userAgent":"Mozilla\/5.0 (X11; Linux x86_64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/63.0.3239.108 Safari\/537.36 OPR\/50.0.2762.45","version":"12.0.4.3"}
{"reqId":"UY6IzkWYSC7BaRmDYzMZ","level":3,"time":"2018-01-08T20:43:38+00:00","remoteAddr":"192.168.2.114","user":"NextAdmin","app":"gallery","method":"GET","url":"\/index.php\/apps\/gallery\/thumbnails?ids=16859%3B16858%3B16860%3B16861%3B16864%3B16863&scale=1&square=0&requesttoken=gp9ott4iV%2B9As0c93ot9At0srOKMBylQpxlt0DOg4fo%3D%3A1vkN5LpzH71wyzZVvKAbb%2FZ%2Bh6DlVXAS401YklLV0rU%3D","message":"Exception: Preview generation has failed","userAgent":"Mozilla\/5.0 (X11; Linux x86_64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/63.0.3239.108 Safari\/537.36 OPR\/50.0.2762.45","version":"12.0.4.3"}
{"reqId":"v7kSysF0ObdMgBTSrJ65","level":3,"time":"2018-01-08T20:43:38+00:00","remoteAddr":"192.168.2.114","user":"NextAdmin","app":"gallery","method":"GET","url":"\/index.php\/apps\/gallery\/thumbnails?ids=16866%3B16867%3B16870%3B16872%3B16874%3B16875&scale=1&square=0&requesttoken=gp9ott4iV%2B9As0c93ot9At0srOKMBylQpxlt0DOg4fo%3D%3A1vkN5LpzH71wyzZVvKAbb%2FZ%2Bh6DlVXAS401YklLV0rU%3D","message":"Exception: Preview generation has failed","userAgent":"Mozilla\/5.0 (X11; Linux x86_64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/63.0.3239.108 Safari\/537.36 OPR\/50.0.2762.45","version":"12.0.4.3"}
{"reqId":"MbX1LSJRhOHYN3Nqned9","level":3,"time":"2018-01-08T20:47:08+00:00","remoteAddr":"192.168.2.114","user":"NextAdmin","app":"gallery","method":"GET","url":"\/index.php\/apps\/gallery\/thumbnails?ids=16859%3B16858%3B16860%3B16861%3B16864%3B16863&scale=1&square=0&requesttoken=xtjCcdmxL6cqRjV1w32KULF5P4IQYP245nNyohSZJHk%3D%3Akr6nI73gZ%2FUaPkQdoVbsPZorFMB5MqT6oidH4HXsFzY%3D","message":"Exception: Preview generation has failed","userAgent":"Mozilla\/5.0 (X11; Linux x86_64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/63.0.3239.108 Safari\/537.36 OPR\/50.0.2762.45","version":"12.0.4.3"}
{"reqId":"JfxT1eWBIhcSgzmq7BQg","level":3,"time":"2018-01-08T20:47:08+00:00","remoteAddr":"192.168.2.114","user":"NextAdmin","app":"gallery","method":"GET","url":"\/index.php\/apps\/gallery\/thumbnails?ids=16866%3B16867%3B16870%3B16872%3B16874%3B16875&scale=1&square=0&requesttoken=xtjCcdmxL6cqRjV1w32KULF5P4IQYP245nNyohSZJHk%3D%3Akr6nI73gZ%2FUaPkQdoVbsPZorFMB5MqT6oidH4HXsFzY%3D","message":"Exception: Preview generation has failed","userAgent":"Mozilla\/5.0 (X11; Linux x86_64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/63.0.3239.108 Safari\/537.36 OPR\/50.0.2762.45","version":"12.0.4.3"}
{"reqId":"UxhIIwxDN4Vsb6UWV9KI","level":3,"time":"2018-01-08T21:21:12+00:00","remoteAddr":"192.168.2.114","user":"NextAdmin","app":"gallery","method":"GET","url":"\/index.php\/apps\/gallery\/thumbnails?ids=16859%3B16858%3B16860%3B16861%3B16864%3B16863&scale=1&square=0&requesttoken=8t1lSzLcR9ZVSDfRuZA6uVwB4Sk%2F56CbqQv4u%2BKB3ms%3D%3AprsAGVaND4RlMEa527tc1HdTymtWtfnZ7V%2FN%2BYP07SQ%3D","message":"Exception: Preview generation has failed","userAgent":"Mozilla\/5.0 (X11; Linux x86_64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/63.0.3239.108 Safari\/537.36 OPR\/50.0.2762.45","version":"12.0.4.3"}
{"reqId":"8PKZ97iqdYFnqHbhtFGK","level":3,"time":"2018-01-08T21:21:13+00:00","remoteAddr":"192.168.2.114","user":"NextAdmin","app":"gallery","method":"GET","url":"\/index.php\/apps\/gallery\/thumbnails?ids=16866%3B16867%3B16870%3B16872%3B16874%3B16875&scale=1&square=0&requesttoken=8t1lSzLcR9ZVSDfRuZA6uVwB4Sk%2F56CbqQv4u%2BKB3ms%3D%3AprsAGVaND4RlMEa527tc1HdTymtWtfnZ7V%2FN%2BYP07SQ%3D","message":"Exception: Preview generation has failed","userAgent":"Mozilla\/5.0 (X11; Linux x86_64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/63.0.3239.108 Safari\/537.36 OPR\/50.0.2762.45","version":"12.0.4.3"}

Activity

  1. MorrisJobke commented on Jan 9, 2018

    @MorrisJobke
    Member
  2. rullzer commented on Jan 9, 2018

    @rullzer
    Member

    mmmm yes that makes sense. Because all the previews are generated from the max preview...

    @streckus is the size of your max always zero?

  3. streckus commented on Jan 9, 2018

    @streckus
    Author

    @rullzer Yes, the file size of the max is zero for the failed files I had so far.

    I already read about all previews being generated from the max (which I think in general is a reasonable thing to do).
    This bug also affects the preview generator app in the store (also tries to use the max, if it exists and crashes if the max is corrupt).

    I think one can prevent this bug from happening by using the preview generator app from the beginning (creates previews in single thread so is less likely to crash, while the on-demand preview generation rapidly runs into the limit of threads possible on the Raspberry Pi and uses almost all of its RAM).

    I will try the following workaround for fixing my existing Photo folders:

    1. Delete all previews from filesystem
    2. Update filecache for previews using occ files:scan-app-data
    3. Run occ preview:generate-all after setting the sizes to the ones the Gallery needs (32 square and 256 height for desktop and 128 square and 1024 height for mobile, width set to 0 for not generating any previews according to this rule).
  4. rullzer commented on Jan 10, 2018

    @rullzer
    Member

    Yes the preview generation app uses the same stuff from the server as the other preview routes use.

    I'll see if we can catch this bad behaviour by checking the size of the max, and maybe even checking if the file is a valid image (if we try to resize).

    I guess the easiest solution would be:

    1. Check if the maxpreview has a size in https://github.com/nextcloud/server/blob/master/lib/private/Preview/Generator.php#L112
    2. Convert https://github.com/nextcloud/server/blob/master/lib/private/Preview/Generator.php#L332
    • Throw Not found exception instead of invalid argument (better to fail with a 404 I guess)
    • Delete the max preview if it is invalid

    This will cause that preview request to fail with a 404. But at least it will be fully generated next time it is requested. It should not happen that often anyways ;)

    I'll take care of this once we are done with 13.

  5. self-assigned this
    on Jan 10, 2018
  6. added this to the Nextcloud 14 milestone on Jan 10, 2018
  7. added
    1. to developAccepted and waiting to be taken care of
    and removed
    0. Needs triagePending check for reproducibility or if it fits our roadmap
    on Jan 10, 2018
  8. streckus commented on Jan 10, 2018

    @streckus
    Author

    Sounds like a good plan :)

  9. ArnisR commented on Jan 12, 2018

    @ArnisR

    Sometimes other preview sizes are corrupted too. All of them had 0 size. So I just run cronjob every 30 min. which deletes preview files with 0 size. On next access they are regenerated fine.

    find "/path_to_NC_appdata/preview" -size 0 -delete

  10. rullzer commented on Jan 12, 2018

    @rullzer
    Member

    @ArnisR mmm can you check if they also have a size of zero in the filecache?

  11. ArnisR commented on Jan 12, 2018

    @ArnisR

    @rullzer Ok, I'll try. I deactivated cronjob and will take a look after when/if corrupted previews appears.

  12. rullzer commented on Jan 12, 2018

    @rullzer
    Member

    Thanks! :)

  13. ArnisR commented on Jan 12, 2018

    @ArnisR

    @rullzer
    I find one previous error in log. Maybe it gives some info. It is caused by lock timeout.

    Error index Doctrine\DBAL\Exception\DriverException: An exception occurred while executing 'UPDATEoc_filecacheSETmtime= ?,storage_mtime=? WHERE (mtime<> ? ORstorage_mtime<> ? ORmtimeIS NULL ORstorage_mtimeIS NULL) ANDfileid= ? ' with params [1515763335, 1515763335, 1515763335, 1515763335, 1535624]: SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction /var/www/web/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php - line 128: Doctrine\DBAL\Driver\AbstractMySQLDriver->convertException('An exception oc...', Object(Doctrine\DBAL\Driver\PDOException)) /var/www/web/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php - line 855: Doctrine\DBAL\DBALException driverExceptionDuringQuery(Object(Doctrine\DBAL\Driver\PDOMySql\Driver), Object(Doctrine\DBAL\Driver\PDOException), 'UPDATEoc_file...', Array)
    /var/www/web/lib/private/DB/Connection.php - line 192: Doctrine\DBAL\Connection->executeQuery('UPDATE oc_file...', Array, Array, NULL) /var/www/web/lib/private/Files/Cache/Cache.php - line 320: OC\DB\Connection->executeQuery('UPDATE oc_file...', Array)
    /var/www/web/lib/private/Files/Cache/Updater.php - line 247: OC\Files\Cache\Cache->update(1535624, Array)
    /var/www/web/lib/private/Files/Cache/Updater.php - line 137: OC\Files\Cache\Updater->correctParentStorageMtime('appdata_ocvyoyj...')
    /var/www/web/lib/private/Files/View.php - line 321: OC\Files\Cache\Updater->update('appdata_ocvyoyj...', 1515763335)
    /var/www/web/lib/private/Files/View.php - line 1151: OC\Files\View->writeUpdate(Object(OCA\Files_Trashbin\Storage), 'appdata_ocvyoyj...')
    /var/www/web/lib/private/Files/View.php - line 559: OC\Files\View->basicOperation('touch', '/appdata_ocvyoy...', Array, NULL)
    /var/www/web/lib/private/Files/Node/Folder.php - line 181: OC\Files\View->touch('/appdata_ocvyoy...')
    /var/www/web/lib/private/Files/SimpleFS/SimpleFolder.php - line 83: OC\Files\Node\Folder->newFile('128-128-crop.pn...')
    /var/www/web/lib/private/Preview/Generator.php - line 337: OC\Files\SimpleFS\SimpleFolder->newFile('128-128-crop.pn...')
    /var/www/web/lib/private/Preview/Generator.php - line 125: OC\Preview\Generator->generatePreview(Object(OC\Files\SimpleFS\SimpleFolder), Object(OC\Files\SimpleFS\SimpleFile), 128, 128, true, 667, 1000)
    /var/www/web/lib/private/PreviewManager.php - line 201: OC\Preview\Generator->getPreview(Object(OC\Files\Node\File), 128, 128, true, 'fill', 'image/jpeg')
    /var/www/web/core/Controller/PreviewController.php - line 113: OC\PreviewManager->getPreview(Object(OC\Files\Node\File), 96, 96, true, 'fill')
    [internal function] OC\Core\Controller\PreviewController->getPreview(Object(OC\Files\Node\File), 96, 96, false, false, 'fill')
    /var/www/web/lib/private/AppFramework/Http/Dispatcher.php - line 160: call_user_func_array(Array, Array)
    /var/www/web/lib/private/AppFramework/Http/Dispatcher.php - line 90: OC\AppFramework\Http\Dispatcher->executeController(Object(OC\Core\Controller\PreviewController), 'getPreview')
    /var/www/web/lib/private/AppFramework/App.php - line 114: OC\AppFramework\Http\Dispatcher->dispatch(Object(OC\Core\Controller\PreviewController), 'getPreview')
    /var/www/web/lib/private/AppFramework/Routing/RouteActionHandler.php - line 47: OC\AppFramework\App main('OC\Core\Control...', 'getPreview', Object(OC\AppFramework\DependencyInjection\DIContainer), Array)
    [internal function] OC\AppFramework\Routing\RouteActionHandler->__invoke(Array)
    /var/www/web/lib/private/Route/Router.php - line 299: call_user_func(Object(OC\AppFramework\Routing\RouteActionHandler), Array)
    /var/www/web/lib/base.php - line 1004: OC\Route\Router->match('/core/preview.p...')
    /var/www/web/index.php - line 48: OC handleRequest()
    {main}
    `

  14. ArnisR commented on Jan 20, 2018

    @ArnisR

    @rullzer Ok, catch it.
    This time preview 128-128-crop.png has size 0. It is not pre-generated preview, but on-demand (from mobile browser I suppose)

    filecache table has this entry and size is also 0.

    NC has error logged ~ at the time of creation of preview:

    Error index Doctrine\DBAL\Exception\DriverException: An exception occurred while executing 'UPDATE oc_filecache SET mtime = ?, storage_mtime=? WHERE (mtime <> ? OR storage_mtime <> ? OR mtime IS NULL OR storage_mtime IS NULL) AND fileid = ? ' with params [1516278555, 1516278555, 1516278555, 1516278555, 1478155]: SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction
    /var/www/web/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php - line 128: Doctrine\DBAL\Driver\AbstractMySQLDriver->convertException('An exception oc...', Object(Doctrine\DBAL\Driver\PDOException))
    /var/www/web/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php - line 855: Doctrine\DBAL\DBALException driverExceptionDuringQuery(Object(Doctrine\DBAL\Driver\PDOMySql\Driver), Object(Doctrine\DBAL\Driver\PDOException), 'UPDATE oc_file...', Array) /var/www/web/lib/private/DB/Connection.php - line 192: Doctrine\DBAL\Connection->executeQuery('UPDATE oc_file...', Array, Array, NULL)
    /var/www/web/lib/private/Files/Cache/Cache.php - line 320: OC\DB\Connection->executeQuery('UPDATE `oc_file...', Array)
    /var/www/web/lib/private/Files/Cache/Updater.php - line 247: OC\Files\Cache\Cache->update(1478155, Array)
    /var/www/web/lib/private/Files/Cache/Updater.php - line 137: OC\Files\Cache\Updater->correctParentStorageMtime('appdata_ocvyoyj...')
    /var/www/web/lib/private/Files/View.php - line 321: OC\Files\Cache\Updater->update('appdata_ocvyoyj...', 1516278555)
    /var/www/web/lib/private/Files/View.php - line 1151: OC\Files\View->writeUpdate(Object(OCA\Files_Trashbin\Storage), 'appdata_ocvyoyj...')
    /var/www/web/lib/private/Files/View.php - line 559: OC\Files\View->basicOperation('touch', '/appdata_ocvyoy...', Array, NULL)
    /var/www/web/lib/private/Files/Node/Folder.php - line 181: OC\Files\View->touch('/appdata_ocvyoy...')
    /var/www/web/lib/private/Files/SimpleFS/SimpleFolder.php - line 83: OC\Files\Node\Folder->newFile('128-128-crop.pn...')
    /var/www/web/lib/private/Preview/Generator.php - line 337: OC\Files\SimpleFS\SimpleFolder->newFile('128-128-crop.pn...')
    /var/www/web/lib/private/Preview/Generator.php - line 125: OC\Preview\Generator->generatePreview(Object(OC\Files\SimpleFS\SimpleFolder), Object(OC\Files\SimpleFS\SimpleFile), 128, 128, true, 667, 1000)
    /var/www/web/lib/private/PreviewManager.php - line 201: OC\Preview\Generator->getPreview(Object(OC\Files\Node\File), 128, 128, true, 'fill', 'image/jpeg')
    /var/www/web/core/Controller/PreviewController.php - line 113: OC\PreviewManager->getPreview(Object(OC\Files\Node\File), 96, 96, true, 'fill')
    [internal function] OC\Core\Controller\PreviewController->getPreview(Object(OC\Files\Node\File), 96, 96, false, false, 'fill')
    /var/www/web/lib/private/AppFramework/Http/Dispatcher.php - line 160: call_user_func_array(Array, Array)
    /var/www/web/lib/private/AppFramework/Http/Dispatcher.php - line 90: OC\AppFramework\Http\Dispatcher->executeController(Object(OC\Core\Controller\PreviewController), 'getPreview')
    /var/www/web/lib/private/AppFramework/App.php - line 114: OC\AppFramework\Http\Dispatcher->dispatch(Object(OC\Core\Controller\PreviewController), 'getPreview')
    /var/www/web/lib/private/AppFramework/Routing/RouteActionHandler.php - line 47: OC\AppFramework\App main('OC\Core\Control...', 'getPreview', Object(OC\AppFramework\DependencyInjection\DIContainer), Array)
    [internal function] OC\AppFramework\Routing\RouteActionHandler->__invoke(Array)
    /var/www/web/lib/private/Route/Router.php - line 299: call_user_func(Object(OC\AppFramework\Routing\RouteActionHandler), Array)
    /var/www/web/lib/base.php - line 1004: OC\Route\Router->match('/core/preview.p...')
    /var/www/web/index.php - line 48: OC handleRequest()
    {main}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions