nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
27.39k stars 4.07k forks source link

[Bug]: Upload file with a space in it fails with PHP 8.1 (no problems with PHP 7.4) using S3 #36391

Closed mrAceT closed 1 year ago

mrAceT commented 1 year ago

⚠️ This issue respects the following points: ⚠️

Bug description

I use AWS S3 for primary file storage. A file called "test.jpg" uploads fine, also "test1.jpg" is no problem, but uploading "test 1.jpg" fails with no warnings/errors what so ever!

When I check the network tab in Chrome (via F12) I see a "PUT" with remote.php/webdav/test/test%201.jpg and a "PROPFIND" with the same URL there is says (with HTML formatting) "App not installed:" (but not telling which app..)

The same happens with a file WITHOUT a space, but there the PROPFIND returns an XML result! (and all goes wel..)

Steps to reproduce

  1. create a fresh install of Nextcloud 25.0.3
  2. use PHP 8.1
  3. upload a file with a space in it!

Expected behavior

1) it should upload the file 2) it should tell me what went wrong (even loglevel set to 3 doesn't tell me anything..

Installation method

Community Web installer on a VPS or web space

Operating system

RHEL/CentOS

PHP engine version

PHP 8.1

Web server

Apache (supported)

Database engine version

MySQL

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

Fresh Nextcloud Server install

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

What user-backends are you using?

Configuration report

No response

List of activated Apps

Enabled:
  - activity: 2.17.0
  - calendar: 4.2.2
  - circles: 25.0.0
  - cloud_federation_api: 1.8.0
  - comments: 1.15.0
  - contacts: 5.0.3
  - contactsinteraction: 1.6.0
  - dashboard: 7.5.0
  - dav: 1.24.0
  - federatedfilesharing: 1.15.0
  - federation: 1.15.0
  - files: 1.20.1
  - files_pdfviewer: 2.6.0
  - files_rightclick: 1.4.0
  - files_sharing: 1.17.0
  - files_trashbin: 1.15.0
  - files_versions: 1.18.0
  - firstrunwizard: 2.14.0
  - logreader: 2.10.0
  - lookup_server_connector: 1.13.0
  - mail: 2.2.2
  - nextcloud_announcements: 1.14.0
  - notifications: 2.13.1
  - oauth2: 1.13.0
  - password_policy: 1.15.0
  - photos: 2.0.1
  - privacy: 1.9.0
  - provisioning_api: 1.15.0
  - recommendations: 1.4.0
  - related_resources: 1.0.3
  - richdocuments: 7.1.0
  - richdocumentscode: 22.5.802
  - serverinfo: 1.15.0
  - settings: 1.7.0
  - sharebymail: 1.15.0
  - spreed: 15.0.3
  - support: 1.8.0
  - survey_client: 1.13.0
  - systemtags: 1.15.0
  - text: 3.6.0
  - theming: 2.0.1
  - twofactor_backupcodes: 1.14.0
  - updatenotification: 1.15.0
  - user_status: 1.5.0
  - viewer: 1.9.0
  - weather_status: 1.5.0
  - workflowengine: 2.7.0
Disabled:
  - admin_audit
  - bruteforcesettings
  - encryption
  - files_external
  - suspicious_login
  - twofactor_totp
  - user_ldap

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

none..

Additional info

When I configure Apache to use PHP 7.4 with the same Nextcloud installation there isn't ANY problem!

So this must be related to PHP 8 somehow.. but I installed all the modules, there are no warnings what so ever in 'settings/admin/overview'

szaimen commented 1 year ago

Cc @come-nc

mrAceT commented 1 year ago

PS: @szaimen I updated the bug description a bit, hope it helps

AD: I use AWS S3 for primary file storage, but since PHP7.4 works fine, one would not think it to be a part of the problem?

mrAceT commented 1 year ago

(I knew I mentioned something "with spaces" here before!)

I have a test-setup that I had previously updated to Nextcloud 25 and PHP8.1 I now had a serious bug in my nextCloud and decided it was time to update my "production Nextcloud" to PHP 8.1 and I forgot I had the "space problem" mentioned here..

The bug of it already going wrong at uploading made finding the cause hard.. but after the upgrade I had a file already there with a space in it and viewing also didn't work.. now I found the cause!

#37852 fixes this bug!! Not only does it make it possible to view a file with a space in it, now I can also upload a file with a space in it! (I tested this with my test-setup, which does not have this "Q&D-fix" an there I still can not upload, but my production-version it does work! me happy ;)