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

Error when trying to upload Files to a File Drop #23543

Closed
adengg opened this issue Oct 17, 2020 · 14 comments
Closed

Error when trying to upload Files to a File Drop #23543

adengg opened this issue Oct 17, 2020 · 14 comments
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug

Comments

@adengg
Copy link

adengg commented Oct 17, 2020

Steps to reproduce

  1. nextcloud setup with postgres, php 7.4 and nginx config as per admin guide
  2. create a File Drop Url Share
  3. Try to upload a file into that shar

Expected behaviour

Upload Succeds & user gets a success message

Actual behaviour

Upload succeds but User gets an error message and there is a php error in the log.

Server configuration

Operating system:
Debian Linux 10
Web server:
nginx version: nginx/1.14.2

Database:
postgresql 11.9

PHP version:
7.4.11

Nextcloud version: (see Nextcloud admin page)
20.0.0

Updated from an older Nextcloud/ownCloud or fresh install:
fresh install
Where did you install Nextcloud from:
nextcloud-20.0.0.zip from download server

Signing status:

Signing status
No errors have been found.

List of activated apps:

App list
Enabled:
  - accessibility: 1.6.0
  - activity: 2.13.1
  - cloud_federation_api: 1.3.0
  - comments: 1.10.0
  - contactsinteraction: 1.1.0
  - dashboard: 7.0.0
  - dav: 1.16.0
  - federatedfilesharing: 1.10.1
  - federation: 1.10.1
  - files: 1.15.0
  - files_pdfviewer: 2.0.1
  - files_rightclick: 0.17.0
  - files_sharing: 1.12.0
  - files_trashbin: 1.10.1
  - files_versions: 1.13.0
  - files_videoplayer: 1.9.0
  - firstrunwizard: 2.9.0
  - logreader: 2.5.0
  - lookup_server_connector: 1.8.0
  - nextcloud_announcements: 1.9.0
  - notifications: 2.8.0
  - oauth2: 1.8.0
  - password_policy: 1.10.1
  - photos: 1.2.0
  - privacy: 1.4.0
  - provisioning_api: 1.10.0
  - recommendations: 0.8.0
  - serverinfo: 1.10.0
  - settings: 1.2.0
  - sharebymail: 1.10.0
  - support: 1.3.0
  - survey_client: 1.8.0
  - suspicious_login: 3.2.1
  - systemtags: 1.10.0
  - text: 3.1.0
  - theming: 1.11.0
  - twofactor_backupcodes: 1.9.0
  - twofactor_totp: 5.0.0
  - twofactor_u2f: 6.0.0
  - updatenotification: 1.10.0
  - user_status: 1.0.0
  - viewer: 1.4.0
  - weather_status: 1.0.0
  - workflowengine: 2.2.0
Disabled:
  - admin_audit
  - encryption
  - files_external
  - user_ldap

Nextcloud configuration:

Config report
{
    "system": {
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "localhost",
            "***REMOVED SENSITIVE VALUE***"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "pgsql",
        "version": "20.0.0.9",
        "overwrite.cli.url": "http:\/\/localhost",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.local": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 6379,
            "dbindex": 0
        },
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "twofactor_enforced": "true",
        "twofactor_enforced_groups": [],
        "twofactor_enforced_excluded_groups": [],
        "simpleSignUpLink.shown": false
    },
    "apps": {
        "accessibility": {
            "installed_version": "1.6.0",
            "types": "",
            "enabled": "yes"
        },
        "activity": {
            "installed_version": "2.13.1",
            "types": "filesystem",
            "enabled": "yes"
        },
        "backgroundjob": {
            "lastjob": "51"
        },
        "cloud_federation_api": {
            "installed_version": "1.3.0",
            "types": "filesystem",
            "enabled": "yes"
        },
        "comments": {
            "installed_version": "1.10.0",
            "types": "logging",
            "enabled": "yes"
        },
        "contactsinteraction": {
            "installed_version": "1.1.0",
            "types": "dav",
            "enabled": "yes"
        },
        "core": {
            "installedat": "1602784581.8188",
            "vendor": "nextcloud",
            "public_webdav": "dav\/appinfo\/v1\/publicwebdav.php",
            "public_files": "files_sharing\/public.php",
            "backgroundjobs_mode": "cron",
            "lastcron": "1602954908",
            "lastupdatedat": "1602954992",
            "theming.variables": "3a10f69ced88cddd98ee7a1591f9f4ab",
            "lastupdateResult": "[]"
        },
        "dashboard": {
            "installed_version": "7.0.0",
            "types": "",
            "enabled": "yes"
        },
        "dav": {
            "installed_version": "1.16.0",
            "types": "filesystem",
            "enabled": "yes"
        },
        "federatedfilesharing": {
            "installed_version": "1.10.1",
            "types": "",
            "enabled": "yes"
        },
        "federation": {
            "installed_version": "1.10.1",
            "types": "authentication",
            "enabled": "yes"
        },
        "files": {
            "installed_version": "1.15.0",
            "types": "filesystem",
            "enabled": "yes",
            "cronjob_scan_files": "500"
        },
        "files_pdfviewer": {
            "installed_version": "2.0.1",
            "types": "",
            "enabled": "yes"
        },
        "files_rightclick": {
            "installed_version": "0.17.0",
            "types": "",
            "enabled": "yes"
        },
        "files_sharing": {
            "installed_version": "1.12.0",
            "types": "filesystem",
            "enabled": "yes"
        },
        "files_trashbin": {
            "installed_version": "1.10.1",
            "types": "filesystem,dav",
            "enabled": "yes"
        },
        "files_versions": {
            "installed_version": "1.13.0",
            "types": "filesystem,dav",
            "enabled": "yes"
        },
        "files_videoplayer": {
            "installed_version": "1.9.0",
            "types": "",
            "enabled": "yes"
        },
        "firstrunwizard": {
            "installed_version": "2.9.0",
            "types": "logging",
            "enabled": "yes"
        },
        "logreader": {
            "installed_version": "2.5.0",
            "types": "",
            "enabled": "yes"
        },
        "lookup_server_connector": {
            "installed_version": "1.8.0",
            "types": "authentication",
            "enabled": "yes"
        },
        "nextcloud_announcements": {
            "installed_version": "1.9.0",
            "types": "logging",
            "enabled": "yes",
            "pub_date": "Thu, 24 Oct 2019 00:00:00 +0200"
        },
        "notifications": {
            "installed_version": "2.8.0",
            "types": "logging",
            "enabled": "yes"
        },
        "oauth2": {
            "installed_version": "1.8.0",
            "types": "authentication",
            "enabled": "yes"
        },
        "password_policy": {
            "installed_version": "1.10.1",
            "types": "authentication",
            "enabled": "yes",
            "enforceHaveIBeenPwned": "1"
        },
        "photos": {
            "installed_version": "1.2.0",
            "types": "",
            "enabled": "yes"
        },
        "privacy": {
            "installed_version": "1.4.0",
            "types": "",
            "enabled": "yes"
        },
        "provisioning_api": {
            "installed_version": "1.10.0",
            "types": "prevent_group_restriction",
            "enabled": "yes"
        },
        "recommendations": {
            "installed_version": "0.8.0",
            "types": "",
            "enabled": "yes"
        },
        "serverinfo": {
            "installed_version": "1.10.0",
            "types": "",
            "enabled": "yes"
        },
        "settings": {
            "installed_version": "1.2.0",
            "types": "",
            "enabled": "yes"
        },
        "sharebymail": {
            "installed_version": "1.10.0",
            "types": "filesystem",
            "enabled": "yes"
        },
        "support": {
            "installed_version": "1.3.0",
            "types": "session",
            "enabled": "yes"
        },
        "survey_client": {
            "installed_version": "1.8.0",
            "types": "",
            "enabled": "yes",
            "server": "no",
            "php": "no",
            "database": "no",
            "apps": "no",
            "stats": "no",
            "files_sharing": "no",
            "encryption": "no"
        },
        "suspicious_login": {
            "installed_version": "3.2.1",
            "types": "authentication",
            "enabled": "yes"
        },
        "systemtags": {
            "installed_version": "1.10.0",
            "types": "logging",
            "enabled": "yes"
        },
        "text": {
            "installed_version": "3.1.0",
            "types": "dav",
            "enabled": "yes"
        },
        "theming": {
            "backgroundMime": "image\/jpeg",
            "installed_version": "1.11.0",
            "types": "logging",
            "enabled": "yes",
            "name": "PrivacyWeek",
            "slogan": "***REMOVED SENSITIVE VALUE***",
            "privacyUrl": "***REMOVED SENSITIVE VALUE***",
            "imprintUrl": "***REMOVED SENSITIVE VALUE***",
            "cachebuster": "10",
            "logoheaderMime": "image\/jpeg",
            "color": "#954b97",
            "url": "***REMOVED SENSITIVE VALUE***"
        },
        "twofactor_backupcodes": {
            "installed_version": "1.9.0",
            "types": "",
            "enabled": "yes"
        },
        "twofactor_totp": {
            "installed_version": "5.0.0",
            "types": "",
            "enabled": "yes"
        },
        "twofactor_u2f": {
            "installed_version": "6.0.0",
            "types": "",
            "enabled": "yes"
        },
        "updatenotification": {
            "installed_version": "1.10.0",
            "types": "",
            "enabled": "yes",
            "update_check_errors": "0",
            "notify_groups": "[]"
        },
        "user_status": {
            "installed_version": "1.0.0",
            "types": "",
            "enabled": "yes"
        },
        "viewer": {
            "installed_version": "1.4.0",
            "types": "",
            "enabled": "yes"
        },
        "weather_status": {
            "installed_version": "1.0.0",
            "types": "",
            "enabled": "yes"
        },
        "workflowengine": {
            "installed_version": "2.2.0",
            "types": "filesystem",
            "enabled": "yes"
        }
    }
}

Are you using external storage, if yes which one: local/smb/sftp/...
no
Are you using encryption: yes/no
no
Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...
no

Client configuration

Browser:
Firefox 82, Chromium
Operating system:
Linux, FreeBSD

Logs

Nextcloud log (data/nextcloud.log)

Nextcloud log
[PHP] Error: Error: Cannot modify header information - headers already sent by (output started at /srv/nextcloud/20.0.0/nextcloud/3rdparty/sabre/http/lib/Sapi.php:132) at /srv/nextcloud/20.0.0/nextcloud/apps/dav/lib/Connector/Sabre/File.php#691 at <<closure>>

 0. <<closure>>
    OC\Log\ErrorHandler::onError(2, "Cannot modify h ... )", "/srv/nextcloud/ ... p", 691, {string: "X-Hash ... "})
 1. /srv/nextcloud/20.0.0/nextcloud/apps/dav/lib/Connector/Sabre/File.php line 691
    header("X-Hash-MD5: 0b5 ... 4")
 2. /srv/nextcloud/20.0.0/nextcloud/apps/dav/lib/Connector/Sabre/File.php line 189
    OCA\DAV\Connector\Sabre\File->header("X-Hash-MD5: 0b5 ... 4")
 3. <<closure>>
    OCA\DAV\Connector\Sabre\File->OCA\DAV\Connector\Sabre\{closure}("*** sensitive parameters replaced ***")
 4. /srv/nextcloud/20.0.0/nextcloud/lib/private/Files/Stream/HashWrapper.php line 71
    call_user_func(Closure {}, "*** sensitive parameter replaced ***")
 5. <<closure>>
    OC\Files\Stream\HashWrapper->stream_close()
 6. /srv/nextcloud/20.0.0/nextcloud/3rdparty/icewind/streams/src/Wrapper.php line 132
    fclose(null)
 7. /srv/nextcloud/20.0.0/nextcloud/lib/private/Files/Stream/HashWrapper.php line 75
    Icewind\Streams\Wrapper->stream_close()
 8. <<closure>>
    OC\Files\Stream\HashWrapper->stream_close()
 9. /srv/nextcloud/20.0.0/nextcloud/3rdparty/icewind/streams/src/Wrapper.php line 132
    fclose(null)
10. /srv/nextcloud/20.0.0/nextcloud/lib/private/Files/Stream/HashWrapper.php line 75
    Icewind\Streams\Wrapper->stream_close()
11. /srv/nextcloud/20.0.0/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 319
    OC\Files\Stream\HashWrapper->stream_close()
12. /srv/nextcloud/20.0.0/nextcloud/apps/dav/appinfo/v1/publicwebdav.php line 113
    Sabre\DAV\Server->exec()
13. /srv/nextcloud/20.0.0/nextcloud/public.php line 81
    require_once("/srv/nextcloud/ ... p")

PUT /public.php/webdav/Test-Upload-pls-ignore5.odp
from 2a02:::.... at 2020-10-17T16:37:57+00:00
@adengg adengg added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Oct 17, 2020
@devnull4242
Copy link

You can deactivate the "Activity App" to bypass the problem.

@adengg
Copy link
Author

adengg commented Oct 21, 2020

thanks, that seems to be working workaround.
i would still leave the issue open since my guess is that it should work with the activity app (which is activated by default)?

@rienkdejong
Copy link

I have this same issue, and in my case deactivating "Activity App" does not bypass the problem.
I have slightly other versions than in the opening post:
Nextcloud 20.0.7
PHP 7.3.19~deb10u1
DB: Mariadb 10.3.23

@new-on-github
Copy link

Same problem here:
Nextcloud 20.0.9 from a hoster (therefore no details on the config)

@adengg
Copy link
Author

adengg commented Apr 17, 2021

Just for the record:
i only encountered that particlular problem with one fresh installation where it was fixed with disabling the Activity App.
With my other installations (upgraded from various old versions of own- and nextcloud, all of them by now on 21.0.1) the problem is not present even with the activity app enabled.

since the instance where this occured no longer exists (it was set up for a conference that has since concluded) i would have to create a new installation to see if the problem i head still exists.

as for the the reports where it does not seem to be related to the activity app, that looks to me to be a different problem (which i can only speculate on without knowing more about it)

@heavygale
Copy link

heavygale commented Apr 30, 2021

my setup: 21.0.1, updated, local storage, tested with PHP 7.4.16 and 8.0.3, nginx/1.20.0, Debian 10,
server-side encrypion with default encryption module is enabled, but "Encrypt the home storage" is disabled

{"reqId":"DudkFiVI1m1pdwVCeseO","level":3,"time":"2021-04-30T08:52:04+00:00","remoteAddr":"[...]","user":"--","app":"webdav","method":"PUT","url":"/public.php/webdav/video-1605652964.mp4","message":"renaming part file to final file failed $renameOkay: false, $fileExists: false)","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X; rv:89.0) Gecko/20100101 Firefox/89.0","version":"21.0.1.1"}
{"reqId":"DudkFiVI1m1pdwVCeseO","level":4,"time":"2021-04-30T08:52:04+00:00","remoteAddr":"[...]","user":"--","app":"webdav","method":"PUT","url":"/public.php/webdav/video-1605652964.mp4","message":{"Exception":"Sabre\DAV\Exception","Message":"Could not rename part file to final file","Code":0,"Trace":[{"file":"/[...]/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php","line":156,"function":"put","class":"OCA\DAV\Connector\Sabre\File","type":"->"},{"file":"/[...]/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":1098,"function":"createFile","class":"OCA\DAV\Connector\Sabre\Directory","type":"->"},{"file":"/[...]/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":504,"function":"createFile","class":"Sabre\DAV\Server","type":"->"},{"file":"/[...]/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpPut","class":"Sabre\DAV\CorePlugin","type":"->"},{"file":"/[...]/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\DAV\Server","type":"->"},{"file":"/[...]/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\DAV\Server","type":"->"},{"file":"/[...]/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\DAV\Server","type":"->"},{"file":"/[...]/nextcloud/apps/dav/appinfo/v1/publicwebdav.php","line":113,"function":"exec","class":"Sabre\DAV\Server","type":"->"},{"file":"/[...]/nextcloud/public.php","line":81,"args":["/[...]/nextcloud/apps/dav/appinfo/v1/publicwebdav.php"],"function":"require_once"}],"File":"/[...]/nextcloud/apps/dav/lib/Connector/Sabre/File.php","Line":296,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X; rv:89.0) Gecko/20100101 Firefox/89.0","version":"21.0.1.1"}

private information has been replaced by [...]

Uploaded files remain in the file system, not visible in the nexctloud frontend, e.g.:
video-123456.mp4.ocTransferId1515239369.part

Related issue: #26179

@new-on-github
Copy link

further investigation made clear, that this problem seems to be related to server-side-encryption. Without it, it works for me. With it, it's broken even after disabling it, the problem is persistent.

@heavygale
Copy link

Looks like "Deleted files" also playes a role here (besides "Activity"). I managed to upload a few files successfully while disabling those Apps,.. but didn't manage to get it working consistently.

@dnno
Copy link

dnno commented Jun 9, 2021

I have the same error and deactivating "Deleted Files" solves it. Of course that's not something I want to do. And it's not just an error message, the upload does not succeed as mentioned above.

Is there anything on the horizon for a fix?

I'm on Nextcloud 20.0.10 managed by a hoster.

@Dominion0815
Copy link

same here with docker version 21.0.2.

after deactivating "Deleted Files" upload in file drop is working.

@modaresimr
Copy link

Great i confirm that disabling deleted file, activity app fixed my problem

@heavygale
Copy link

Looks like it got fixed in 21.0.3 - at least it's working for me now.

@szaimen
Copy link
Contributor

szaimen commented Aug 8, 2021

Based on @heavygale's comment I am closing this. Feel free to reopen if it should still happen on NC21.0.4 or above.

@szaimen szaimen closed this as completed Aug 8, 2021
@asaage
Copy link

asaage commented Oct 19, 2022

Please reopen this!
in nc-24.0.6 i get:
LogicException: "put" can only be accessed once if not application/x-www-form-urlencoded or application/json.
The file is uploaded anyway. Disabeling the activity-app helps to work around but that is not really an option.

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 bug
Projects
None yet
Development

No branches or pull requests

10 participants