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]: DAV Propfind: Undefined variable $response #42575

Open
5 of 8 tasks
simonspa opened this issue Jan 4, 2024 · 4 comments
Open
5 of 8 tasks

[Bug]: DAV Propfind: Undefined variable $response #42575

simonspa opened this issue Jan 4, 2024 · 4 comments
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 27-feedback bug feature: dav

Comments

@simonspa
Copy link
Contributor

simonspa commented Jan 4, 2024

⚠️ This issue respects the following points: ⚠️

Bug description

On NC 27.1.5, some code seems to be able to trigger an issue with DAV propfind:

{"reqId":"v1UAVvIC6fcqsJ6MXg1X","level":3,"time":"2024-01-04T08:35:53+01:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"Undefined variable $response at /var/www/nextcloud/lib/private/Files/Storage/DAV.php#305","userAgent":"--","version":"27.1.5.1","data":{"app":"PHP"},"id":"65966804c36da"}

Guessing from the periodicity in the logs this could be triggered by a background job and a federated share. The only federated shares I have run a NC 27.1.2 server on the other end.

I tried to understand the code on question (https://github.com/nextcloud/server/blob/master/lib/private/Files/Storage/DAV.php#L299) but I don't fully grasp it - there seem to be too many possibilities of reaching return $response without ever setting $response - this might be my PHP ignorance though.

This seems to be similar to #16808 but a different error condition.

Steps to reproduce

  1. Check logs
  2. See error

Expected behavior

No error in logs, or at least clear backttrace/logging of issue

Installation method

Community Manual installation with Archive

Nextcloud Server version

27

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.1

Web server

Nginx

Database engine version

MySQL

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

Updated from a MINOR version (ex. 22.1 to 22.2)

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

No response

List of activated Apps

No response

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

{"reqId":"v1UAVvIC6fcqsJ6MXg1X","level":3,"time":"2024-01-04T08:35:53+01:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"Undefined variable $response at /var/www/nextcloud/lib/private/Files/Storage/DAV.php#305","userAgent":"--","version":"27.1.5.1","data":{"app":"PHP"},"id":"65966c709f6d5"}

Additional info

No response

@simonspa simonspa added bug 0. Needs triage Pending check for reproducibility or if it fits our roadmap labels Jan 4, 2024
@solracsf
Copy link
Member

solracsf commented Jan 4, 2024

Duplicate of #11140 ?

@simonspa
Copy link
Contributor Author

simonspa commented Jan 4, 2024

Good question - I think it is related but not a duplicate. The linked issue refers to public function hasUpdated in line 855 while this error emanates from protected function propfind.

Might still be related since the hasUpdated method calls propfind here.

@alexeyvolkoff
Copy link

alexeyvolkoff commented Jun 25, 2024

Hi everyone,
am I facing the same bug? I'm trying to mount an external WebDAV storage

Undefined variable $response at /var/www/html/lib/private/Files/Storage/DAV.php#305
{"reqId":"3rtm1jUw7HaU4BCTKjhA","level":3,"time":"2024-06-25T15:11:45+00:00","remoteAddr":"193.77.124.122","user":"admin","app":"PHP","method":"PUT","url":"/apps/files_external/userstorages/2","message":"Undefined variable $response at /var/www/html/lib/private/Files/Storage/DAV.php#305","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36","version":"29.0.2.2","data":{"app":"PHP"},"id":"667ae027a81ca"}

@alexeyvolkoff
Copy link

alexeyvolkoff commented Jun 25, 2024

here is the response I send to propfind request:

propfind response "<?xml version=\"1.0\" encoding=UTF-8?>\n<D:multistatus xmlns:D=\"DAV:\">\n<D:response>\n<D:href>/</D:href>\n<D:propstat>\n<D:prop>\n<D:getlastmodified>Tue, 25 Jun 2024 16:34:22 GMT</D:getlastmodified>\n<D:getcontenttype>httpd/unix-directory</D:getcontenttype>\n<D:resourcetype>\n<D:collection/>\n</D:resourcetype>\n<D:getetag>\"f48ec06c4f93001e27543ee0abd65b42\"</D:getetag>\n<D:quota-available-bytes>5160385028845206400</D:quota-available-bytes>\n</D:prop>\n<D:status>HTTP/1.1 200 OK</D:status>\n</D:propstat>\n</D:response>\n</D:multistatus>\n"

Looks OK, but DAV client (lib/private/Files/Storage/DAV.php#305) reports undefined response

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 27-feedback bug feature: dav
Projects
None yet
Development

No branches or pull requests

5 participants