Skip to content

[Bug]: Cannot move file shared by circle : Cannot access offset of type string on string #46941

Open
@wargreen

Description

⚠️ This issue respects the following points: ⚠️

Bug description

Since some time (don't know exactly when, maybe after the last 28.0.8.1 upgrade), we can't move file in a folder that is shared by other via a circle.
We got in the log :
TypeError Cannot access offset of type string on string

Steps to reproduce

  1. ???
  2. Share a folder with a circle
  3. With another user, try to move a file in a subfolder

Expected behavior

File move and no error

Installation method

Community Manual installation with Archive

Nextcloud Server version

28

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.2

Web server

Nginx

Database engine version

MySQL

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

Updated from a MINOR version (ex. 28.0.1 to 28.0.2)

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

What user-backends are you using?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

"system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "forwarded_for_headers": [
            "HTTP_X_FORWARDED_FOR"
        ],
        "trusted_domains": [
           ***REMOVED SENSITIVE VALUE***
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "28.0.8.1",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "default_language": "fr",
        "defaultapp": "activity",
        "installed": true,
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpmode": "smtp",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "htaccess.RewriteBase": "\/",
        "enable_previews": true,
        "preview_max_x": 2048,
        "preview_max_scale_factor": 1,
        "log_type": "file",
        "syslog_tag": "NextCloud",
        "loglevel": 3,
        "logfile": "\/var\/log\/nextcloud\/nextcloud.log",
        "log_query": false,
        "updater.release.channel": "stable",
        "allow_user_to_change_display_name": true,
        "memcache.local": "\\OC\\Memcache\\APCu",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 6379
        },
        "mysql.utf8mb4": true,
        "mail_sendmailmode": "smtp",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "465",
        "cache_chunk_gc_ttl": 86400,
        "default_phone_region": "FR",
        "maintenance": false,
        "overwrite.cli.protocol": "https",
        "overwrite.cli.url": "https:\/\/cloud.lebib.org",
        "webhooks_calendar_object_created_url": "https:\/\/************.org\/api\/v4\/projects\/84144\/ref\/main\/trigger\/pipeline?token=glptt-36bc1bc933dc7e9dedf9397010a39993067899bf",
        "mail_smtpdebug": false,
        "debug": false,
        "mail_smtpsecure": "ssl",
        "mail_smtpstreamoptions": {
            "ssl": {
                "allow_self_signed": true,
                "verify_peer": false,
                "verify_peer_name": false
            }
        },
        "profiler": false,
        "app_install_overwrite": [
            "files_rightclick",
            "issuetemplate",
            "apporder",
            "metadata",
            "calendar_news"
        ],
        "maintenance_window_start": 2
    }
}

List of activated Apps

- activity: 2.20.0
  - announcementcenter: 6.8.1
  - bruteforcesettings: 2.8.0
  - calendar: 4.7.13
  - calendar_resource_management: 0.8.0
  - circles: 28.0.0
  - cloud_federation_api: 1.11.0
  - collectives: 2.13.0
  - comments: 1.18.0
  - contacts: 5.5.3
  - contactsinteraction: 1.9.0
  - cospend: 1.6.1
  - dashboard: 7.8.0
  - data_request: 1.15.0
  - dav: 1.29.2
  - deck: 1.12.4
  - drawio: 3.0.2
  - drop_account: 2.5.0
  - federatedfilesharing: 1.18.0
  - federation: 1.18.0
  - files: 2.0.0
  - files_external: 1.20.0
  - files_pdfviewer: 2.9.0
  - files_reminders: 1.1.0
  - files_sharing: 1.20.0
  - files_trashbin: 1.18.0
  - files_versions: 1.21.0
  - fileslibreofficeedit: 1.1.0
  - firstrunwizard: 2.17.0
  - forms: 4.2.4
  - groupfolders: 16.0.7
  - impersonate: 1.15.0
  - integration_dropbox: 2.2.0
  - integration_gitlab: 3.0.1
  - integration_google: 2.2.0
  - integration_openstreetmap: 1.0.12
  - keeweb: 0.6.19
  - logreader: 2.13.0
  - lookup_server_connector: 1.16.0
  - maps: 1.4.0
  - nextcloud_announcements: 1.17.0
  - notifications: 2.16.0
  - notify_push: 0.7.0
  - oauth2: 1.16.3
  - password_policy: 1.18.0
  - photos: 2.4.0
  - polls: 7.1.4
  - privacy: 1.12.0
  - provisioning_api: 1.18.0
  - quota_warning: 1.19.0
  - recommendations: 2.0.0
  - registration: 2.4.0
  - related_resources: 1.3.0
  - serverinfo: 1.18.0
  - settings: 1.10.1
  - sharebymail: 1.18.0
  - side_menu: 3.13.1
  - spreed: 18.0.10
  - survey_client: 1.16.0
  - suspicious_login: 6.0.0
  - systemtags: 1.18.0
  - tables: 0.7.5
  - tasks: 0.16.0
  - text: 3.9.2
  - theming: 2.3.0
  - transfer: 0.6.3
  - twofactor_backupcodes: 1.17.0
  - updatenotification: 1.18.0
  - uppush: 1.4.3
  - user_status: 1.8.1
  - viewer: 2.2.0
  - weather_status: 1.8.0
  - workflow_ocr: 1.28.1
  - workflowengine: 2.10.0
Disabled:
  - admin_audit: 1.18.0
  - appointments: 2.1.8 (installed 2.1.8)
  - encryption: 2.16.0 (installed 2.16.0)
  - end_to_end_encryption: 1.14.5 (installed 1.14.5)
  - files_fulltextsearch: 28.0.0 (installed 28.0.0)
  - files_mindmap: 0.0.30 (installed 0.0.30)
  - files_rightclick: 0.15.1 (installed 0.15.1)
  - fulltextsearch: 28.0.1 (installed 28.0.1)
  - fulltextsearch_elasticsearch: 28.0.3 (installed 28.0.3)
  - issuetemplate: 0.7.0 (installed 0.7.0)
  - metadata: 0.20.0 (installed 0.20.0)
  - profiler: 1.3.1 (installed 1.3.1)
  - support: 1.11.1 (installed 1.0.0)
  - twofactor_totp: 10.0.0-beta.2
  - user_ldap: 1.19.0
  - webhooks: 0.4.3 (installed 0.4.3)

Nextcloud Signing status

No response

Nextcloud Logs

{"reqId":"g0a7HN1V8BhjTjn3rC3u","level":3,"time":"2024-07-31T23:11:12+00:00","remoteAddr":"10.12.200.242","user":"wargreen","app":"webdav","method":"MOVE","url":"/remote.php/dav/files/wargreen/Myxonautes/Nouveau%20fichier%20test.md","message":"Cannot access offset of type string on string","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0","version":"28.0.8.1","exception":{"Exception":"TypeError","Message":"Cannot access offset of type string on string","Code":0,"Trace":[{"file":"/srv/nextcloud/lib/private/Share20/ShareHelper.php","line":55,"function":"getPathsForUsers","class":"OC\\Share20\\ShareHelper","type":"->"},{"file":"/srv/nextcloud/apps/activity/lib/FilesHooks.php","line":598,"function":"getPathsForAccessList","class":"OC\\Share20\\ShareHelper","type":"->"},{"file":"/srv/nextcloud/apps/activity/lib/FilesHooks.php","line":295,"function":"getUserPathsFromPath","class":"OCA\\Activity\\FilesHooks","type":"->"},{"file":"/srv/nextcloud/apps/activity/lib/FilesHooksStatic.php","line":67,"function":"fileMove","class":"OCA\\Activity\\FilesHooks","type":"->"},{"file":"/srv/nextcloud/lib/private/legacy/OC_Hook.php","line":105,"function":"fileMove","class":"OCA\\Activity\\FilesHooksStatic","type":"::"},{"file":"/srv/nextcloud/lib/private/Files/View.php","line":766,"function":"emit","class":"OC_Hook","type":"::"},{"file":"/srv/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php","line":454,"function":"rename","class":"OC\\Files\\View","type":"->"},{"file":"/srv/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php","line":178,"function":"moveInto","class":"OCA\\DAV\\Connector\\Sabre\\Directory","type":"->"},{"file":"/srv/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":612,"function":"move","class":"Sabre\\DAV\\Tree","type":"->"},{"file":"/srv/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpMove","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/srv/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/srv/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/srv/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/srv/nextcloud/apps/dav/lib/Server.php","line":382,"function":"exec","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/srv/nextcloud/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->"},{"file":"/srv/nextcloud/remote.php","line":172,"args":["/srv/nextcloud/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/srv/nextcloud/lib/private/Share20/ShareHelper.php","Line":97,"message":"Cannot access offset of type string on string","exception":[],"CustomMessage":"Cannot access offset of type string on string"},"id":"66aac981097b8"}

Additional info

After some debugging, it seem that the function function getAccessList in Manager.php call getPathsForUsers with a wrong $users.
When adding a line for print $users with json_encode in the log, it is shown as :

"{\"user1\":{\"node_id\":1093419,\"node_path\":\"\\/ourdirectory\"},\"0\":\"user1\",\"1\":\"user2\",\"2\":\"user3\",\"3\":\"user4\",\"4\":\"user5\",\"5\":\"user6\",\"6\":\"user7\"}",

Activity

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

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions