server icon indicating copy to clipboard operation
server copied to clipboard

external plugin on local goofys (s3) mount, file corruption (?)

Open username11236 opened this issue 7 years ago • 3 comments

in words: i have an s3 bucked mounted via goofys on local mnt folder, nextcloud external plugin on local mnt/myfs/cloud. worked well for years. now, when i copy jpgs and vids via webiface to external, they get corrupted. with a possibility to uncorrupt themselves at a later time (many days later) tried the scan function, different versions of goofys(s3fs)

i can reproduce the corrupt, but have no idea how to reverse it. the files are on the bucket, with their size +30% approx and can not be opened after download. (enc seems to work)

i can recover my data, my problem is that i can not use nextcloud anymore :(

Steps to reproduce

  1. mount s3 bucket with goofys to /mnt/fs, user www-data:www-data with dir 750, file 640
  2. configure external storages, local, to /mnt/fs/cdata, enc, preview, checkchanges
  3. move files from data dir to external
  4. after some time size for pictures shows 0kb, preview fails with filenotfound, download succeeds without any error(!), downloaded file has 0kb; videos show real size (encrypted size) and can be downloaded but not opened (likely still encrypted)
  5. files are on the filesystem and can be downloaded externally (encrypted though)
  6. after some time (multiple days?) it MAY be that files become accessible again, previews are generated and videos are streamable and downloadable without error
  7. if files are moved from data to external, they will be encrypted, and synced to s3, back to step 4

this setup has worked well for years without gamebreaking errors. (the native s3 thing did not ever work in my case)

this setup seem to fk up the signatures inside external so i had to disable the check (return True in the crypt.php like suggested elsewhere) my files got accessible again, thats when i noticed files with 0kb problems seem to have started with an nc update, dont know which one though since turning off signature checks does not pose security risks with encryption on, i dont mind. (having to change the source does bug me a bit though)

the server has a 15Mbyte connection, so syncing is not the issue. i tried variations of occ scan with no success different versions of goofys, same problem

Expected behaviour

show the real size, generate prieviews, successful download

Actual behaviour

pictures stay at 0kb, being unaccessible, videos can be downloaded but not opened (likely still enc)

Server configuration

Operating system: Debian GNU/Linux 9

Web server: Apache/2.4.25 (Debian)

Database: mysql Ver 15.1 Distrib 10.1.38-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2

PHP version: php7.0 7.0.33-0+deb9u3

Nextcloud version: Nextcloud 15.0.11

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

Where did you install Nextcloud from: download from website, nextcloud.zip

Signing status:

Signing status

No errors have been found.

List of activated apps:

App list

Enabled:

  • accessibility: 1.1.0
  • activity: 2.8.2
  • bruteforcesettings: 1.4.0
  • calendar: 1.6.5
  • cloud_federation_api: 0.1.0
  • comments: 1.5.0
  • contacts: 3.1.3
  • dav: 1.8.2
  • encryption: 2.3.0
  • federatedfilesharing: 1.5.0
  • federation: 1.5.0
  • files: 1.10.0
  • files_external: 1.6.0
  • files_pdfviewer: 1.4.0
  • files_sharing: 1.7.0
  • files_texteditor: 2.7.0
  • files_trashbin: 1.5.0
  • files_versions: 1.8.0
  • files_videoplayer: 1.4.0
  • gallery: 18.2.0
  • logreader: 2.0.0
  • lookup_server_connector: 1.3.0
  • nextcloud_announcements: 1.4.0
  • notifications: 2.3.0
  • oauth2: 1.3.0
  • password_policy: 1.5.0
  • provisioning_api: 1.5.0
  • ransomware_detection: 0.5.2
  • serverinfo: 1.5.0
  • sharebymail: 1.5.0
  • support: 1.0.0
  • survey_client: 1.3.0
  • systemtags: 1.5.0
  • theming: 1.6.0
  • twofactor_backupcodes: 1.4.1
  • updatenotification: 1.5.0
  • user_usage_report: 1.1.2
  • workflowengine: 1.5.0 Disabled:
  • admin_audit
  • files_downloadactivity
  • firstrunwizard
  • previewgenerator
  • ransomware_protection
  • spreed
  • user_ldap

Nextcloud configuration:

Config report
{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "domain.at",
            "cloud.domain.at"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "overwrite.cli.url": "https:\/\/151.236.10.30",
        "dbtype": "mysql",
        "version": "15.0.11.1",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "logtimezone": "UTC",
        "installed": true,
        "appstore.experimental.enabled": false,
        "loglevel": 2,
        "maintenance": false,
        "part_file_in_storage": false,
        "asset-pipeline.enabled": true,
        "theme": "",
        "data-fingerprint": "e7352febc9ef728257a7e8b8ecf42374",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "cache_path": "\/tmp\/nccache",
        "logfile": "\/var\/log\/nextcloud.log",
        "filesystem_check_changes": 1,
        "filelocking.enabled": true
    }
}

Are you using external storage, if yes which one: Local, pointing on a mounted goofys s3 filesystem on /mnt/cfs ; filemode 0640, dirmode 0750 www-data:www-data

Are you using encryption: yes (seems to be part of the problem)

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

Client configuration

Browser: Firefox 68.0.2 (64-bit)

Operating system: Ubuntu 64 bit

Logs

Web server error log

Web server error log

none related

Nextcloud log (data/nextcloud.log)

Nextcloud log

{"reqId":"cC1CJt4iJHECwpgMLgSk","level":3,"time":"2019-08-28T14:15:01+00:00","remoteAddr":"91.219.68.4","user":"ncuser","app":"gallery","method":"GET","url":"/index.php/apps/gallery/preview/720638?width=2000&height=2000&c=a9ad5a7fbbb833f8469ffa524610b73c&requesttoken=kdUR3DzXdBL7RCCnk%2FJ84bTUrCt0gXcQaxzyWfMJrrY%3D%3AxZxI62X4HWWOE1PW57Etj%2FK35EM78w5UL1KHDMU55vs%3D","message":{"Exception":"OCP\Files\NotFoundException","Message":"","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/Preview/Generator.php","line":118,"function":"getMaxPreview","class":"OC\Preview\Generator","type":"->","args":[{"class":"OC\Files\SimpleFS\SimpleFolder"},{"class":"OC\Files\Node\File"},"image/jpeg"]},{"file":"/var/www/nextcloud/lib/private/PreviewManager.php","line":205,"function":"getPreview","class":"OC\Preview\Generator","type":"->","args":[{"class":"OC\Files\Node\File"},2000,2000,false,"fill","image/jpeg"]},{"file":"/var/www/nextcloud/apps/gallery/lib/Service/PreviewService.php","line":106,"function":"getPreview","class":"OC\PreviewManager","type":"->","args":[{"class":"OC\Files\Node\File"},2000,2000,false]},{"file":"/var/www/nextcloud/apps/gallery/lib/Controller/Preview.php","line":167,"function":"createPreview","class":"OCA\Gallery\Service\PreviewService","type":"->","args":[{"class":"OC\Files\Node\File"},2000,2000,true,false]},{"file":"/var/www/nextcloud/apps/gallery/lib/Controller/Preview.php","line":117,"function":"getPreviewData","class":"OCA\Gallery\Controller\PreviewController","type":"->","args":[{"class":"OC\Files\Node\File"},true,2000,2000,true,false]},{"file":"/var/www/nextcloud/apps/gallery/lib/Controller/PreviewController.php","line":134,"function":"getData","class":"OCA\Gallery\Controller\PreviewController","type":"->","args":[720638,2000,2000]},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":166,"function":"getPreview","class":"OCA\Gallery\Controller\PreviewController","type":"->","args":[720638,2000,2000]},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":99,"function":"executeController","class":"OC\AppFramework\Http\Dispatcher","type":"->","args":[{"class":"OCA\Gallery\Controller\PreviewController"},"getPreview"]},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":118,"function":"dispatch","class":"OC\AppFramework\Http\Dispatcher","type":"->","args":[{"class":"OCA\Gallery\Controller\PreviewController"},"getPreview"]},{"file":"/var/www/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php","line":47,"function":"main","class":"OC\AppFramework\App","type":"::","args":["PreviewController","getPreview",{"class":"OC\AppFramework\DependencyInjection\DIContainer"},{"fileId":"720638","_route":"gallery.preview.get_preview"}]},{"function":"__invoke","class":"OC\AppFramework\Routing\RouteActionHandler","type":"->","args":[{"fileId":"720638","_route":"gallery.preview.get_preview"}]},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":297,"function":"call_user_func","args":[{"class":"OC\AppFramework\Routing\RouteActionHandler"},{"fileId":"720638","_route":"gallery.preview.get_preview"}]},{"file":"/var/www/nextcloud/lib/base.php","line":987,"function":"match","class":"OC\Route\Router","type":"->","args":["/apps/gallery/preview/720638"]},{"file":"/var/www/nextcloud/index.php","line":42,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/nextcloud/lib/private/Preview/Generator.php","Line":220,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0","version":"15.0.11.1"} {"reqId":"cC1CJt4iJHECwpgMLgSk","level":3,"time":"2019-08-28T14:15:01+00:00","remoteAddr":"91.219.68.4","user":"ncuser","app":"gallery","method":"GET","url":"/index.php/apps/gallery/preview/720638?width=2000&height=2000&c=a9ad5a7fbbb833f8469ffa524610b73c&requesttoken=kdUR3DzXdBL7RCCnk%2FJ84bTUrCt0gXcQaxzyWfMJrrY%3D%3AxZxI62X4HWWOE1PW57Etj%2FK35EM78w5UL1KHDMU55vs%3D","message":"Exception: Preview generation has failed","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0","version":"15.0.11.1"} {"reqId":"Vltq1ocShE4SlWTZORVm","level":3,"time":"2019-08-28T14:15:06+00:00","remoteAddr":"91.219.68.4","user":"ncuser","app":"gallery","method":"GET","url":"/index.php/apps/gallery/preview/720627?width=2000&height=2000&c=459df93745f47a7a40eeb58398254722&requesttoken=kdUR3DzXdBL7RCCnk%2FJ84bTUrCt0gXcQaxzyWfMJrrY%3D%3AxZxI62X4HWWOE1PW57Etj%2FK35EM78w5UL1KHDMU55vs%3D","message":{"Exception":"OCP\Files\NotFoundException","Message":"","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/Preview/Generator.php","line":118,"function":"getMaxPreview","class":"OC\Preview\Generator","type":"->","args":[{"class":"OC\Files\SimpleFS\SimpleFolder"},{"class":"OC\Files\Node\File"},"image/jpeg"]},{"file":"/var/www/nextcloud/lib/private/PreviewManager.php","line":205,"function":"getPreview","class":"OC\Preview\Generator","type":"->","args":[{"class":"OC\Files\Node\File"},2000,2000,false,"fill","image/jpeg"]},{"file":"/var/www/nextcloud/apps/gallery/lib/Service/PreviewService.php","line":106,"function":"getPreview","class":"OC\PreviewManager","type":"->","args":[{"class":"OC\Files\Node\File"},2000,2000,false]},{"file":"/var/www/nextcloud/apps/gallery/lib/Controller/Preview.php","line":167,"function":"createPreview","class":"OCA\Gallery\Service\PreviewService","type":"->","args":[{"class":"OC\Files\Node\File"},2000,2000,true,false]},{"file":"/var/www/nextcloud/apps/gallery/lib/Controller/Preview.php","line":117,"function":"getPreviewData","class":"OCA\Gallery\Controller\PreviewController","type":"->","args":[{"class":"OC\Files\Node\File"},true,2000,2000,true,false]},{"file":"/var/www/nextcloud/apps/gallery/lib/Controller/PreviewController.php","line":134,"function":"getData","class":"OCA\Gallery\Controller\PreviewController","type":"->","args":[720627,2000,2000]},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":166,"function":"getPreview","class":"OCA\Gallery\Controller\PreviewController","type":"->","args":[720627,2000,2000]},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":99,"function":"executeController","class":"OC\AppFramework\Http\Dispatcher","type":"->","args":[{"class":"OCA\Gallery\Controller\PreviewController"},"getPreview"]},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":118,"function":"dispatch","class":"OC\AppFramework\Http\Dispatcher","type":"->","args":[{"class":"OCA\Gallery\Controller\PreviewController"},"getPreview"]},{"file":"/var/www/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php","line":47,"function":"main","class":"OC\AppFramework\App","type":"::","args":["PreviewController","getPreview",{"class":"OC\AppFramework\DependencyInjection\DIContainer"},{"fileId":"720627","_route":"gallery.preview.get_preview"}]},{"function":"__invoke","class":"OC\AppFramework\Routing\RouteActionHandler","type":"->","args":[{"fileId":"720627","_route":"gallery.preview.get_preview"}]},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":297,"function":"call_user_func","args":[{"class":"OC\AppFramework\Routing\RouteActionHandler"},{"fileId":"720627","_route":"gallery.preview.get_preview"}]},{"file":"/var/www/nextcloud/lib/base.php","line":987,"function":"match","class":"OC\Route\Router","type":"->","args":["/apps/gallery/preview/720627"]},{"file":"/var/www/nextcloud/index.php","line":42,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/nextcloud/lib/private/Preview/Generator.php","Line":220,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0","version":"15.0.11.1"} {"reqId":"Vltq1ocShE4SlWTZORVm","level":3,"time":"2019-08-28T14:15:06+00:00","remoteAddr":"91.219.68.4","user":"ncuser","app":"gallery","method":"GET","url":"/index.php/apps/gallery/preview/720627?width=2000&height=2000&c=459df93745f47a7a40eeb58398254722&requesttoken=kdUR3DzXdBL7RCCnk%2FJ84bTUrCt0gXcQaxzyWfMJrrY%3D%3AxZxI62X4HWWOE1PW57Etj%2FK35EM78w5UL1KHDMU55vs%3D","message":"Exception: Preview generation has failed","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0","version":"15.0.11.1"}

please let me know if i missed something thanks

username11236 avatar Aug 28 '19 14:08 username11236

Mind to try this patch: https://github.com/nextcloud/server/pull/15946?

kesselb avatar Aug 28 '19 14:08 kesselb

Thanks for the quick response!

Unfortunately this did not solve my problem

username11236 avatar Aug 30 '19 12:08 username11236

I found a workaround for my problem, and seemingly a second bug too

I added a second external local storage, same settings like the other one, but write protected. It showed the same symptoms like the original one. upon entering the settings again to remove it i found two identical entrys for that storage. I deleted one of them. This seemingly triggered a 'pending' for the filesizes in my original local s3 mount (in the remaining write protected test mount too). my files got accessible again.

Fun side effect, i could not reproduce the corruption (actually no corruption).

if it should happen again: I will add a local storage, exit the menue, enter it again, remove the two(!) entrys I just created, and wait for the 'pending' to go away. not perfect, but good enough for me ;)

signature check needs to stay deactivated, do not know how to work around that; open for suggestions though

the bugs on my installation might have their origin within the setup i use, not effecting anyone else, maybe ever.

Since my setup works again I will close this, if anybody wants additional information, feel free to contact me.

Thanks for the help!

username11236 avatar Sep 03 '19 08:09 username11236