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]: 24.0.4: HEAD on nonexistent paths logs warning to Nextcloud log #33896

Closed
6 of 9 tasks
AlvaroBrey opened this issue Sep 5, 2022 · 2 comments · Fixed by #34035
Closed
6 of 9 tasks

[Bug]: 24.0.4: HEAD on nonexistent paths logs warning to Nextcloud log #33896

AlvaroBrey opened this issue Sep 5, 2022 · 2 comments · Fixed by #34035
Labels
1. to develop Accepted and waiting to be taken care of bug

Comments

@AlvaroBrey
Copy link
Member

AlvaroBrey commented Sep 5, 2022

⚠️ This issue respects the following points: ⚠️

  • This is a bug, not a question or a configuration/webserver/proxy issue.
  • This issue is not already reported on Github (I've searched it).
  • Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
  • Nextcloud Server is running on 64bit capable CPU, PHP and OS.
  • I agree to follow Nextcloud's Code of Conduct.

Bug description

The Nextcloud Android app uses the DAV api to check for existence of a file at several points. For this it does a HEAD request on the file path (/remote.php/dav/files/<user>/<file path>) and reads the HTTP response code.

Prior to Nextcloud 24.0.4, this worked as expected. However, in 24.0.4 a warning is logged to nextcloud.log every time a file is checked in this way and does not exist. This is a problem for server admins as it can create tremendous amounts of logspam: for example this will happen every time a user uploads a file as we check if it exists first. See nextcloud/android#10663 for details and more server logs.

Steps to reproduce

  1. Install Nextcloud 24.0.4
  2. Setup admin account
  3. curl --head -u admin:<pass> <server IP>/remote.php/dav/files/admin/<random non-existing filename>

Expected behavior

No logs.

Installation method

Community Docker image

Operating system

Debian/Ubuntu

PHP engine version

No response

Web server

No response

Database engine version

SQlite

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

Fresh Nextcloud Server install

Are you using the Nextcloud Server Encryption module?

No response

What user-backends are you using?

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

Configuration report

No response

List of activated Apps

Enabled:
  - accessibility: 1.10.0
  - activity: 2.16.0
  - bruteforcesettings: 2.4.0
  - circles: 24.0.0
  - cloud_federation_api: 1.7.0
  - comments: 1.14.0
  - contactsinteraction: 1.5.0
  - dashboard: 7.4.0
  - dav: 1.22.0
  - federatedfilesharing: 1.14.0
  - federation: 1.14.0
  - files: 1.19.0
  - files_pdfviewer: 2.5.0
  - files_rightclick: 1.3.0
  - files_sharing: 1.16.2
  - files_trashbin: 1.14.0
  - files_versions: 1.17.0
  - files_videoplayer: 1.13.0
  - firstrunwizard: 2.13.0
  - logreader: 2.9.0
  - lookup_server_connector: 1.12.0
  - nextcloud_announcements: 1.13.0
  - notifications: 2.12.0
  - oauth2: 1.12.0
  - password_policy: 1.14.0
  - photos: 1.6.0
  - privacy: 1.8.0
  - provisioning_api: 1.14.0
  - recommendations: 1.3.0
  - serverinfo: 1.14.0
  - settings: 1.6.0
  - sharebymail: 1.14.0
  - support: 1.7.0
  - survey_client: 1.12.0
  - systemtags: 1.14.0
  - text: 3.5.1
  - theming: 1.15.0
  - twofactor_backupcodes: 1.13.0
  - updatenotification: 1.14.0
  - user_status: 1.4.0
  - viewer: 1.8.0
  - weather_status: 1.4.0
  - workflowengine: 2.6.0
Disabled:
  - admin_audit
  - encryption
  - files_external
  - user_ldap

Nextcloud Signing status

No response

Nextcloud Logs

{"reqId":"DmcdTsWS0sZzedqSNC19","level":2,"time":"2022-09-05T09:56:40+00:00","remoteAddr":"172.17.0.1","user":"admin","app":"no app in context","method":"HEAD","url":"/remote.php/dav/files/admin/asdsad","message":"File with name //asdsad could not be located","userAgent":"curl/7.84.0","version":"24.0.4.1","exception":{"Exception":"Sabre\\DAV\\Exception\\NotFound","Message":"File with name //asdsad could not be located","Code":0,"Trace":[{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Tree.php","line":78,"function":"getChild","class":"OCA\\DAV\\Connector\\Sabre\\Directory","type":"->","args":["asdsad"]},{"file":"/var/www/html/apps/dav/lib/DAV/ViewOnlyPlugin.php","line":74,"function":"getNodeForPath","class":"Sabre\\DAV\\Tree","type":"->","args":["files/admin/asdsad"]},{"file":"/var/www/html/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"checkViewOnly","class":"OCA\\DAV\\DAV\\ViewOnlyPlugin","type":"->","args":[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->","args":["method:GET",[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":251,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->","args":[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"},false]},{"file":"/var/www/html/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpHead","class":"Sabre\\DAV\\CorePlugin","type":"->","args":[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->","args":["method:HEAD",[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->","args":[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\\DAV\\Server","type":"->","args":[]},{"file":"/var/www/html/apps/dav/lib/Server.php","line":358,"function":"exec","class":"Sabre\\DAV\\Server","type":"->","args":[]},{"file":"/var/www/html/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->","args":[]},{"file":"/var/www/html/remote.php","line":166,"args":["/var/www/html/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/html/apps/dav/lib/Connector/Sabre/Directory.php","Line":242,"message":"File with name //asdsad could not be located","exception":{},"CustomMessage":"File with name //asdsad could not be located"}}

Additional info

If there's a better way to check for file existence, please let us know.

cc @tobiasKaminsky

@szaimen
Copy link
Contributor

szaimen commented Sep 5, 2022

cc @nextcloud/server-backend

@szaimen szaimen added 1. to develop Accepted and waiting to be taken care of and removed 0. Needs triage Pending check for reproducibility or if it fits our roadmap labels Sep 5, 2022
@AlvaroBrey AlvaroBrey changed the title [Bug]: HEAD on nonexistent paths logs warning to Nextcloud log [Bug]: 24.0.4: HEAD on nonexistent paths logs warning to Nextcloud log Sep 5, 2022
@come-nc
Copy link
Contributor

come-nc commented Sep 5, 2022

The logging comes from #32482 that adds the ViewOnlyPlugin class, I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1. to develop Accepted and waiting to be taken care of bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants