Skip to content

Objectore, upload file >10 MB fails with error "Unable to seek to stream position 0 with whence 0" #13554

Closed

Description

@vpecinka

Steps to reproduce

  1. Install Nextcloud with object store Swift (multibucket in my case)
  2. Upload via web gui file greater than 10 MB (to invoke upload by 10MB chunks)

Expected behaviour

File should be uploaded and present in the folder

Actual behaviour

It fails with error Unable to seek to stream position 0 with whence 0. When uploading file <10 MB, it works. There is no limit on the Swift side (works to upload big files via python swift cli).

Server configuration

Operating system: Linux

Web server: Nginx

Database: MariaDB

PHP version: 7.0

Nextcloud version: NC 14.0.4.2 and NC 15.0.0.10

Updated from an older Nextcloud/ownCloud or fresh install: update NC 13 (works) –> NC 14 (fails) -> NC 15 (fails)

Where did you install Nextcloud from: tar.gz from main site

Nextcloud configuration:

Config report
{
    "system": {
        "version": "15.0.0.10",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "* replaced *"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "objectstore_multibucket": {
            "class": "OC\\Files\\ObjectStore\\Swift",
            "arguments": {
                "user": {
                    "name": "* replaced *",
                    "password": "* replaced *",
                    "domain": {
                        "name": "* replaced *"
                    }
                },
                "scope": {
                    "project": {
                        "name": "* replaced *",
                        "domain": {
                            "name": "* replaced *"
                        }
                    }
                },
                "region": "Kokura",
                "url": "https:\/\/* replaced *:35357\/v3\/",
                "objectPrefix": "id:",
                "num_buckets": 64,
                "bucket": "nc_",
                "autocreate": true,
                "tenantName": "* replaced *",
                "serviceName": "* replaced *"
            }
        },
        "overwrite.cli.url": "* replaced *",
        "overwriteprotocol": "https",
        "dbtype": "mysql",
        "dbtableprefix": "oc_",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "ldapIgnoreNamingRules": false,
        "mail_smtpmode": "smtp",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "25",
        "mail_smtpdebug": true,
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "filelocking.enabled": "true",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": "6379",
            "timeout": 0
        },
        "appstore.experimental.enabled": false,
        "proxy": "* replaced *:3128",
        "logtimezone": "UTC",
        "loglevel": "3",
        "logfile": "\/www\/log\/nextcloud.log",
        "theme": "seznam",
        "maintenance": false,
        "updatechecker": false,
        "activity_expire_days": 30,
        "ldapProviderFactory": "\\OCA\\User_LDAP\\LDAPProviderFactory",
        "auth.bruteforce.protection.enabled": false,
        "versions_retention_obligation": "365, 600",
        "trashbin_retention_obligation": "365, 600",
        "integrity.check.disabled": true
    },
    "apps": {
        "accessibility": {
            "enabled": "no",
            "installed_version": "1.0.1",
            "types": ""
        },
        "activity": {
            "enabled": "yes",
            "installed_version": "2.8.2",
            "types": "filesystem"
        },
        "admin_audit": {
            "enabled": "yes",
            "installed_version": "1.5.0",
            "types": "logging"
        },
        "announcementcenter": {
            "enabled": "yes",
            "installed_version": "3.4.0",
            "types": "logging"
        },
        "backgroundjob": {
            "lastjob": "12"
        },
        "cloud_federation_api": {
            "enabled": "yes",
            "installed_version": "0.1.0",
            "types": "filesystem"
        },
        "comments": {
            "enabled": "yes",
            "installed_version": "1.5.0",
            "types": "logging"
        },
        "core": {
            "backgroundjobs_mode": "webcron",
            "installedat": "1522314003.3001",
            "lastcron": "1524493944",
            "lastupdateResult": "[]",
            "lastupdatedat": "0",
            "moveavatarsdone": "yes",
            "oc.integritycheck.checker": "[]",
            "previewsCleanedUp": "1",
            "public_files": "files_sharing\/public.php",
            "public_webdav": "dav\/appinfo\/v1\/publicwebdav.php",
            "scss.variables": "db81cddf52fdb3c8ca1e4c859e214124",
            "vendor": "nextcloud"
        },
        "dav": {
            "buildCalendarSearchIndex": "yes",
            "enabled": "yes",
            "installed_version": "1.8.0",
            "types": "filesystem"
        },
        "deck": {
            "enabled": "yes",
            "installed_version": "0.5.2",
            "types": "logging"
        },
        "external": {
            "enabled": "yes",
            "installed_version": "3.2.0",
            "max_site": "1",
            "sites": "{\"1\":{\"id\":1,\"name\":\"* replaced *\",\"url\":\"https:\\\/\\\/* replaced *\\\/\",\"lang\":\"\",\"type\":\"link\",\"device\":\"\",\"icon\":\"m32.png\",\"groups\":[],\"redirect\":true}}",
            "types": ""
        },
        "federatedfilesharing": {
            "enabled": "yes",
            "installed_version": "1.5.0",
            "types": ""
        },
        "federation": {
            "enabled": "yes",
            "installed_version": "1.5.0",
            "types": "authentication"
        },
        "files": {
            "cronjob_scan_files": "500",
            "enabled": "yes",
            "installed_version": "1.10.0",
            "types": "filesystem"
        },
        "files_external": {
            "enabled": "yes",
            "installed_version": "1.6.0",
            "types": "filesystem"
        },
        "files_pdfviewer": {
            "enabled": "yes",
            "installed_version": "1.4.0",
            "types": ""
        },
        "files_sharing": {
            "enabled": "yes",
            "installed_version": "1.7.0",
            "types": "filesystem"
        },
        "files_texteditor": {
            "enabled": "yes",
            "installed_version": "2.7.0",
            "types": ""
        },
        "files_trashbin": {
            "enabled": "yes",
            "installed_version": "1.5.0",
            "types": "filesystem,dav"
        },
        "files_versions": {
            "enabled": "yes",
            "installed_version": "1.8.0",
            "types": "filesystem,dav"
        },
        "files_videoplayer": {
            "enabled": "yes",
            "installed_version": "1.4.0",
            "types": ""
        },
        "firstrunwizard": {
            "enabled": "no",
            "installed_version": "2.3.0",
            "types": "logging"
        },
        "gallery": {
            "enabled": "yes",
            "installed_version": "18.2.0",
            "types": ""
        },
        "groupfolders": {
            "enabled": "yes",
            "installed_version": "2.0.2",
            "types": "filesystem"
        },
        "impersonate": {
            "enabled": "yes",
            "installed_version": "1.2.0",
            "types": ""
        },
        "logreader": {
            "enabled": "yes",
            "installed_version": "2.0.0",
            "ocsid": "170871",
            "types": ""
        },
        "lookup_server_connector": {
            "enabled": "yes",
            "installed_version": "1.3.0",
            "types": "authentication"
        },
        "nextant": {
            "enabled": "no",
            "installed_version": "1.0.9",
            "types": "filesystem"
        },
        "nextcloud_announcements": {
            "enabled": "no",
            "installed_version": "1.3.0",
            "pub_date": "Sat, 10 Dec 2016 00:00:00 +0100",
            "types": "logging"
        },
        "notes": {
            "enabled": "yes",
            "installed_version": "2.5.1",
            "types": ""
        },
        "notifications": {
            "enabled": "yes",
            "installed_version": "2.3.0",
            "types": "logging"
        },
        "oauth2": {
            "enabled": "yes",
            "installed_version": "1.3.0",
            "types": "authentication"
        },
        "password_policy": {
            "enabled": "no",
            "installed_version": "1.4.0",
            "types": ""
        },
        "polls": {
            "enabled": "yes",
            "installed_version": "0.9.5",
            "types": ""
        },
        "provisioning_api": {
            "enabled": "yes",
            "installed_version": "1.5.0",
            "types": "prevent_group_restriction"
        },
        "richdocuments": {
            "enabled": "yes",
            "installed_version": "3.1.1",
            "types": "filesystem,dav,prevent_group_restriction",
            "wopi_url": "https:\/\/172.17.0.4:9980"
        },
        "serverinfo": {
            "enabled": "yes",
            "installed_version": "1.5.0",
            "types": ""
        },
        "sharebymail": {
            "enabled": "yes",
            "installed_version": "1.5.0",
            "types": "filesystem"
        },
        "spreed": {
            "enabled": "yes",
            "installed_version": "5.0.0",
            "stun_servers": "[\"stun.nextcloud.com:443\"]",
            "types": "prevent_group_restriction"
        },
        "support": {
            "enabled": "no",
            "installed_version": "1.0.0",
            "types": ""
        },
        "survey_client": {
            "enabled": "no",
            "installed_version": "1.2.0",
            "types": ""
        },
        "systemtags": {
            "enabled": "no",
            "installed_version": "1.4.0",
            "types": "logging"
        },
        "tasks": {
            "enabled": "yes",
            "installed_version": "0.9.8",
            "types": ""
        },
        "theming": {
            "enabled": "yes",
            "installed_version": "1.6.0",
            "types": "logging"
        },
        "twofactor_backupcodes": {
            "enabled": "yes",
            "installed_version": "1.4.1",
            "types": ""
        },
        "updatenotification": {
            "enabled": "yes",
            "installed_version": "1.5.0",
            "types": ""
        },
        "user_ldap": {
            "_lastChange": "1544362287",
            "enabled": "yes",
            "has_memberof_filter_support": "1",
            "installed_version": "1.5.0",
            "ldap_agent_password": "***REMOVED SENSITIVE VALUE***",
            "ldap_base": "* replaced *",
            "ldap_base_groups": "* replaced *",
            "ldap_base_users": "* replaced *",
            "ldap_cache_ttl": "600",
            "ldap_configuration_active": "1",
            "ldap_display_name": "displayname",
            "ldap_dn": "* replaced *",
            "ldap_email_attr": "mail",
            "ldap_group_filter": "(&(|(objectclass=group)))",
            "ldap_group_filter_mode": "1",
            "ldap_group_member_assoc_attribute": "member",
            "ldap_host": "ldaps:\/\/ldapauth",
            "ldap_login_filter": "(&(&(!(objectclass=computer))(!(userAccountControl=514))(objectclass=person)(sn=*)(title=*))(|(samaccountname=%uid)(|(mail=%uid)(mailNickname=%uid))))",
            "ldap_login_filter_mode": "1",
            "ldap_loginfilter_email": "0",
            "ldap_port": "636",
            "ldap_tls": "0",
            "ldap_user_filter_mode": "1",
            "ldap_userfilter_objectclass": "person",
            "ldap_userlist_filter": "(&(!(objectclass=computer))(!(userAccountControl=514))(objectclass=person)(sn=*)(title=*))",
            "types": "authentication"
        },
        "workflowengine": {
            "enabled": "yes",
            "installed_version": "1.5.0",
            "types": "filesystem"
        }
    }
}

Are you using external storage, if yes which one: swift object storage (multibucket)

Are you using encryption: no

Are you using an external user-backend, if yes which one: LDAP

Logs

Web server error log

Web server error log

For the failed case file slightly above 10 MB:

10.65.236.217 - - [13/Jan/2019:09:54:50 +0100] "MKCOL /remote.php/dav/uploads/admin/web-file-upload-e068cd2fccf9f554904984d9d488c17c-1547369690199 HTTP/1.0" 201 0 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.2 Safari/605.1.15" "-"
10.65.236.217 - - [13/Jan/2019:09:55:00 +0100] "GET /ocs/v2.php/apps/notifications/api/v2/notifications HTTP/1.0" 200 74 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.2 Safari/605.1.15" "-"
10.65.236.217 - - [13/Jan/2019:09:55:03 +0100] "PUT /remote.php/dav/uploads/admin/web-file-upload-e068cd2fccf9f554904984d9d488c17c-1547369690199/0 HTTP/1.0" 201 0 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.2 Safari/605.1.15" "-"
10.65.236.217 - - [13/Jan/2019:09:55:05 +0100] "PUT /remote.php/dav/uploads/admin/web-file-upload-e068cd2fccf9f554904984d9d488c17c-1547369690199/10485760 HTTP/1.0" 201 0 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.2 Safari/605.1.15" "-"
10.65.236.217 - - [13/Jan/2019:09:55:05 +0100] "MOVE /remote.php/dav/uploads/admin/web-file-upload-e068cd2fccf9f554904984d9d488c17c-1547369690199/.file HTTP/1.0" 500 232 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.2 Safari/605.1.15" "-"
10.65.236.217 - - [13/Jan/2019:09:55:05 +0100] "GET /index.php/apps/files/ajax/getstoragestats.php?dir=%2F HTTP/1.0" 200 211 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.2 Safari/605.1.15" "-"
10.65.236.217 - - [13/Jan/2019:09:55:05 +0100] "GET /index.php/apps/files/ajax/getstoragestats.php?dir=%2F HTTP/1.0" 200 211 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.2 Safari/605.1.15" "-"
10.65.236.217 - - [13/Jan/2019:09:55:30 +0100] "GET /ocs/v2.php/apps/notifications/api/v2/notifications HTTP/1.0" 200 74 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.2 Safari/605.1.15" "-"

