Skip to content

[Bug]: strpos() and/or pathinfo(): Passing null to parameter #1 ($haystack) of type string is deprecated #34932

Closed

Description

@killerb77

⚠️ This issue respects the following points: ⚠️

  • This is a bug, not a question or a configuration/webserver/proxy issue.
  • This issue is not already reported on Github (I've searched it).
  • Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
  • Nextcloud Server is running on 64bit capable CPU, PHP and OS.
  • I agree to follow Nextcloud's Code of Conduct.

Bug description

I am using the official docker image nextcloud 25. I am getting all kinds of error PHP messages regarding of type string is deprecated at. It's happening on file uploads, when nextcloud sends email notifications as well. I think it's related to the new version 25 using PHP 8.1. It started happening for version 25. Didn't happen on version 24 which uses PHP 8.0.

198488279-52dbfcb6-429e-45a0-b0b0-d4c941842b21

Steps to reproduce

1.Send a test email notification.
2.Or upload a file.
3.Then check the logs to see the error messages.

Expected behavior

Should not be getting these error messages.

Installation method

Community Docker image

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.1

Web server

Apache (supported)

Database engine version

MariaDB

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

Fresh Nextcloud Server install

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

What user-backends are you using?

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

Configuration report

{
    "system": {
        "htaccess.RewriteBase": "\/",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "apps_paths": [
            {
                "path": "\/var\/www\/html\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/www\/html\/custom_apps",
                "url": "\/custom_apps",
                "writable": true
            }
        ],
        "overwriteprotocol": "https",
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "***REMOVED SENSITIVE VALUE***",
            "***REMOVED SENSITIVE VALUE***"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "25.0.0.18",
        "overwrite.cli.url": "https:\/\/***REMOVED SENSITIVE VALUE***",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "maintenance": false,
        "theme": "",
        "loglevel": 2,
        "default_phone_region": "US",
        "defaultapp": "files",
        "mail_smtpmode": "smtp",
        "mail_smtpsecure": "tls",
        "mail_sendmailmode": "smtp",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauth": 1,
        "mail_smtpauthtype": "LOGIN",
        "mail_smtpport": "587",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***"
    }
}

List of activated Apps

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

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

[PHP] Error: Error: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated at /var/www/html/lib/private/Files/Cache/Scanner.php#508 at <<closure>>

 0. <<closure>>
    OC\Log\ErrorHandler::onError(8192, "strpos(): Passi ... d", "/var/www/html/l ... p", 508)
 1. /var/www/html/lib/private/Files/Cache/Scanner.php line 508
    strpos(null, ".part/")
 2. /var/www/html/lib/private/Files/View.php line 1384
    OC\Files\Cache\Scanner::isPartialFile(null)
 3. /var/www/html/lib/private/Files/Node/HookConnector.php line 227
    OC\Files\View->getFileInfo(null)
 4. /var/www/html/lib/private/Files/Node/HookConnector.php line 113
    OC\Files\Node\HookConnector->getNodeForPath(null)
 5. /var/www/html/lib/private/legacy/OC_Hook.php line 106
    OC\Files\Node\HookConnector->postWrite([null])
 6. /var/www/html/apps/dav/lib/Connector/Sabre/File.php line 471
    OC_Hook::emit("OC_Filesystem", "post_write", [null])
 7. /var/www/html/apps/dav/lib/Connector/Sabre/File.php line 398
    OCA\DAV\Connector\Sabre\File->emitPostHooks(false)
 8. /var/www/html/apps/dav/lib/Connector/Sabre/Directory.php line 151
    OCA\DAV\Connector\Sabre\File->put(null)
 9. /var/www/html/apps/dav/lib/Upload/UploadFolder.php line 45
    OCA\DAV\Connector\Sabre\Directory->createFile("10485760", null)
10. /var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php line 1098
    OCA\DAV\Upload\UploadFolder->createFile("10485760", null)
11. /var/www/html/3rdparty/sabre/dav/lib/DAV/CorePlugin.php line 504
    Sabre\DAV\Server->createFile("uploads/bmw/web ... 0", null, null)
12. /var/www/html/3rdparty/sabre/event/lib/WildcardEmitterTrait.php line 89
    Sabre\DAV\CorePlugin->httpPut(Sabre\HTTP\Request {}, Sabre\HTTP\Response {})
13. /var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php line 472
    Sabre\DAV\Server->emit("method:PUT", [Sabre\HTTP\Requ ... }])
14. /var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php line 253
    Sabre\DAV\Server->invokeMethod(Sabre\HTTP\Request {}, Sabre\HTTP\Response {})
15. /var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php line 321
    Sabre\DAV\Server->start()
16. /var/www/html/apps/dav/lib/Server.php line 360
    Sabre\DAV\Server->exec()
17. /var/www/html/apps/dav/appinfo/v2/remote.php line 35
    OCA\DAV\Server->exec()
18. /var/www/html/remote.php line 167
    require_once("/var/www/html/a ... p")

Additional info

No response

Activity

  1. added
    0. Needs triagePending check for reproducibility or if it fits our roadmap
    on Nov 2, 2022
  2. szaimen commented on Nov 3, 2022

    @szaimen
    Contributor

    cc @come-nc @nextcloud/server-backend

  3. changed the title [-][Bug]: Error of type string is deprecated at - NC25[/-] [+][Bug]: Passing null to string type is deprecated at - NC25[/+] on Nov 3, 2022
  4. come-nc commented on Nov 3, 2022

    @come-nc
    Contributor

    Hello,

    Yes, this warning is new to PHP 8.1 but should still not happen.
    The error comes from some code calling isPartialFile with null instead of a string, can you get the trace for one of these errors?

    [EDIT] My bad, the trace is at the end of the report, let me read that

  5. come-nc commented on Nov 3, 2022

    @come-nc
    Contributor

    So, looking at the trace:

    1. OCA\DAV\Connector\Sabre\Directory->createFile("10485760", null) is called which attempts to create a file
    2. put(null) is called on the node instance just created
    3. That calls emitPostHooks(false), and for some reason the instance cannot figure out its path, and triggers a post hook with null as the path
    4. The listeners are not expecting null there and are triggerring errors.

    I do not know if it is expected or not for the file instance there to have null in path property. I suspect it should not have null, or should not trigger hooks on the null path.

  6. killerb77 commented on Nov 8, 2022

    @killerb77
    Author

    It's definitely a PHP 8.1 issue. I built the docker container using php:8.0-apache-bullseye instead of the default php:8.1-apache-bullseye.

    Everything works as it should without any of the error messages in the logs now, using PHP 8.0

    Screenshot 2022-11-07 192950

  7. come-nc commented on Nov 8, 2022

    @come-nc
    Contributor

    The fact you see no error in PHP<8.1 does not mean there is no problem. Having this event fired with null path may have unexpected results in corner cases if it was not designed that way. We need to figure out if this is expected or not and fix either the listeners or the event.

  8. PVince81 commented on Nov 17, 2022

    @PVince81
    Member

    the stack trace looks like a chunked upload

  9. added
    1. to developAccepted and waiting to be taken care of
    and removed
    0. Needs triagePending check for reproducibility or if it fits our roadmap
    on Nov 17, 2022
  10. added this to the Nextcloud 26 milestone on Nov 17, 2022
  11. solracsf commented on Nov 24, 2022

    @solracsf
    Member

    Let me add 2 stack traces here if it helps.
    @PVince81 in both cases, these seem to be uploads, and in both, $file is null.

    {
      "reqId": "7wajzDcxJ6mT7A0evgD3",
      "level": 3,
      "time": "2022-11-17T17:59:51+01:00",
      "app": "PHP",
      "method": "PUT",
      "url": "/remote.php/dav/uploads/jdajczgewand/web-file-upload-ac3bf0a766fb24b20f008899777052a2-1668703328327/31457280",
      "message": "strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated at /var/www/nextcloud/lib/private/Files/Cache/Scanner.php#502",
      "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36",
      "version": "24.0.7.1",
      "exception": {
        "Exception": "Error",
        "Message": "strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated at /var/www/nextcloud/lib/private/Files/Cache/Scanner.php#502",
        "Code": 0,
        "Trace": [
          {
            "function": "onError",
            "class": "OC\\Log\\ErrorHandler",
            "type": "::",
            "args": [
              8192,
              "strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated",
              "/var/www/nextcloud/lib/private/Files/Cache/Scanner.php",
              502
            ]
          },
          {
            "file": "/var/www/nextcloud/lib/private/Files/Cache/Scanner.php",
            "line": 502,
            "function": "strpos",
            "args": [
              null,
              ".part/"
            ]
          },
          {
            "file": "/var/www/nextcloud/lib/private/Files/View.php",
            "line": 1390,
            "function": "isPartialFile",
            "class": "OC\\Files\\Cache\\Scanner",
            "type": "::",
            "args": [
              null
            ]
          },
          {
            "file": "/var/www/nextcloud/lib/private/Files/Node/HookConnector.php",
            "line": 227,
            "function": "getFileInfo",
            "class": "OC\\Files\\View",
            "type": "->",
            "args": [
              null
            ]
          },
          {
            "file": "/var/www/nextcloud/lib/private/Files/Node/HookConnector.php",
            "line": 113,
            "function": "getNodeForPath",
            "class": "OC\\Files\\Node\\HookConnector",
            "type": "->",
            "args": [
              null
            ]
          },
          {
            "file": "/var/www/nextcloud/lib/private/legacy/OC_Hook.php",
            "line": 106,
            "function": "postWrite",
            "class": "OC\\Files\\Node\\HookConnector",
            "type": "->",
            "args": [
              [
                null
              ]
            ]
          },
          {
            "file": "/var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php",
            "line": 472,
            "function": "emit",
            "class": "OC_Hook",
            "type": "::",
            "args": [
              "OC_Filesystem",
              "post_write",
              [
                null
              ]
            ]
          },
          {
            "file": "/var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php",
            "line": 399,
            "function": "emitPostHooks",
            "class": "OCA\\DAV\\Connector\\Sabre\\File",
            "type": "->",
            "args": [
              false
            ]
          },
          {
            "file": "/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php",
            "line": 164,
            "function": "put",
            "class": "OCA\\DAV\\Connector\\Sabre\\File",
            "type": "->",
            "args": [
              null
            ]
          },
          {
            "file": "/var/www/nextcloud/apps/dav/lib/Upload/UploadFolder.php",
            "line": 45,
            "function": "createFile",
            "class": "OCA\\DAV\\Connector\\Sabre\\Directory",
            "type": "->",
            "args": [
              "31457280",
              null
            ]
          },
          {
            "file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
            "line": 1098,
            "function": "createFile",
            "class": "OCA\\DAV\\Upload\\UploadFolder",
            "type": "->",
            "args": [
              "31457280",
              null
            ]
          },
          {
            "file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php",
            "line": 504,
            "function": "createFile",
            "class": "Sabre\\DAV\\Server",
            "type": "->",
            "args": [
              "uploads/jdajczgewand/web-file-upload-ac3bf0a766fb24b20f008899777052a2-1668703328327/31457280",
              null,
              null
            ]
          },
          {
            "file": "/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php",
            "line": 89,
            "function": "httpPut",
            "class": "Sabre\\DAV\\CorePlugin",
            "type": "->",
            "args": [
              {
                "__class__": "Sabre\\HTTP\\Request"
              },
              {
                "__class__": "Sabre\\HTTP\\Response"
              }
            ]
          },
          {
            "file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
            "line": 472,
            "function": "emit",
            "class": "Sabre\\DAV\\Server",
            "type": "->",
            "args": [
              "method:PUT",
              [
                {
                  "__class__": "Sabre\\HTTP\\Request"
                },
                {
                  "__class__": "Sabre\\HTTP\\Response"
                }
              ]
            ]
          },
          {
            "file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
            "line": 253,
            "function": "invokeMethod",
            "class": "Sabre\\DAV\\Server",
            "type": "->",
            "args": [
              {
                "__class__": "Sabre\\HTTP\\Request"
              },
              {
                "__class__": "Sabre\\HTTP\\Response"
              }
            ]
          },
          {
            "file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
            "line": 321,
            "function": "start",
            "class": "Sabre\\DAV\\Server",
            "type": "->",
            "args": []
          },
          {
            "file": "/var/www/nextcloud/apps/dav/lib/Server.php",
            "line": 358,
            "function": "exec",
            "class": "Sabre\\DAV\\Server",
            "type": "->",
            "args": []
          },
          {
            "file": "/var/www/nextcloud/apps/dav/appinfo/v2/remote.php",
            "line": 35,
            "function": "exec",
            "class": "OCA\\DAV\\Server",
            "type": "->",
            "args": []
          },
          {
            "file": "/var/www/nextcloud/remote.php",
            "line": 170,
            "args": [
              "/var/www/nextcloud/apps/dav/appinfo/v2/remote.php"
            ],
            "function": "require_once"
          }
        ],
        "File": "/var/www/nextcloud/lib/private/Log/ErrorHandler.php",
        "Line": 92,
        "CustomMessage": "--"
      }
    }
    
    {
      "reqId": "7wajzDcxJ6mT7A0evgD3",
      "level": 3,
      "time": "2022-11-17T17:59:51+01:00",
      "app": "PHP",
      "method": "PUT",
      "url": "/remote.php/dav/uploads/jdajczgewand/web-file-upload-ac3bf0a766fb24b20f008899777052a2-1668703328327/31457280",
      "message": "strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated at /var/www/nextcloud/lib/private/Files/Cache/Scanner.php#502",
      "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36",
      "version": "24.0.7.1",
      "exception": {
        "Exception": "Error",
        "Message": "strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated at /var/www/nextcloud/lib/private/Files/Cache/Scanner.php#502",
        "Code": 0,
        "Trace": [
          {
            "function": "onError",
            "class": "OC\\Log\\ErrorHandler",
            "type": "::",
            "args": [
              8192,
              "strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated",
              "/var/www/nextcloud/lib/private/Files/Cache/Scanner.php",
              502
            ]
          },
          {
            "file": "/var/www/nextcloud/lib/private/Files/Cache/Scanner.php",
            "line": 502,
            "function": "strpos",
            "args": [
              null,
              ".part/"
            ]
          },
          {
            "file": "/var/www/nextcloud/lib/private/Files/View.php",
            "line": 1390,
            "function": "isPartialFile",
            "class": "OC\\Files\\Cache\\Scanner",
            "type": "::",
            "args": [
              null
            ]
          },
          {
            "file": "/var/www/nextcloud/lib/private/Files/Node/HookConnector.php",
            "line": 227,
            "function": "getFileInfo",
            "class": "OC\\Files\\View",
            "type": "->",
            "args": [
              null
            ]
          },
          {
            "file": "/var/www/nextcloud/lib/private/Files/Node/HookConnector.php",
            "line": 113,
            "function": "getNodeForPath",
            "class": "OC\\Files\\Node\\HookConnector",
            "type": "->",
            "args": [
              null
            ]
          },
          {
            "file": "/var/www/nextcloud/lib/private/legacy/OC_Hook.php",
            "line": 106,
            "function": "postWrite",
            "class": "OC\\Files\\Node\\HookConnector",
            "type": "->",
            "args": [
              [
                null
              ]
            ]
          },
          {
            "file": "/var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php",
            "line": 472,
            "function": "emit",
            "class": "OC_Hook",
            "type": "::",
            "args": [
              "OC_Filesystem",
              "post_write",
              [
                null
              ]
            ]
          },
          {
            "file": "/var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php",
            "line": 399,
            "function": "emitPostHooks",
            "class": "OCA\\DAV\\Connector\\Sabre\\File",
            "type": "->",
            "args": [
              false
            ]
          },
          {
            "file": "/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php",
            "line": 164,
            "function": "put",
            "class": "OCA\\DAV\\Connector\\Sabre\\File",
            "type": "->",
            "args": [
              null
            ]
          },
          {
            "file": "/var/www/nextcloud/apps/dav/lib/Upload/UploadFolder.php",
            "line": 45,
            "function": "createFile",
            "class": "OCA\\DAV\\Connector\\Sabre\\Directory",
            "type": "->",
            "args": [
              "31457280",
              null
            ]
          },
          {
            "file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
            "line": 1098,
            "function": "createFile",
            "class": "OCA\\DAV\\Upload\\UploadFolder",
            "type": "->",
            "args": [
              "31457280",
              null
            ]
          },
          {
            "file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php",
            "line": 504,
            "function": "createFile",
            "class": "Sabre\\DAV\\Server",
            "type": "->",
            "args": [
              "uploads/jdajczgewand/web-file-upload-ac3bf0a766fb24b20f008899777052a2-1668703328327/31457280",
              null,
              null
            ]
          },
          {
            "file": "/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php",
            "line": 89,
            "function": "httpPut",
            "class": "Sabre\\DAV\\CorePlugin",
            "type": "->",
            "args": [
              {
                "__class__": "Sabre\\HTTP\\Request"
              },
              {
                "__class__": "Sabre\\HTTP\\Response"
              }
            ]
          },
          {
            "file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
            "line": 472,
            "function": "emit",
            "class": "Sabre\\DAV\\Server",
            "type": "->",
            "args": [
              "method:PUT",
              [
                {
                  "__class__": "Sabre\\HTTP\\Request"
                },
                {
                  "__class__": "Sabre\\HTTP\\Response"
                }
              ]
            ]
          },
          {
            "file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
            "line": 253,
            "function": "invokeMethod",
            "class": "Sabre\\DAV\\Server",
            "type": "->",
            "args": [
              {
                "__class__": "Sabre\\HTTP\\Request"
              },
              {
                "__class__": "Sabre\\HTTP\\Response"
              }
            ]
          },
          {
            "file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php",
            "line": 321,
            "function": "start",
            "class": "Sabre\\DAV\\Server",
            "type": "->",
            "args": []
          },
          {
            "file": "/var/www/nextcloud/apps/dav/lib/Server.php",
            "line": 358,
            "function": "exec",
            "class": "Sabre\\DAV\\Server",
            "type": "->",
            "args": []
          },
          {
            "file": "/var/www/nextcloud/apps/dav/appinfo/v2/remote.php",
            "line": 35,
            "function": "exec",
            "class": "OCA\\DAV\\Server",
            "type": "->",
            "args": []
          },
          {
            "file": "/var/www/nextcloud/remote.php",
            "line": 170,
            "args": [
              "/var/www/nextcloud/apps/dav/appinfo/v2/remote.php"
            ],
            "function": "require_once"
          }
        ],
        "File": "/var/www/nextcloud/lib/private/Log/ErrorHandler.php",
        "Line": 92,
        "CustomMessage": "--"
      }
    }
    
  12. 12 remaining items

  13. killerb77 commented on Dec 8, 2022

    @killerb77
    Author

    @come-nc "bmw" is a Nextcloud user id. Yes, it's the user that is uploading the file. "bmw" is also a user on the server. Also, since Nextcloud is running in docker, I have my docker compose file and static files in user bmw home directory. home/bmw/nextcloud25.

    No, I am not uploading into a shared folder.

  14. killerb77 commented on Dec 25, 2022

    @killerb77
    Author

    @come-nc Any updates on this?

  15. come-nc commented on Jan 2, 2023

    @come-nc
    Contributor

    I am able to reproduce this.

    It’s when chunk uploading a big file I think, the file is in uploads folder, and it tries to trigger hook on this path, which fails because it’s not relative to files/ folder.
    We should either disable hooks on this uploads folder, or fix them to handle paths outside of files.

  16. solracsf commented on Jan 2, 2023

    @solracsf
    Member

    What do you call big files? On my side files not bigger than 10Mb triggers this. Sometimes. Sometimes don't...

  17. changed the title [-][Bug]: Passing null to string type is deprecated at - NC25[/-] [+][Bug]: `strpos()` and/or `pathinfo()`: Passing null to parameter #1 ($haystack) of type string is deprecated[/+] on Jan 2, 2023
  18. come-nc commented on Jan 3, 2023

    @come-nc
    Contributor

    I meant any file that is uploaded by chunks, but maybe any file goes through the uploads folder, not sure.

  19. tram98 commented on Feb 19, 2023

    @tram98

    I am also having this issue. I am on the latest version.

  20. yehiashouman commented on Feb 22, 2023

    @yehiashouman

    Using nextcloud:fpm official docker image (25.0.1). I am getting the same error in log.
    I believe it is related to chunk uploads (Files larger than 10MB).

    I tried modifying /var/www/html/lib/private/Files/Cache/Scanner.php (line 508)
    to cast the $file as empty string than null but then got more errors in
    substr(): Passing null to parameter #1 ($string) of type string is deprecated at /var/www/html/lib/private/Files/View.php#1149"

    Reverted back to original code, then tried per documentation setting max chunk size to 0 from within container as www-data

    php occ config:app:set files max_chunk_size --value 0

    that didn't work too.

    Has anyone figured out a solution for this?

  21. yehiashouman commented on Feb 22, 2023

    @yehiashouman

    upgrading docker image (pulling, removing old image, building, starting) to latest (25.0.3) didn't fix it.

  22. dinosmm commented on Mar 17, 2023

    @dinosmm

    I keep getting this error when uploading folders with more than a few files in them. It results in one or two files not uploading, which is hugely time-consuming as I need to go and find which folders have files missing afterwards.

    {"Exception":"Error","Message":"strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated at /var/www/nextcloud/lib/private/Files/Cache/Scanner.php#508","Code":0,"Trace":[{"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Scanner.php","line":508,"function":"strpos"},{"file":"/var/www/nextcloud/lib/private/Files/View.php","line":1384,"function":"isPartialFile","class":"OC\\Files\\Cache\\Scanner","type":"::"},{"file":"/var/www/nextcloud/lib/private/Files/Node/HookConnector.php","line":227,"function":"getFileInfo","class":"OC\\Files\\View","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Node/HookConnector.php","line":113,"function":"getNodeForPath","class":"OC\\Files\\Node\\HookConnector","type":"->"},{"file":"/var/www/nextcloud/lib/private/legacy/OC_Hook.php","line":106,"function":"postWrite","class":"OC\\Files\\Node\\HookConnector","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php","line":471,"function":"emit","class":"OC_Hook","type":"::"},{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php","line":398,"function":"emitPostHooks","class":"OCA\\DAV\\Connector\\Sabre\\File","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php","line":151,"function":"put","class":"OCA\\DAV\\Connector\\Sabre\\File","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Upload/UploadFolder.php","line":45,"function":"createFile","class":"OCA\\DAV\\Connector\\Sabre\\Directory","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":1098,"function":"createFile","class":"OCA\\DAV\\Upload\\UploadFolder","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":504,"function":"createFile","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpPut","class":"Sabre\\DAV\\CorePlugin","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Server.php","line":360,"function":"exec","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/remote.php","line":171,"args":["/var/www/nextcloud/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/nextcloud/lib/private/Log/ErrorHandler.php","Line":92,"CustomMessage":"--"}}
    

    Is this the same error as the one described here?

  23. solracsf commented on Mar 17, 2023

    @solracsf
    Member

    There is an ongoing patch (WiP) so stay tuned and follow it (subscribe) if needed.
    #36893

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions