Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: 0x800701AA and 0x80070185 resulting in error 404 and not being able to download file thru client #50601

Open
5 of 8 tasks
bigretromike opened this issue Jan 31, 2025 · 7 comments
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 30-feedback bug

Comments

@bigretromike
Copy link

bigretromike commented Jan 31, 2025

⚠️ This issue respects the following points: ⚠️

Bug description

Some random files are not available to query thru "index.php/core/preview?fileId=00161436ocad9kxu2atw&x=96&y=96&a=true" with results of [] which results in those files not being able to download using client.
Apache2 log say it results in 404
192.168.51.1 - "" [31/Jan/2025:18:43:44 +0100] "GET /index.php/core/preview?fileId=00161436ocad9kxu2atw&x=96&y=96&a=true HTTP/1.1" 404 814 "-" "Mozilla/5.0 (Windows) mirall/3.15.3 (build 20250107) (Nextcloud, windows-10.0.22621 ClientArchitecture: x86_64 OsArchitecture: x86_64)"

Files is data folder, file is in database
SELECT * FROM oc_filecache WHERE fileid = '00161436ocad9kxu2atw';

return:
| 161436 | 22 | files/Prezenty dla pilotów/2025/AM010124 TAD.pdf | 6a6a0cfc59b4283f35665c032adb9071 | 161433 | AM010124 TAD.pdf | 8 | 7 | 2769270 | 1735830474 | 1735830474 | 0 | 0 | e6f59e957e31b79afb5c91b61debc343 | 27 |

I store data on mounted path via NFS
cd /mnt/nas/
find . -name "AM010124 TAD.pdf"

file is located: /mnt/nas/a.m/files/Prezenty dla pilotów/2025/AM010124 TAD.pdf

Requesting it this way:
curl -u "administrator:password" -X PROPFIND "https://cloud.FQDN.com/remote.php/dav/files/administrator/Prezenty%20dla%20pilot%C3%B3w/2025/AM010124%20TAD.pdf"

give me this results:

<?xml version="1.0"?>
<d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:oc="http://owncloud.org/ns" xmlns:nc="http://nextcloud.org/ns"><d:response><d:href>/remote.php/dav/files/administrator/Prezenty%20dla%20pilot%c3%b3w/2025/AM010124%20TAD.pdf</d:href><d:propstat><d:prop><d:getlastmodified>Thu, 02 Jan 2025 15:07:54 GMT</d:getlastmodified><d:getcontentlength>2769270</d:getcontentlength><d:resourcetype/><d:getetag>&quot;e6f59e957e31b79afb5c91b61debc343&quot;</d:getetag><d:getcontenttype>application/pdf</d:getcontenttype></d:prop><d:status>HTTP/1.1 200 OK</d:status></d:propstat></d:response></d:multistatus>

I tried file scan:
sudo sudo -c "php /var/www/nextcloud/occ files:scan a.m" www-data -s /bin/bash

returns:

Cannot load Zend OPcache - it was already loaded
Starting scan for user 1 out of 1 (a.m)
+---------+-------+-----+---------+---------+--------+--------------+
| Folders | Files | New | Updated | Removed | Errors | Elapsed time |
+---------+-------+-----+---------+---------+--------+--------------+
| 66      | 426   | 0   | 201     | 0       | 0      | 00:00:03     |
+---------+-------+-----+---------+---------+--------+--------------+

but that didn't help

this issue was present on 29.x and is also present on 30.x

Steps to reproduce

  1. this is random but you have to have VFS enabled (because other way you would have those files locally)
  2. unable to replicate at-hoc
  3. if the error occurs I can only download file thru webui or by "store locally" on client.

Expected behavior

being able to download files that is on nextcloud

Nextcloud Server version

30

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.2

Web server

Apache (supported)

Database engine version

MariaDB

Is this bug present after an update or on a fresh install?

Upgraded to a MAJOR version (ex. 31 to 32)

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

What user-backends are you using?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "192.168.51.200",
            "cloud.FQDN.com"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "30.0.5.1",
        "overwrite.cli.url": "https:\/\/cloud.FQDN.com",
        "htaccess.RewriteBase": "\/",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "memcache.local": "\\OC\\Memcache\\APCu",
        "maintenance_window_start": 1,
        "filelocking.enabled": true,
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 6379,
            "timeout": 0,
            "password": "***REMOVED SENSITIVE VALUE***"
        },
        "default_language": "pl",
        "default_phone_region": "PL",
        "default_timezone": "Europe\/Warsaw",
        "allow_user_to_change_display_name": true,
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpmode": "smtp",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauth": 1,
        "mail_smtpport": "587",
        "mail_sendmailmode": "smtp",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "skeletondirectory": "\/var\/www\/nextcloud\/core\/skeleton_empty",
        "app_install_overwrite": [
            "files_downloadactivity",
            "files_trackdownloads",
            "ransomware_protection"
        ],
        "maintenance": false,
        "theme": "",
        "loglevel": 2,
        "forbidden_filename_basenames": [
            "con",
            "prn",
            "aux",
            "nul",
            "com0",
            "com1",
            "com2",
            "com3",
            "com4",
            "com5",
            "com6",
            "com7",
            "com8",
            "com9",
            "com\u00b9",
            "com\u00b2",
            "com\u00b3",
            "lpt0",
            "lpt1",
            "lpt2",
            "lpt3",
            "lpt4",
            "lpt5",
            "lpt6",
            "lpt7",
            "lpt8",
            "lpt9",
            "lpt\u00b9",
            "lpt\u00b2",
            "lpt\u00b3"
        ],
        "forbidden_filename_characters": [
            "<",
            ">",
            ":",
            "\"",
            "|",
            "?",
            "*",
            "\\",
            "\/"
        ],
        "forbidden_filename_extensions": [
            " ",
            ".",
            ".filepart",
            ".part"
        ]
    }
}

List of activated Apps

Enabled:
  - activity: 3.0.0
  - admin_audit: 1.20.0
  - calendar: 5.0.9
  - circles: 30.0.0
  - cloud_federation_api: 1.13.0
  - comments: 1.20.1
  - contactsinteraction: 1.11.0
  - dashboard: 7.10.0
  - dav: 1.31.1
  - federatedfilesharing: 1.20.0
  - federation: 1.20.0
  - files: 2.2.0
  - files_accesscontrol: 1.20.1
  - files_downloadlimit: 3.0.0
  - files_pdfviewer: 3.0.0
  - files_reminders: 1.3.0
  - files_sharing: 1.22.0
  - files_trashbin: 1.20.1
  - files_versions: 1.23.0
  - impersonate: 1.17.1
  - logreader: 3.0.0
  - lookup_server_connector: 1.18.0
  - notifications: 3.0.0
  - oauth2: 1.18.1
  - password_policy: 2.0.0
  - photos: 3.0.2
  - privacy: 2.0.0
  - provisioning_api: 1.20.0
  - recommendations: 3.0.0
  - related_resources: 1.5.0
  - serverinfo: 2.0.0
  - settings: 1.13.0
  - sharebymail: 1.20.0
  - text: 4.1.0
  - theming: 2.5.0
  - twofactor_backupcodes: 1.19.0
  - updatenotification: 1.20.0
  - user_status: 1.10.0
  - viewer: 3.0.0
  - weather_status: 1.10.0
  - webhook_listeners: 1.1.0-dev
  - workflowengine: 2.12.0
Disabled:
  - app_api: 4.0.5 (installed 4.0.5)
  - bruteforcesettings: 3.0.0 (installed 3.0.0)
  - encryption: 2.18.0
  - files_external: 1.22.0
  - firstrunwizard: 3.0.0 (installed 3.0.0)
  - groupfolders: 18.0.9 (installed 18.0.9)
  - nextcloud_announcements: 2.0.0 (installed 2.0.0)
  - notes: 4.11.0 (installed 4.11.0)
  - support: 2.0.0 (installed 1.12.0)
  - survey_client: 2.0.0 (installed 2.0.0)
  - suspicious_login: 8.0.0
  - systemtags: 1.20.0 (installed 1.20.0)
  - twofactor_nextcloud_notification: 4.0.0
  - twofactor_totp: 12.0.0-dev
  - user_ldap: 1.21.0

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

{"reqId":"nj46QBqvbY9g9g1oQmxH","level":0,"time":"2025-01-31T18:54:56+00:00","remoteAddr":"192.168.51.1","user":"--","app":"no app in context","method":"GET","url":"/index.php/core/preview?fileId=00161436ocad9kxu2atw&x=96&y=96&a=true","message":"The loading of lazy AppConfig values have been requested","userAgent":"Mozilla/5.0","version":"30.0.5.1","exception":{"Exception":"RuntimeException","Message":"ignorable exception","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/AppConfig.php","line":1180,"function":"loadConfig","class":"OC\\AppConfig","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppConfig.php","line":100,"function":"loadConfigAll","class":"OC\\AppConfig","type":"->"},{"file":"/var/www/nextcloud/lib/private/AllConfig.php","line":169,"function":"getKeys","class":"OC\\AppConfig","type":"->"},{"file":"/var/www/nextcloud/lib/private/Security/Bruteforce/Throttler.php","line":95,"function":"getAppKeys","class":"OC\\AllConfig","type":"->"},{"file":"/var/www/nextcloud/lib/private/Security/Bruteforce/Throttler.php","line":175,"function":"isBypassListed","class":"OC\\Security\\Bruteforce\\Throttler","type":"->"},{"file":"/var/www/nextcloud/lib/private/Security/Bruteforce/Throttler.php","line":192,"function":"getAttempts","class":"OC\\Security\\Bruteforce\\Throttler","type":"->"},{"file":"/var/www/nextcloud/lib/private/Security/Bruteforce/Throttler.php","line":265,"function":"getDelay","class":"OC\\Security\\Bruteforce\\Throttler","type":"->"},{"file":"/var/www/nextcloud/lib/private/User/Session.php","line":383,"function":"sleepDelayOrThrowOnMax","class":"OC\\Security\\Bruteforce\\Throttler","type":"->"},{"file":"/var/www/nextcloud/lib/private/User/Session.php","line":543,"function":"logClientIn","class":"OC\\User\\Session","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/base.php","line":1088,"function":"tryBasicAuthLogin","class":"OC\\User\\Session","type":"->"},{"file":"/var/www/nextcloud/lib/base.php","line":992,"function":"handleLogin","class":"OC","type":"::"},{"file":"/var/www/nextcloud/index.php","line":24,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/lib/private/AppConfig.php","Line":1194,"message":"The loading of lazy AppConfig values have been requested","exception":{},"CustomMessage":"The loading of lazy AppConfig values have been requested"}}

{"reqId":"cKxEVboPydxpVkNNP4UE","level":3,"time":"2025-01-31T18:44:59+00:00","remoteAddr":"192.168.51.1","user":"administrator","app":"index","method":"GET","url":"/settings/api/apps/media?fileName=https%3A%2F%2Fnextcloud.com%2Fc%2Fuploads%2F2024%2F09%2FNextcloud-Hub-9-1024x576.jpg","message":"Exception thrown: OCP\\Files\\NotFoundException","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:128.0) Gecko/20100101 Firefox/128.0","version":"30.0.5.1","exception":{"Exception":"OCP\\Files\\NotFoundException","Message":"","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/Files/Node/Folder.php","line":81,"function":"getFileInfo","class":"OC\\Files\\Node\\Node","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/SimpleFS/SimpleFolder.php","line":33,"function":"getDirectoryListing","class":"OC\\Files\\Node\\Folder","type":"->"},{"file":"/var/www/nextcloud/apps/settings/lib/Controller/AppSettingsController.php","line":149,"function":"getDirectoryListing","class":"OC\\Files\\SimpleFS\\SimpleFolder","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":208,"function":"getAppDiscoverMedia","class":"OCA\\Settings\\Controller\\AppSettingsController","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":114,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":161,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":302,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud/lib/base.php","line":1003,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/index.php","line":24,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/lib/private/Files/Node/Node.php","Line":90,"message":"","exception":{},"CustomMessage":"Exception thrown: OCP\\Files\\NotFoundException"}}
{"reqId":"JJQ5AMLoAPk2mDXBdCAn","level":3,"time":"2025-01-31T18:44:59+00:00","remoteAddr":"192.168.51.1","user":"administrator","app":"index","method":"GET","url":"/settings/api/apps/media?fileName=https%3A%2F%2Fgithub.com%2Fnextcloud%2Ffirstrunwizard%2Fraw%2Fmaster%2Fimg%2FNextcloud.webm","message":"Exception thrown: OCP\\Files\\NotFoundException","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:128.0) Gecko/20100101 Firefox/128.0","version":"30.0.5.1","exception":{"Exception":"OCP\\Files\\NotFoundException","Message":"","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/Files/Node/Folder.php","line":81,"function":"getFileInfo","class":"OC\\Files\\Node\\Node","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/SimpleFS/SimpleFolder.php","line":33,"function":"getDirectoryListing","class":"OC\\Files\\Node\\Folder","type":"->"},{"file":"/var/www/nextcloud/apps/settings/lib/Controller/AppSettingsController.php","line":149,"function":"getDirectoryListing","class":"OC\\Files\\SimpleFS\\SimpleFolder","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":208,"function":"getAppDiscoverMedia","class":"OCA\\Settings\\Controller\\AppSettingsController","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":114,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":161,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":302,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud/lib/base.php","line":1003,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/index.php","line":24,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/lib/private/Files/Node/Node.php","Line":90,"message":"","exception":{},"CustomMessage":"Exception thrown: OCP\\Files\\NotFoundException"}}
{"reqId":"yNL1N7K5J25ZvmCX88rT","level":0,"time":"2025-01-31T18:50:44+00:00","remoteAddr":"192.168.51.1","user":"administrator","app":"workflowengine","method":"PROPFIND","url":"/remote.php/dav/files/administrator/","message":"Flow activation: rules were requested for operation Zablokuj dost\u0119p do pliku","userAgent":"Mozilla/5.0 (Windows) mirall/3.15.3 (build 20250107) (Nextcloud, windows-10.0.22621 ClientArchitecture: x86_64 OsArchitecture: x86_64)","version":"30.0.5.1","data":{"app":"workflowengine","level":"0"}}
{"reqId":"QhDQ584AEnchArVFGN9t","level":0,"time":"2025-01-31T18:51:07+00:00","remoteAddr":"192.168.51.1","user":"administrator","app":"workflowengine","method":"PROPFIND","url":"/remote.php/dav/files/administrator/Zlecenia%20dla%20pilot%C3%B3w/2025","message":"Flow activation: rules were requested for operation Zablokuj dost\u0119p do pliku","userAgent":"Mozilla/5.0 (Windows) mirall/3.15.3 (build 20250107) (Nextcloud, windows-10.0.22621 ClientArchitecture: x86_64 OsArchitecture: x86_64)","version":"30.0.5.1","data":{"app":"workflowengine","level":"0"}}

Additional info

nextcloud/desktop#7747

sudo -u www-data php occ security:bruteforce:attempts 192.168.51.1
Cannot load Zend OPcache - it was already loaded
  - bypass-listed: false
  - attempts: 2
  - delay: 400

sudo -u www-data php occ security:bruteforce:reset 192.168.51.1

does not help

Adding my ip to bruteforce-setting list does not help:
Your remote address was identified as "192.168.51.1" and is bypassing brute-force protection.

@bigretromike bigretromike added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Jan 31, 2025
@kesselb
Copy link
Contributor

kesselb commented Feb 1, 2025

index.php/core/preview?fileId=00161436ocad9kxu2atw&x=96&y=96&a=true

This looks like a rather strange request.

Is ocad9kxu2atw your instance id?

@bigretromike
Copy link
Author

bigretromike commented Feb 1, 2025

index.php/core/preview?fileId=00161436ocad9kxu2atw&x=96&y=96&a=true

This looks like a rather strange request.

Is ocad9kxu2atw your instance id?

Hello, I request that file because this is the request VFS is sending to nextcloud.

Edit: I just reset my PC, nextcloud log me out from the account that was having issue with that one file, sadly now it works.
But now when I query: curl -u "administrator:password" -X PROPFIND "https://cloud.FQDN.com/index.php/core/preview?fileId=00161436ocad9kxu2atw&x=96&y=96&a=true" it returns nothing (Content-Length: 0) instead of [] and that file works without issue.

@kesselb
Copy link
Contributor

kesselb commented Feb 4, 2025

00161436ocad9kxu2atw is not a valid file ID. If a client sends such a request, that’s something that needs to be addressed. I’ll close this report here in favor of the one in the desktop repository. Thanks again for bringing this to our attention! 👍

@kesselb kesselb closed this as completed Feb 4, 2025
@bigretromike
Copy link
Author

@kesselb then tell my if thats a invalid file ID why file don't work server return different response than when the file works, while asking server for the same INVALID FILE ID ?

When file was not working:
curl -u "administrator:password" -X PROPFIND "https://cloud.FQDN.com/index.php/core/preview?fileId=00161436ocad9kxu2atw&x=96&y=96&a=true" returned []

when file started to work the same curl:
curl -u "administrator:password" -X PROPFIND "https://cloud.FQDN.com/index.php/core/preview?fileId=00161436ocad9kxu2atw&x=96&y=96&a=true" return content-size:0 without those []

@kesselb
Copy link
Contributor

kesselb commented Feb 4, 2025

Hi,

Thanks for your follow-up.

It seems I misunderstood your initial report. Are you saying that for the same file, the first request for a preview fails, but a second request for the preview succeeds?

You also mentioned that it’s not possible to open the file using VFS when the preview is available. That still seems like an issue for the desktop team, as a missing preview should not block downloading a local copy of the file.

Regarding the fileId, we have a type hint in place to ensure it is an integer, so the preview generation should still work even if other characters are included—they're simply dropped. However, it does seem odd that something resembling an instanceid is part of the fileId.

I'll reopen the issue, but with the current information, it feels a bit like finding a needle in a haystack. Please keep us updated if you uncover anything new!

@kesselb kesselb reopened this Feb 4, 2025
@joshtrichards
Copy link
Member

Haven't looked closely, but this reminds me of what I recently dealt with for nextcloud/android#14081

@bigretromike
Copy link
Author

bigretromike commented Feb 6, 2025

Haven't looked closely, but this reminds me of what I recently dealt with for nextcloud/android#14081

The issue is that the fileId exists but for unknown reason server returns [ ] thus breaking the sync between desktop client. After for example login out of client and log in same http request that returned [ ] before, now returns nothing (with content-size: 0) in case of PDF files and thus syncing file correctly.

It's not about wrong fileID sadly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 30-feedback bug
Projects
None yet
Development

No branches or pull requests

4 participants