For the successful case smaller file:

10.65.236.217 - - [13/Jan/2019:09:53:43 +0100] "PUT /remote.php/webdav/VBL%20-%20protokol%20o%20me%CC%8Cr%CC%8Ceni%CC%81.pdf HTTP/1.0" 201 0 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.2 Safari/605.1.15" "-"
10.65.236.217 - - [13/Jan/2019:09:53:43 +0100] "GET /index.php/apps/files/ajax/getstoragestats.php HTTP/1.0" 200 211 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.2 Safari/605.1.15" "-"
10.65.236.217 - - [13/Jan/2019:09:53:43 +0100] "PROPFIND /remote.php/dav/files/admin/VBL%20-%20protokol%20o%20me%CC%8Cr%CC%8Ceni%CC%81.pdf HTTP/1.0" 207 1149 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.2 Safari/605.1.15" "-"
10.65.236.217 - - [13/Jan/2019:09:53:43 +0100] "GET /index.php/apps/files/ajax/getstoragestats.php?dir=%2F HTTP/1.0" 200 211 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.2 Safari/605.1.15" "-"
10.65.236.217 - - [13/Jan/2019:09:54:00 +0100] "GET /ocs/v2.php/apps/notifications/api/v2/notifications HTTP/1.0" 200 74 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.2 Safari/605.1.15" "-"

Nextcloud log (data/nextcloud.log)

Nextcloud log

There is tree time the same error Unable to seek to stream position 0 with whence 0 for each of the 3 HTTP upload request

{
  "reqId": "xVwk5jFoiYyfgZn41BKZ",
  "level": 4,
  "time": "2019-01-13T08:55:05+00:00",
  "remoteAddr": "10.65.236.217",
  "user": "admin",
  "app": "webdav",
  "method": "MOVE",
  "url": "/remote.php/dav/uploads/admin/web-file-upload-e068cd2fccf9f554904984d9d488c17c-1547369690199/.file",
  "message": {
    "Exception": "Sabre\\DAV\\Exception",
    "Message": "Unable to seek to stream position 0 with whence 0",
    "Code": 0,
    "Trace": [
      {
        "file": "/www-nc15/nextcloud/apps/dav/lib/Connector/Sabre/File.php",
        "line": 209,
        "function": "convertToSabreException",
        "class": "OCA\\DAV\\Connector\\Sabre\\File",
        "type": "->",
        "args": [
          {
            "__class__": "RuntimeException"
          }
        ]
      },
      {
        "file": "/www-nc15/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php",
        "line": 156,
        "function": "put",
        "class": "OCA\\DAV\\Connector\\Sabre\\File",
        "type": "->",
        "args": [
          null
        ]
      },
      {
        "file": "/www-nc15/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php",
        "line": 316,
        "function": "createFile",
        "class": "OCA\\DAV\\Connector\\Sabre\\Directory",
        "type": "->",
        "args": [
          "git-2.0.1-intel-universal-snow-leopard.dmg",
          null
        ]
      },
      {
        "file": "/www-nc15/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php",
        "line": 130,
        "function": "copyNode",
        "class": "Sabre\\DAV\\Tree",
        "type": "->",
        "args": [
          {
            "__class__": "OCA\\DAV\\Upload\\FutureFile"
          },
          {
            "__class__": "OCA\\DAV\\Files\\FilesHome"
          },
          "git-2.0.1-intel-universal-snow-leopard.dmg"
        ]
      },
      {
        "file": "/www-nc15/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php",
        "line": 161,
        "function": "copy",
        "class": "Sabre\\DAV\\Tree",
        "type": "->",
        "args": [
          "uploads/admin/web-file-upload-e068cd2fccf9f554904984d9d488c17c-1547369690199/.file",
          "files/admin/git-2.0.1-intel-universal-snow-leopard.dmg"
        ]
      },
      {
        "file": "/www-nc15/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php",
        "line": 642,
        "function": "move",
        "class": "Sabre\\DAV\\Tree",
        "type": "->",
        "args": [
          "uploads/admin/web-file-upload-e068cd2fccf9f554904984d9d488c17c-1547369690199/.file",
          "files/admin/git-2.0.1-intel-universal-snow-leopard.dmg"
        ]
      },
      {
        "function": "httpMove",
        "class": "Sabre\\DAV\\CorePlugin",
        "type": "->",
        "args": [
          {
            "absoluteUrl": "https://** replaced **/remote.php/dav/uploads/admin/web-file-upload-e068cd2fccf9f554904984d9d488c17c-1547369690199/.file",
            "__class__": "Sabre\\HTTP\\Request"
          },
          {
            "__class__": "Sabre\\HTTP\\Response"
          }
        ]
      },
      {
        "file": "/www-nc15/nextcloud/3rdparty/sabre/event/lib/EventEmitterTrait.php",
        "line": 105,
        "function": "call_user_func_array",
        "args": [
          [
            {
              "__class__": "Sabre\\DAV\\CorePlugin"
            },
            "httpMove"
          ],
          [
            {
              "absoluteUrl": "https://** replaced **/remote.php/dav/uploads/admin/web-file-upload-e068cd2fccf9f554904984d9d488c17c-1547369690199/.file",
              "__class__": "Sabre\\HTTP\\Request"
            },
            {
              "__class__": "Sabre\\HTTP\\Response"
            }
          ]
        ]
      },
      {
        "file": "/www-nc15/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 479,
        "function": "emit",
        "class": "Sabre\\Event\\EventEmitter",
        "type": "->",
        "args": [
          "method:MOVE",
          [
            {
              "absoluteUrl": "https://** replaced **/remote.php/dav/uploads/admin/web-file-upload-e068cd2fccf9f554904984d9d488c17c-1547369690199/.file",
              "__class__": "Sabre\\HTTP\\Request"
            },
            {
              "__class__": "Sabre\\HTTP\\Response"
            }
          ]
        ]
      },
      {
        "file": "/www-nc15/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 254,
        "function": "invokeMethod",
        "class": "Sabre\\DAV\\Server",
        "type": "->",
        "args": [
          {
            "absoluteUrl": "https://** replaced **/remote.php/dav/uploads/admin/web-file-upload-e068cd2fccf9f554904984d9d488c17c-1547369690199/.file",
            "__class__": "Sabre\\HTTP\\Request"
          },
          {
            "__class__": "Sabre\\HTTP\\Response"
          }
        ]
      },
      {
        "file": "/www-nc15/nextcloud/apps/dav/lib/Server.php",
        "line": 298,
        "function": "exec",
        "class": "Sabre\\DAV\\Server",
        "type": "->",
        "args": []
      },
      {
        "file": "/www-nc15/nextcloud/apps/dav/appinfo/v2/remote.php",
        "line": 35,
        "function": "exec",
        "class": "OCA\\DAV\\Server",
        "type": "->",
        "args": []
      },
      {
        "file": "/www-nc15/nextcloud/remote.php",
        "line": 163,
        "args": [
          "/www-nc15/nextcloud/apps/dav/appinfo/v2/remote.php"
        ],
        "function": "require_once"
      }
    ],
    "File": "/www-nc15/nextcloud/apps/dav/lib/Connector/Sabre/File.php",
    "Line": 600,
    "Previous": {
      "Exception": "RuntimeException",
      "Message": "Unable to seek to stream position 0 with whence 0",
      "Code": 0,
      "Trace": [
        {
          "file": "/www-nc15/nextcloud/3rdparty/guzzlehttp/psr7/src/Stream.php",
          "line": 192,
          "function": "seek",
          "class": "GuzzleHttp\\Psr7\\Stream",
          "type": "->",
          "args": [
            0
          ]
        },
        {
          "file": "/www-nc15/nextcloud/3rdparty/guzzlehttp/guzzle/src/Handler/CurlFactory.php",
          "line": 268,
          "function": "rewind",
          "class": "GuzzleHttp\\Psr7\\Stream",
          "type": "->",
          "args": []
        },
        {
          "file": "/www-nc15/nextcloud/3rdparty/guzzlehttp/guzzle/src/Handler/CurlFactory.php",
          "line": 224,
          "function": "applyBody",
          "class": "GuzzleHttp\\Handler\\CurlFactory",
          "type": "->",
          "args": [
            "*** sensitive parameter replaced ***",
            "*** sensitive parameter replaced ***",
            {
              "_headers": {
                "X-Auth-Token": [
                  "** replaced **"
                ],
                "Expect": [
                  "100-Continue"
                ],
                "User-Agent": [
                  "GuzzleHttp/6.3.3 curl/7.52.1 PHP/7.0.33-0+deb9u1"
                ],
                "Host": [
                  "swift-keystone-proxy.** replaced **"
                ]
              },
              "10036": "PUT",
              "10002": "https://** replaced **/v1/AUTH_s_64/nc35/id%3A7029",
              "19913": false,
              "42": false,
              "78": 150,
              "181": 3,
              "84": 2,
              "46": true,
              "14": 10763118
            }
          ]
        },
        {
          "file": "/www-nc15/nextcloud/3rdparty/guzzlehttp/guzzle/src/Handler/CurlFactory.php",
          "line": 42,
          "function": "applyMethod",
          "class": "GuzzleHttp\\Handler\\CurlFactory",
          "type": "->",
          "args": [
            {
              "handle": null,
              "sink": null,
              "headers": [],
              "response": null,
              "request": {
                "__class__": "GuzzleHttp\\Psr7\\Request"
              },
              "options": {
                "synchronous": true,
                "base_uri": {
                  "__class__": "GuzzleHttp\\Psr7\\Uri"
                },
                "handler": {
                  "__class__": "OpenStack\\Common\\Transport\\HandlerStack"
                },
                "allow_redirects": {
                  "max": 5,
                  "protocols": [
                    "http",
                    "https"
                  ],
                  "strict": false,
                  "referer": false,
                  "track_redirects": false
                },
                "http_errors": true,
                "decode_content": true,
                "verify": true,
                "cookies": false
              },
              "errno": 0,
              "onHeadersException": null,
              "__class__": "GuzzleHttp\\Handler\\EasyHandle"
            },
            {
              "_headers": {
                "X-Auth-Token": [
                  "** replaced **"
                ],
                "Expect": [
                  "100-Continue"
                ],
                "User-Agent": [
                  "GuzzleHttp/6.3.3 curl/7.52.1 PHP/7.0.33-0+deb9u1"
                ],
                "Host": [
                  "swift-keystone-proxy.** replaced **"
                ]
              },
              "10036": "PUT",
              "10002": "https://** replaced **/v1/AUTH_s_64/nc35/id%3A7029",
              "19913": false,
              "42": false,
              "78": 150,
              "181": 3,
              "84": 2,
              "46": true,
              "14": 10763118
            }
          ]
        },
        {
          "file": "/www-nc15/nextcloud/3rdparty/guzzlehttp/guzzle/src/Handler/CurlHandler.php",
          "line": 39,
          "function": "create",
          "class": "GuzzleHttp\\Handler\\CurlFactory",
          "type": "->",
          "args": [
            "*** sensitive parameter replaced ***",
            "*** sensitive parameter replaced ***"
          ]
        },
        {
          "file": "/www-nc15/nextcloud/3rdparty/guzzlehttp/guzzle/src/Handler/Proxy.php",
          "line": 28,
          "function": "__invoke",
          "class": "GuzzleHttp\\Handler\\CurlHandler",
          "type": "->",
          "args": [
            "*** sensitive parameter replaced ***",
            "*** sensitive parameter replaced ***"
          ]
        },
        {
          "file": "/www-nc15/nextcloud/3rdparty/guzzlehttp/guzzle/src/Handler/Proxy.php",
          "line": 51,
          "function": "GuzzleHttp\\Handler\\{closure}",
          "class": "GuzzleHttp\\Handler\\Proxy",
          "type": "::",
          "args": [
            "*** sensitive parameters replaced ***"
          ]
        },
        {
          "file": "/www-nc15/nextcloud/3rdparty/php-opencloud/openstack/src/Common/Auth/AuthHandler.php",
          "line": 63,
          "function": "GuzzleHttp\\Handler\\{closure}",
          "class": "GuzzleHttp\\Handler\\Proxy",
          "type": "::",
          "args": [
            "*** sensitive parameters replaced ***"
          ]
        },
        {
          "file": "/www-nc15/nextcloud/3rdparty/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php",
          "line": 66,
          "function": "__invoke",
          "class": "OpenStack\\Common\\Auth\\AuthHandler",
          "type": "->",
          "args": [
            {
              "__class__": "GuzzleHttp\\Psr7\\Request"
            },
            "*** sensitive parameter replaced ***"
          ]
        },
        {
          "file": "/www-nc15/nextcloud/3rdparty/php-opencloud/openstack/src/Common/Transport/Middleware.php",
          "line": 25,
          "function": "__invoke",
          "class": "GuzzleHttp\\PrepareBodyMiddleware",
          "type": "->",
          "args": [
            "*** sensitive parameter replaced ***",
            "*** sensitive parameter replaced ***"
          ]
        },
        {
          "file": "/www-nc15/nextcloud/3rdparty/guzzlehttp/guzzle/src/HandlerStack.php",
          "line": 67,
          "function": "OpenStack\\Common\\Transport\\{closure}",
          "class": "OpenStack\\Common\\Transport\\Middleware",
          "type": "::",
          "args": [
            "*** sensitive parameters replaced ***"
          ]
        },
        {
          "file": "/www-nc15/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php",
          "line": 280,
          "function": "__invoke",
          "class": "GuzzleHttp\\HandlerStack",
          "type": "->",
          "args": [
            "*** sensitive parameter replaced ***",
            "*** sensitive parameter replaced ***"
          ]
        },
        {
          "file": "/www-nc15/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php",
          "line": 125,
          "function": "transfer",
          "class": "GuzzleHttp\\Client",
          "type": "->",
          "args": [
            "*** sensitive parameter replaced ***",
            "*** sensitive parameter replaced ***"
          ]
        },
        {
          "file": "/www-nc15/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php",
          "line": 131,
          "function": "requestAsync",
          "class": "GuzzleHttp\\Client",
          "type": "->",
          "args": [
            "PUT",
            {
              "__class__": "GuzzleHttp\\Psr7\\Uri"
            },
            {
              "synchronous": true,
              "base_uri": {
                "__class__": "GuzzleHttp\\Psr7\\Uri"
              },
              "handler": {
                "__class__": "OpenStack\\Common\\Transport\\HandlerStack"
              },
              "allow_redirects": {
                "max": 5,
                "protocols": [
                  "http",
                  "https"
                ],
                "strict": false,
                "referer": false,
                "track_redirects": false
              },
              "http_errors": true,
              "decode_content": true,
              "verify": true,
              "cookies": false,
              "_conditional": {
                "User-Agent": "GuzzleHttp/6.3.3 curl/7.52.1 PHP/7.0.33-0+deb9u1"
              }
            }
          ]
        },
        {
          "file": "/www-nc15/nextcloud/3rdparty/php-opencloud/openstack/src/Common/Api/OperatorTrait.php",
          "line": 118,
          "function": "request",
          "class": "GuzzleHttp\\Client",
          "type": "->",
          "args": [
            "PUT",
            "nc35/id:7029",
            {
              "headers": [],
              "body": {
                "__class__": "GuzzleHttp\\Psr7\\Stream"
              },
              "synchronous": true
            }
          ]
        },
        {
          "file": "/www-nc15/nextcloud/3rdparty/php-opencloud/openstack/src/Common/Api/OperatorTrait.php",
          "line": 126,
          "function": "sendRequest",
          "class": "OpenStack\\Common\\Resource\\OperatorResource",
          "type": "->",
          "args": [
            {
              "__class__": "OpenStack\\Common\\Api\\Operation"
            },
            {
              "name": "id:7029",
              "stream": {
                "__class__": "GuzzleHttp\\Psr7\\Stream"
              },
              "containerName": "nc35"
            }
          ]
        },
        {
          "file": "/www-nc15/nextcloud/3rdparty/php-opencloud/openstack/src/ObjectStore/v1/Models/StorageObject.php",
          "line": 115,
          "function": "execute",
          "class": "OpenStack\\Common\\Resource\\OperatorResource",
          "type": "->",
          "args": [
            {
              "method": "PUT",
              "path": "{containerName}/{+name}",
              "params": {
                "containerName": {
                  "location": "url",
                  "required": true,
                  "description": "The unique name for the container. The container name must be from 1 to 256 characters long and can start with any\ncharacter and contain any pattern. Character set must be UTF-8. The container name cannot contain a slash (/) character\nbecause this character delimits the container and object name. For example, /account/container/object."
                },
                "name": {
                  "location": "url",
                  "required": true,
                  "description": "The unique name for the object"
                },
                "content": {
                  "location": "raw",
                  "type": "string",
                  "description": "The content of the object in string form"
                },
                "stream": {
                  "location": "raw",
                  "type": "Psr\\Http\\Message\\StreamInterface",
                  "description": "The content of the object in string form"
                },
                "contentType": {
                  "location": "header",
                  "sentAs": "Content-Type",
                  "description": "The Content-Type entity-header field indicates the media type of the entity-body"
                },
                "detectContentType": {
                  "location": "header",
                  "type": "boolean",
                  "sentAs": "X-Detect-Content-Type",
                  "description": "If set to true, Object Storage guesses the content type based on the file extension and ignores the value sent in the\nContent-Type header, if present."
                },
                "copyFrom": {
                  "location": "header",
                  "sentAs": "X-Copy-From",
                  "description": "If set, this is the name of an object used to create the new object by copying the X-Copy-From object. The value is in\nform {container}/{object}. You must UTF-8-encode and then URL-encode the names of the container and object before you\ninclude them in the header. Using PUT with X-Copy-From has the same effect as using the COPY operation to copy an object."
                },
                "ETag": {
                  "location": "header",
                  "sentAs": "ETag",
                  "description": "The MD5 checksum value of the request body. For example, the MD5 checksum value of the object content. You are strongly\nrecommended to compute the MD5 checksum value of object content and include it in the request. This enables the Object\nStorage API to check the integrity of the upload. The value is not quoted."
                },
                "contentDisposition": {
                  "location": "header",
                  "sentAs": "Content-Disposition",
                  "description": "The Content-Disposition response-header field has been proposed as a means for the origin server to suggest a default\nfilename if the user requests that the content is saved to a file."
                },
                "contentEncoding": {
                  "location": "header",
                  "sentAs": "Content-Encoding",
                  "description": "The Content-Encoding entity-header field is used as a modifier to the media-type. When present, its value indicates\nwhat additional content codings have been applied to the entity-body, and thus what decoding mechanisms must be applied\nin order to obtain the media-type referenced by the Content-Type header field"
                },
                "deleteAt": {
                  "location": "header",
                  "sentAs": "X-Delete-At",
                  "description": "The certain date, in UNIX Epoch timestamp format, when the object will be removed."
                },
                "deleteAfter": {
                  "location": "header",
                  "sentAs": "X-Delete-After",
                  "description": "Specifies the number of seconds after which the object is removed. Internally, the Object Storage system stores this\nvalue in the X-Delete-At metadata item."
                },
                "metadata": {
                  "location": "header",
                  "type": "object",
                  "prefix": "X-Object-Meta-",
                  "properties": {
                    "type": "string"
                  },
                  "description": "Human-readable key/value pairs that help describe and determine what type of resource it is. You can specify whichever\nkey you like, but the values need to be in scalar form (since they will be translated to strings)."
                },
                "ifNoneMatch": {
                  "location": "header",
                  "sentAs": "If-None-Match",
                  "description": "In a nutshell, this provides for conditional requests. The value provided should be a MD5 checksum, and it will be\nchecked by the server receiving the request. If any existing entity held on the server has the same MD5 checksum (or\nETag), or if \"*\" is provided as the value, the request MUST NOT perform the request, and MUST return a 412\n(Precondition Failed) response.\n\nConversely, if none of the entity tags match, or if \"*\" is given and no current entity exists, the server may\nperform the requested method.\n\nSee http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14 for more information."
                },
                "objectManifest": {
                  "location": "header",
                  "sentAs": "X-Object-Manifest",
                  "type": "string",
                  "description": "The value of this header is {container}/{prefix}, where {container} is the name of the container where the segment\nobjects are stored, and {prefix} is a string that all segment objects have in common"
                }
              }
            },
            {
              "name": "id:7029",
              "stream": {
                "__class__": "GuzzleHttp\\Psr7\\Stream"
              },
              "containerName": "nc35"
            }
          ]
        },
        {
          "file": "/www-nc15/nextcloud/3rdparty/php-opencloud/openstack/src/ObjectStore/v1/Models/Container.php",
          "line": 196,
          "function": "create",
          "class": "OpenStack\\ObjectStore\\v1\\Models\\StorageObject",
          "type": "->",
          "args": [
            {
              "name": "id:7029",
              "stream": {
                "__class__": "GuzzleHttp\\Psr7\\Stream"
              },
              "containerName": "nc35"
            }
          ]
        },
        {
          "file": "/www-nc15/nextcloud/lib/private/Files/ObjectStore/Swift.php",
          "line": 81,
          "function": "createObject",
          "class": "OpenStack\\ObjectStore\\v1\\Models\\Container",
          "type": "->",
          "args": [
            {
              "name": "id:7029",
              "stream": {
                "__class__": "GuzzleHttp\\Psr7\\Stream"
              }
            }
          ]
        },
        {
          "file": "/www-nc15/nextcloud/lib/private/Files/ObjectStore/ObjectStoreStorage.php",
          "line": 449,
          "function": "writeObject",
          "class": "OC\\Files\\ObjectStore\\Swift",
          "type": "->",
          "args": [
            "id:7029",
            null
          ]
        },
        {
          "file": "/www-nc15/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php",
          "line": 630,
          "function": "writeStream",
          "class": "OC\\Files\\ObjectStore\\ObjectStoreStorage",
          "type": "->",
          "args": [
            "files/git-2.0.1-intel-universal-snow-leopard.dmg",
            null,
            null
          ]
        },
        {
          "file": "/www-nc15/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php",
          "line": 630,
          "function": "writeStream",
          "class": "OC\\Files\\Storage\\Wrapper\\Wrapper",
          "type": "->",
          "args": [
            "files/git-2.0.1-intel-universal-snow-leopard.dmg",
            null,
            null
          ]
        },
        {
          "file": "/www-nc15/nextcloud/apps/dav/lib/Connector/Sabre/File.php",
          "line": 169,
          "function": "writeStream",
          "class": "OC\\Files\\Storage\\Wrapper\\Wrapper",
          "type": "->",
          "args": [
            "files/git-2.0.1-intel-universal-snow-leopard.dmg",
            null
          ]
        },
        {
          "file": "/www-nc15/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php",
          "line": 156,
          "function": "put",
          "class": "OCA\\DAV\\Connector\\Sabre\\File",
          "type": "->",
          "args": [
            null
          ]
        },
        {
          "file": "/www-nc15/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php",
          "line": 316,
          "function": "createFile",
          "class": "OCA\\DAV\\Connector\\Sabre\\Directory",
          "type": "->",
          "args": [
            "git-2.0.1-intel-universal-snow-leopard.dmg",
            null
          ]
        },
        {
          "file": "/www-nc15/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php",
          "line": 130,
          "function": "copyNode",
          "class": "Sabre\\DAV\\Tree",
          "type": "->",
          "args": [
            {
              "__class__": "OCA\\DAV\\Upload\\FutureFile"
            },
            {
              "__class__": "OCA\\DAV\\Files\\FilesHome"
            },
            "git-2.0.1-intel-universal-snow-leopard.dmg"
          ]
        },
        {
          "file": "/www-nc15/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php",
          "line": 161,
          "function": "copy",
          "class": "Sabre\\DAV\\Tree",
          "type": "->",
          "args": [
            "uploads/admin/web-file-upload-e068cd2fccf9f554904984d9d488c17c-1547369690199/.file",
            "files/admin/git-2.0.1-intel-universal-snow-leopard.dmg"
          ]
        },
        {
          "file": "/www-nc15/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php",
          "line": 642,
          "function": "move",
          "class": "Sabre\\DAV\\Tree",
          "type": "->",
          "args": [
            "uploads/admin/web-file-upload-e068cd2fccf9f554904984d9d488c17c-1547369690199/.file",
            "files/admin/git-2.0.1-intel-universal-snow-leopard.dmg"
          ]
        },
        {
          "function": "httpMove",
          "class": "Sabre\\DAV\\CorePlugin",
          "type": "->",
          "args": [
            {
              "absoluteUrl": "https://** replaced **/remote.php/dav/uploads/admin/web-file-upload-e068cd2fccf9f554904984d9d488c17c-1547369690199/.file",
              "__class__": "Sabre\\HTTP\\Request"
            },
            {
              "__class__": "Sabre\\HTTP\\Response"
            }
          ]
        },
        {
          "file": "/www-nc15/nextcloud/3rdparty/sabre/event/lib/EventEmitterTrait.php",
          "line": 105,
          "function": "call_user_func_array",
          "args": [
            [
              {
                "__class__": "Sabre\\DAV\\CorePlugin"
              },
              "httpMove"
            ],
            [
              {
                "absoluteUrl": "https://** replaced **/remote.php/dav/uploads/admin/web-file-upload-e068cd2fccf9f554904984d9d488c17c-1547369690199/.file",
                "__class__": "Sabre\\HTTP\\Request"
              },
              {
                "__class__": "Sabre\\HTTP\\Response"
              }
            ]
          ]
        },
        {
          "file": "/www-nc15/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
          "line": 479,
          "function": "emit",
          "class": "Sabre\\Event\\EventEmitter",
          "type": "->",
          "args": [
            "method:MOVE",
            [
              {
                "absoluteUrl": "https://** replaced **/remote.php/dav/uploads/admin/web-file-upload-e068cd2fccf9f554904984d9d488c17c-1547369690199/.file",
                "__class__": "Sabre\\HTTP\\Request"
              },
              {
                "__class__": "Sabre\\HTTP\\Response"
              }
            ]
          ]
        },
        {
          "file": "/www-nc15/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
          "line": 254,
          "function": "invokeMethod",
          "class": "Sabre\\DAV\\Server",
          "type": "->",
          "args": [
            {
              "absoluteUrl": "https://** replaced **/remote.php/dav/uploads/admin/web-file-upload-e068cd2fccf9f554904984d9d488c17c-1547369690199/.file",
              "__class__": "Sabre\\HTTP\\Request"
            },
            {
              "__class__": "Sabre\\HTTP\\Response"
            }
          ]
        },
        {
          "file": "/www-nc15/nextcloud/apps/dav/lib/Server.php",
          "line": 298,
          "function": "exec",
          "class": "Sabre\\DAV\\Server",
          "type": "->",
          "args": []
        },
        {
          "file": "/www-nc15/nextcloud/apps/dav/appinfo/v2/remote.php",
          "line": 35,
          "function": "exec",
          "class": "OCA\\DAV\\Server",
          "type": "->",
          "args": []
        },
        {
          "file": "/www-nc15/nextcloud/remote.php",
          "line": 163,
          "args": [
            "/www-nc15/nextcloud/apps/dav/appinfo/v2/remote.php"
          ],
          "function": "require_once"
        }
      ],
      "File": "/www-nc15/nextcloud/3rdparty/guzzlehttp/psr7/src/Stream.php",
      "Line": 200
    },
    "CustomMessage": "--"
  },
  "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.2 Safari/605.1.15",
  "version": "15.0.0.10"
}

Browser log

Browser log
[Error] Failed to load resource: the server responded with a status of 500 () (.file, line 0)
https://******/remote.php/dav/uploads/admin/web-file-upload-e068cd2fccf9f554904984d9d488c17c-1547369690199/.file

Activity

  1. added
    0. Needs triage
    on Jan 13, 2019
  2. surface0 commented on Jan 16, 2019

    @surface0

    Same here with NC 15.0.2

  3. babolivier commented on Jan 18, 2019

    @babolivier

    Just upgraded to NC 15.0.2 from a NC 14.xx, never had this issue before and now I'm having it everytime I upload a file and it's > 10MB.
    FTR I also use openstack swift (as NC's primary storage backend) in a single bucket setup.

  4. vpecinka commented on Jan 18, 2019

    @vpecinka
    ContributorAuthor

    What I've found is, that the parts (chunks) are sucessfully uploaded - I can see it in my swift storage and in the DB as well.

    web log:

    172.17.0.3 - - [18/Jan/2019:13:51:33 +0100] "MKCOL /remote.php/dav/uploads/admin/web-file-upload-4855215b5a5b66ef64183d658003ba6f-1547815892190 HTTP/1.0" 201 0 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.2 Safari/605.1.15" "-"
    172.17.0.3 - - [18/Jan/2019:13:51:50 +0100] "PUT /remote.php/dav/uploads/admin/web-file-upload-4855215b5a5b66ef64183d658003ba6f-1547815892190/0 HTTP/1.0" 201 0 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.2 Safari/605.1.15" "-"
    172.17.0.3 - - [18/Jan/2019:13:51:52 +0100] "PUT /remote.php/dav/uploads/admin/web-file-upload-4855215b5a5b66ef64183d658003ba6f-1547815892190/10485760 HTTP/1.0" 201 0 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.2 Safari/605.1.15" "-"
    172.17.0.3 - - [18/Jan/2019:13:51:55 +0100] "MOVE /remote.php/dav/uploads/admin/web-file-upload-4855215b5a5b66ef64183d658003ba6f-1547815892190/.file HTTP/1.0" 500 232 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.2 Safari/605.1.15" "-"
    

    The DB:

    MariaDB [nextcloud_v15]> select fileid, path, name, size from oc_filecache where path like "%web-file-upload-4855%";
    +--------+---------------------------------------------------------------------------------+----------------------------------------------------------------+----------+
    | fileid | path                                                                            | name                                                           | size     |
    +--------+---------------------------------------------------------------------------------+----------------------------------------------------------------+----------+
    |   7099 | uploads/web-file-upload-4855215b5a5b66ef64183d658003ba6f-1547815892190          | web-file-upload-4855215b5a5b66ef64183d658003ba6f-1547815892190 | 10763118 |
    |   7101 | uploads/web-file-upload-4855215b5a5b66ef64183d658003ba6f-1547815892190/0        | 0                                                              | 10485760 |
    |   7103 | uploads/web-file-upload-4855215b5a5b66ef64183d658003ba6f-1547815892190/10485760 | 10485760                                                       |   277358 |
    +--------+---------------------------------------------------------------------------------+----------------------------------------------------------------+----------+
    

    and the swift

        10485760 2019-01-18 12:51:49 id:7101
          277358 2019-01-18 12:51:52 id:7103
    

    What I cannot see is the object id:7099, which is obviously created as a placeholder at the beginning of the upload (lower id than chunks). I will investigate the MOVE command (web log). The side effect is that database and storage both are being filled with unsuccessful chunked data.

    off topic: my swift object have prefix id: (comes from docs in and old owncloud guide). I do not recommend it for users, as it fails here: nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php in the buildUri() function. I patch this function with $uri = str_replace("/id:", "/id%3A", $uri); so it works, but you can avoid that pain, if you have fresh install.

  5. kesselb commented on Jan 18, 2019

    @kesselb
    Contributor

    #13036 could this help with your issue?

  6. vpecinka commented on Jan 18, 2019

    @vpecinka
    ContributorAuthor

    Unfortunately not. I manually patched the changed files (in my 15.0.2 setup) and nothing has changed, the same error. As far as I understand, there is no problem of being out of sync (cache and storage). Will investigate further.

  7. kesselb commented on Jan 18, 2019

    @kesselb
    Contributor

    Ref #13062 (similar issue for s3 storage, error message is different but root looks the same. a non seekable file).

  8. vpecinka commented on Jan 18, 2019

    @vpecinka
    ContributorAuthor

    I got it, i guess.

    The problem is with the seek on unseekable resource in /www/nextcloud/3rdparty/guzzlehttp/psr7/src/Stream.php:192. I modified it little bit to get position in the stream, try to seek resource and print Stream object.

    When I recall the last MOVE query curl --http1.1 -k -H "$(cat h.txt)" -X MOVE https://my-test-domain/remote.php/dav/uploads/admin/web-file-upload-4855215b5a5b66ef64183d658003ba6f-150458216/.file

    I got this (my patched) output:

    ftell: 0
    fseek: -1
    GuzzleHttp\Psr7\Stream Object
    (
        [stream:GuzzleHttp\Psr7\Stream:private] => Resource id #36
        [size:GuzzleHttp\Psr7\Stream:private] => 10763118
        [seekable:GuzzleHttp\Psr7\Stream:private] => 1
        [readable:GuzzleHttp\Psr7\Stream:private] => 1
        [writable:GuzzleHttp\Psr7\Stream:private] => 1
        [uri:GuzzleHttp\Psr7\Stream:private] => count://
        [customMetadata:GuzzleHttp\Psr7\Stream:private] => Array
            (
            )
    )
    

    Well, with object storage the Stream object should not be seekable... So as a test I allowed throwing the exception only if ftell() (current position) is different from requested one (because we are at 0 pos, no seek needed - it is requested by rewind() call:

    if (ftell($this->stream) != $offset) {
             throw new \RuntimeException('Unable to seek to stream position '
    		    . $offset . ' with whence ' . var_export($whence, true));
    }
    

    And voilá - it works!

    Maybe it helps also S3 folks in #13062 (cannot test)

  9. vpecinka commented on Jan 18, 2019

    @vpecinka
    ContributorAuthor

    My final hotfix patch here. Although for long term solution it needs to find how to avoid calling seek or rewind in the first place.

    --- nextcloud/3rdparty/guzzlehttp/psr7/src/Stream.php.orig	2019-01-18 16:16:56.000000000 +0100
    +++ nextcloud/3rdparty/guzzlehttp/psr7/src/Stream.php	2019-01-18 16:17:47.000000000 +0100
    @@ -197,6 +197,9 @@
             if (!$this->seekable) {
                 throw new \RuntimeException('Stream is not seekable');
             } elseif (fseek($this->stream, $offset, $whence) === -1) {
    +            // if we not needed to seek, return
    +            if (ftell($this->stream) == $offset && $whence == SEEK_SET) return;
    +
                 throw new \RuntimeException('Unable to seek to stream position '
                     . $offset . ' with whence ' . var_export($whence, true));
             }
    
  10. kesselb commented on Jan 18, 2019

    @kesselb
    Contributor
  11. kesselb commented on Jan 18, 2019

    @kesselb
    Contributor

    Did some testing. Looks like a duplicate of #13062 to me.

  12. babolivier commented on Feb 21, 2019

    @babolivier

    It's still happening after upgrading to 15.0.4, while the S3 issue seems to have been resolved in there (which is not surprising as this issue is unrelated to S3, so doesn't seem like it was a duplicate in the first place, therefore neither #13062 nor the fix would address this one). @kesselb could you please reopen the issue?

  13. kesselb commented on Feb 21, 2019

    @kesselb
    Contributor

    It's still happening after upgrading to 15.0.4, while the S3 issue seems to have been resolved in there (which is not surprising as this issue is unrelated to S3, so doesn't seem like it was a duplicate in the first place, therefore neither #13062 nor the fix would address this one). @kesselb could you please reopen the issue?

    @vpecinka can you confirm?

  14. vpecinka commented on Feb 22, 2019

    @vpecinka
    ContributorAuthor

    Well, I am running 15.0.4 with my patch - so unable to say... Leaving for holiday now, cannot confirm for a week at least...

  15. zizzfizzix commented on Feb 25, 2019

    @zizzfizzix

    @vpecinka can you confirm?

    I just hit this issue on 15.0.4 with Swift storage so definitely not resolved.

    Tried @vpecinka's patch, and it works without a hitch.

  16. added this to the Nextcloud 16 milestone on Mar 6, 2019
  17. mzamot commented on Mar 8, 2019

    @mzamot
    Contributor

    I used the merged code and it's still not working. It seems the negation in !(isset($meta['seekable']) is not working as intended.

  18. schoenpat commented on Apr 5, 2019

    @schoenpat

    I can confirm @mzamot

  19. reopened this on Apr 5, 2019
  20. vpecinka commented on Apr 5, 2019

    @vpecinka
    ContributorAuthor

    Well, when I played before I post my patch I also tried the meta information about "seeakability" of the stream, but it didn't work. For me it was too complex to find better "on stream" based solution :/

  21. vpecinka commented on Apr 7, 2019

    @vpecinka
    ContributorAuthor
  22. schoenpat commented on Apr 7, 2019

    @schoenpat

    @vpecinka I never applied your patch, but #14424 . Not sure if i also removed the negation before, but doesn't matter now. Fact is that the bug is still there in 15.0.6

  23. babolivier commented on May 20, 2019

    @babolivier

    Just updated to 15.0.8 in which the fix has been backported, and it works wonderfully! Thank you very much for following up on this and for your work overall 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    0. Needs triagebug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions