You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TypeError: str_starts_with(): Argument #1 ($haystack) must be of type string, int given in /var/www/nextcloud/lib/private/Files/Type/Detection.php:119
As soon as you remove the rows "0" through "9" it works fine.
Would be nice to view filenames that end in a number in the text viewer for browsing nginx logs for example.
Cheers~
Steps to reproduce
Add above codeblock to mimetypemapping.json
Reboot nextcloud
Try to browse an SMB share external storage (not sure if you get same error with local storage). Able to see the external storage in Home folder, but clicking the share shows 0 files in web UI. Still able to access files via share links, etc, so things appear to work fine outside of being able to list directory contents.
Expected behavior
Would like the ".0" file to open in text editor.
Installation method
Community Web installer on a VPS or web space
Nextcloud Server version
28
Operating system
Debian/Ubuntu
PHP engine version
PHP 8.1
Web server
Apache (supported)
Database engine version
MySQL
Is this bug present after an update or on a fresh install?
Fresh Nextcloud Server install
Are you using the Nextcloud Server Encryption module?
{"reqId":"ysWzWbl6FJXhZdDFC88w","level":3,"time":"2024-01-17T22:17:07+00:00","remoteAddr":"***REMOVED SENSITIVE VALUE***","user":"admin","app":"webdav","method":"PROPFIND","url":"/remote.php/dav/files/***REMOVED SENSITIVE VALUE***","message":"str_starts_with(): Argument #1 ($haystack) must be of type string, int given","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36","version":"28.0.1.1","exception":{"Exception":"TypeError","Message":"str_starts_with(): Argument #1 ($haystack) must be of type string, int given","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/Files/Type/Detection.php","line":119,"function":"str_starts_with"},{"file":"/var/www/nextcloud/lib/private/Files/Type/Detection.php","line":178,"function":"registerTypeArray","class":"OC\\Files\\Type\\Detection","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Type/Detection.php","line":196,"function":"loadMappings","class":"OC\\Files\\Type\\Detection","type":"->"},{"file":"/var/www/nextcloud/apps/files_external/lib/Lib/Storage/SMB.php","line":617,"function":"detectPath","class":"OC\\Files\\Type\\Detection","type":"->"},{"file":"/var/www/nextcloud/apps/files_external/lib/Lib/Storage/SMB.php","line":652,"function":"getMetaDataFromFileInfo","class":"OCA\\Files_External\\Lib\\Storage\\SMB","type":"->"},{"function":"getDirectoryContent","class":"OCA\\Files_External\\Lib\\Storage\\SMB","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Scanner.php","line":427,"function":"iterator_to_array"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Scanner.php","line":397,"function":"handleChildren","class":"OC\\Files\\Cache\\Scanner","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Scanner.php","line":347,"function":"scanChildren","class":"OC\\Files\\Cache\\Scanner","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/View.php","line":1335,"function":"scan","class":"OC\\Files\\Cache\\Scanner","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/View.php","line":1374,"function":"getCacheEntry","class":"OC\\Files\\View","type":"->"},{"file":"/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php","line":215,"function":"getFileInfo","class":"OC\\Files\\View","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php","line":83,"function":"getChild","class":"OCA\\DAV\\Connector\\Sabre\\Directory","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":971,"function":"getNodeForPath","class":"Sabre\\DAV\\Tree","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":1662,"function":"getPropertiesIteratorForPath","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":1647,"function":"writeMultiStatus","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":346,"function":"generateMultiStatus","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpPropFind","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":370,"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":172,"args":["/var/www/nextcloud/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/nextcloud/lib/private/Files/Type/Detection.php","Line":119,"message":"str_starts_with(): Argument #1 ($haystack) must be of type string, int given","exception":[],"CustomMessage":"str_starts_with(): Argument #1 ($haystack) must be of type string, int given"},"id":"65a8580aa7315"}
Error jsresourceloader
Could not find resource files_external/js/public_key.js to load
2024-01-17T22:17:20+00:00
Error jsresourceloader
Could not find resource files_external/js/oauth2.js to load
2024-01-17T22:17:20+00:00
Error jsresourceloader
Could not find resource files_external/js/oauth1.js to load
2024-01-17T22:17:20+00:00
Error webdav
TypeError
str_starts_with(): Argument #1 ($haystack) must be of type string, int given
2024-01-17T22:17:07+00:00
Error webdav
TypeError
str_starts_with(): Argument #1 ($haystack) must be of type string, int given
2024-01-17T22:16:59+00:00
Error webdav
TypeError
str_starts_with(): Argument #1 ($haystack) must be of type string, int given
2024-01-17T22:16:56+00:00
Error core
TypeError
str_starts_with(): Argument #1 ($haystack) must be of type string, int given
Error while running background job (class: OCA\Files\BackgroundJob\ScanFiles, arguments: )
2024-01-17T22:15:02+00:00
Error webdav
TypeError
str_starts_with(): Argument #1 ($haystack) must be of type string, int given
2024-01-17T22:08:09+00:00
Error core
TypeError
str_starts_with(): Argument #1 ($haystack) must be of type string, int given
Error while running background job (class: OCA\Files\BackgroundJob\ScanFiles, arguments: )
2024-01-17T22:00:02+00:00
Error webdav
TypeError
str_starts_with(): Argument #1 ($haystack) must be of type string, int given
2024-01-17T21:53:06+00:00
Error webdav
TypeError
str_starts_with(): Argument #1 ($haystack) must be of type string, int given
2024-01-17T21:52:56+00:00
Error cron
Exception
Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] No such file or directory
Exception thrown: Doctrine\DBAL\Exception
2024-01-17T21:52:35+00:00
Error core
Exception
Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] No such file or directory
Error while running background job (class: OC\Core\BackgroundJobs\GenerateMetadataJob, arguments: )
2024-01-17T21:52:35+00:00
Warning no app in context
DbalException
Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] No such file or directory
Error while generating metadata for fileid 1097678
2024-01-17T21:52:35+00:00
Warning no app in context
DbalException
Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] No such file or directory
exception whilegetMetadataFromDatabase()
2024-01-17T21:52:35+00:00
Additional info
No response
The text was updated successfully, but these errors were encountered:
PHP's json_decode() automatically converts those particular entries to integers internally when using them as keys for the target array (despite being quoted).
Unfortunately, since it happens internally (and when the keys are established), it's not a simple matter of casting ourselves before use. 🤔
Bug description
Setting mimetypemapping.json to the following:
breaks mime type loader with an error:
TypeError: str_starts_with(): Argument #1 ($haystack) must be of type string, int given in /var/www/nextcloud/lib/private/Files/Type/Detection.php:119
As soon as you remove the rows "0" through "9" it works fine.
Would be nice to view filenames that end in a number in the text viewer for browsing nginx logs for example.
Cheers~
Steps to reproduce
Expected behavior
Would like the ".0" file to open in text editor.
Installation method
Community Web installer on a VPS or web space
Nextcloud Server version
28
Operating system
Debian/Ubuntu
PHP engine version
PHP 8.1
Web server
Apache (supported)
Database engine version
MySQL
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?
Configuration report
List of activated Apps
Nextcloud Signing status
Nextcloud Logs
Additional info
No response
The text was updated successfully, but these errors were encountered: