Skip to content

Object of class OC\\User\\User could not be converted to string  #13433

@vpecinka

Description

@vpecinka

Steps to reproduce

I did upgrade from NC 13 to NC 14 and NC 15. The setup uses Swift object storage (multi bucket). In the both versions (14/15) there is the same bug - just after successful login (LDAP) when I try to create e.g. note.txt, nothing happened and there is an error message in the log saying

Object of class OC\\User\\User could not be converted to string at /www-nc15/nextcloud/lib/private/Files/ObjectStore/SwiftFactory.php#101"

The same happened when I simply try to download an existing file - same error in the log with problem using the User object as string.

Server configuration

Operating system:
Linux
Web server:
Nginx
Database:
MariaDB
PHP version:
7.0
Nextcloud version: (see Nextcloud admin page)
both "14.0.4.2" and "15.0.0.10"

Updated from an older Nextcloud/ownCloud or fresh install:
updated 13 (works) -> 14 (fail) -> 15 (fail)

List of activated apps:

App list
Enabled:
  - accessibility: 1.0.1
  - activity: 2.7.0
  - admin_audit: 1.4.0
  - announcementcenter: 3.3.1
  - cloud_federation_api: 0.0.1
  - comments: 1.4.0
  - dav: 1.6.0
  - deck: 0.5.2
  - external: 3.1.0
  - federatedfilesharing: 1.4.0
  - federation: 1.4.0
  - files: 1.9.0
  - files_external: 1.5.0
  - files_pdfviewer: 1.3.2
  - files_sharing: 1.6.2
  - files_texteditor: 2.6.0
  - files_trashbin: 1.4.1
  - files_versions: 1.7.1
  - files_videoplayer: 1.3.0
  - firstrunwizard: 2.3.0
  - gallery: 18.1.0
  - groupfolders: 2.0.2
  - impersonate: 1.1.0
  - logreader: 2.0.0
  - lookup_server_connector: 1.2.0
  - nextcloud_announcements: 1.3.0
  - notes: 2.5.1
  - notifications: 2.2.1
  - oauth2: 1.2.1
  - password_policy: 1.4.0
  - polls: 0.9.5
  - provisioning_api: 1.4.0
  - serverinfo: 1.4.0
  - sharebymail: 1.4.0
  - spreed: 4.0.2
  - support: 1.0.0
  - survey_client: 1.2.0
  - systemtags: 1.4.0
  - tasks: 0.9.8
  - theming: 1.5.0
  - twofactor_backupcodes: 1.3.1
  - updatenotification: 1.4.1
  - user_ldap: 1.4.0
  - workflowengine: 1.4.0
Disabled:
  - encryption
  - richdocuments
  - user_external

Nextcloud configuration:

Config report
{
    "system": {
        "version": "14.0.4.2",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "central.dev.dszn.cz"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "objectstore_multibucket": {
            "class": "OC\\Files\\ObjectStore\\Swift",
            "arguments": {
                "user": {
                    "name": "******",
                    "password": "*******",
                    "domain": {
                        "name": "*****"
                    }
                },
                "scope": {
                    "project": {
                        "name": "*****",
                        "domain": {
                            "name": "******"
                        }
                    }
                },
                "region": "*****",
                "url": "*************",
                "objectPrefix": "id:",
                "num_buckets": 64,
                "bucket": "nc_",
                "autocreate": true,
                "tenantName": "nextcloud",
                "serviceName": "nextcloud"
            }
        },
        "overwrite.cli.url": "https:\/\/central.dev.dszn.cz",
        "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": "proxy: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
    }
}

Logs

Nextcloud log (data/nextcloud.log)

Nextcloud log
www-data@nextcloud-web-7d68d9c87d-jjxvz:/www/nextcloud$ cat /www/log/nextcloud.log |jq
{
  "reqId": "1G3Hygcx1s5HB1R8QCdO",
  "level": 3,
  "time": "2019-01-08T23:08:54+00:00",
  "remoteAddr": "10.65.235.27",
  "user": "admin",
  "app": "PHP",
  "method": "PUT",
  "url": "/remote.php/dav/files/admin/Notes/pokus.txt",
  "message": "Object of class OC\\User\\User could not be converted to string at /www-nc14/nextcloud/lib/private/Files/ObjectStore/SwiftFactory.php#101",
  "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.2 Safari/605.1.15",
  "version": "14.0.4.2"
}
{
  "reqId": "1G3Hygcx1s5HB1R8QCdO",
  "level": 3,
  "time": "2019-01-08T23:08:54+00:00",
  "remoteAddr": "10.65.235.27",
  "user": "admin",
  "app": "remote",
  "method": "PUT",
  "url": "/remote.php/dav/files/admin/Notes/pokus.txt",
  "message": {
    "Exception": "Error",
    "Message": "Cannot use object of type OC\\User\\User as array",
    "Code": 0,
    "Trace": [
      {
        "file": "/www-nc14/nextcloud/lib/private/Files/ObjectStore/SwiftFactory.php",
        "line": 189,
        "function": "getClient",
        "class": "OC\\Files\\ObjectStore\\SwiftFactory",
        "type": "->",
        "args": []
      },
      {
        "file": "/www-nc14/nextcloud/lib/private/Files/ObjectStore/SwiftFactory.php",
        "line": 177,
        "function": "createContainer",
        "class": "OC\\Files\\ObjectStore\\SwiftFactory",
        "type": "->",
        "args": []
      },
      {
        "file": "/www-nc14/nextcloud/lib/private/Files/ObjectStore/Swift.php",
        "line": 59,
        "function": "getContainer",
        "class": "OC\\Files\\ObjectStore\\SwiftFactory",
        "type": "->",
        "args": []
      },
      {
        "file": "/www-nc14/nextcloud/lib/private/Files/ObjectStore/Swift.php",
        "line": 79,
        "function": "getContainer",
        "class": "OC\\Files\\ObjectStore\\Swift",
        "type": "->",
        "args": []
      },
      {
        "file": "/www-nc14/nextcloud/lib/private/Files/ObjectStore/ObjectStoreStorage.php",
        "line": 419,
        "function": "writeObject",
        "class": "OC\\Files\\ObjectStore\\Swift",
        "type": "->",
        "args": [
          "id:6421",
          null
        ]
      },
      {
        "file": "/www-nc14/nextcloud/lib/private/Files/ObjectStore/ObjectStoreStorage.php",
        "line": 302,
        "function": "writeBack",
        "class": "OC\\Files\\ObjectStore\\ObjectStoreStorage",
        "type": "->",
        "args": [
          "/www/log/oc_tmp_aiMWu8-.txt",
          "files/Notes/pokus.txt"
        ]
      },
      {
        "function": "OC\\Files\\ObjectStore\\{closure}",
        "class": "OC\\Files\\ObjectStore\\ObjectStoreStorage",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/www-nc14/nextcloud/apps/files_external/3rdparty/icewind/streams/src/CallbackWrapper.php",
        "line": 109,
        "function": "call_user_func",
        "args": [
          {
            "__class__": "Closure"
          }
        ]
      },
      {
        "function": "stream_close",
        "class": "Icewind\\Streams\\CallbackWrapper",
        "type": "->",
        "args": []
      },
      {
        "file": "/www-nc14/nextcloud/apps/dav/lib/Connector/Sabre/File.php",
        "line": 175,
        "function": "fclose",
        "args": [
          null
        ]
      },
      {
        "file": "/www-nc14/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php",
        "line": 156,
        "function": "put",
        "class": "OCA\\DAV\\Connector\\Sabre\\File",
        "type": "->",
        "args": [
          null
        ]
      },
      {
        "file": "/www-nc14/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 1096,
        "function": "createFile",
        "class": "OCA\\DAV\\Connector\\Sabre\\Directory",
        "type": "->",
        "args": [
          "pokus.txt",
          null
        ]
      },
      {
        "file": "/www-nc14/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php",
        "line": 529,
        "function": "createFile",
        "class": "Sabre\\DAV\\Server",
        "type": "->",
        "args": [
          "files/admin/Notes/pokus.txt",
          null,
          null
        ]
      },
      {
        "function": "httpPut",
        "class": "Sabre\\DAV\\CorePlugin",
        "type": "->",
        "args": [
          {
            "absoluteUrl": "https://central.dev.dszn.cz/remote.php/dav/files/admin/Notes/pokus.txt",
            "__class__": "Sabre\\HTTP\\Request"
          },
          {
            "__class__": "Sabre\\HTTP\\Response"
          }
        ]
      },
      {
        "file": "/www-nc14/nextcloud/3rdparty/sabre/event/lib/EventEmitterTrait.php",
        "line": 105,
        "function": "call_user_func_array",
        "args": [
          [
            {
              "__class__": "Sabre\\DAV\\CorePlugin"
            },
            "httpPut"
          ],
          [
            {
              "absoluteUrl": "https://central.dev.dszn.cz/remote.php/dav/files/admin/Notes/pokus.txt",
              "__class__": "Sabre\\HTTP\\Request"
            },
            {
              "__class__": "Sabre\\HTTP\\Response"
            }
          ]
        ]
      },
      {
        "file": "/www-nc14/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 479,
        "function": "emit",
        "class": "Sabre\\Event\\EventEmitter",
        "type": "->",
        "args": [
          "method:PUT",
          [
            {
              "absoluteUrl": "https://central.dev.dszn.cz/remote.php/dav/files/admin/Notes/pokus.txt",
              "__class__": "Sabre\\HTTP\\Request"
            },
            {
              "__class__": "Sabre\\HTTP\\Response"
            }
          ]
        ]
      },
      {
        "file": "/www-nc14/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 254,
        "function": "invokeMethod",
        "class": "Sabre\\DAV\\Server",
        "type": "->",
        "args": [
          {
            "absoluteUrl": "https://central.dev.dszn.cz/remote.php/dav/files/admin/Notes/pokus.txt",
            "__class__": "Sabre\\HTTP\\Request"
          },
          {
            "__class__": "Sabre\\HTTP\\Response"
          }
        ]
      },
      {
        "file": "/www-nc14/nextcloud/apps/dav/lib/Server.php",
        "line": 293,
        "function": "exec",
        "class": "Sabre\\DAV\\Server",
        "type": "->",
        "args": []
      },
      {
        "file": "/www-nc14/nextcloud/apps/dav/appinfo/v2/remote.php",
        "line": 35,
        "function": "exec",
        "class": "OCA\\DAV\\Server",
        "type": "->",
        "args": []
      },
      {
        "file": "/www-nc14/nextcloud/remote.php",
        "line": 163,
        "args": [
          "/www-nc14/nextcloud/apps/dav/appinfo/v2/remote.php"
        ],
        "function": "require_once"
      }
    ],
    "File": "/www-nc14/nextcloud/lib/private/Files/ObjectStore/SwiftFactory.php",
    "Line": 110,
    "CustomMessage": "--"
  },
  "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.2 Safari/605.1.15",
  "version": "14.0.4.2"
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions