Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: TypeError: substr(): Argument #1 ($string) must be of type string, bool given in nextcloud-29.0.7/lib/private/AppFramework/Http/Request.php:784 #48116

Open
5 of 8 tasks
adrhc opened this issue Sep 17, 2024 · 2 comments
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 29-feedback bug needs info

Comments

@adrhc
Copy link

adrhc commented Sep 17, 2024

⚠️ This issue respects the following points: ⚠️

Bug description

Errors are show as below:
php occ log:watch

substr(): Argument #1 ($string) must be of type string, bool given

php occ list (after the error it then prints the normal output)

substr(): Argument #1 ($string) must be of type string, bool given

php occ -vvv setupchecks (only prints the error)

substr(): Argument #1 ($string) must be of type string, bool given
An unhandled exception has been thrown:
TypeError: substr(): Argument #1 ($string) must be of type string, bool given in [...]/nextcloud-29.0.7/lib/private/AppFramework/Http/Request.php:784
Stack trace:
#0 [...]/nextcloud-29.0.7/lib/private/AppFramework/Http/Request.php(784): substr()
#1 [...]/nextcloud-29.0.7/apps/passwords/lib/Services/EnvironmentService.php(306): OC\AppFramework\Http\Request->getScriptName()
#2 [...]/nextcloud-29.0.7/apps/passwords/lib/Services/EnvironmentService.php(287): OCA\Passwords\Services\EnvironmentService->isCronJob()
#3 [...]/nextcloud-29.0.7/apps/passwords/lib/Services/EnvironmentService.php(184): OCA\Passwords\Services\EnvironmentService->determineRunType()
#4 [internal function]: OCA\Passwords\Services\EnvironmentService->__construct()
#5 [...]/nextcloud-29.0.7/lib/private/AppFramework/Utility/SimpleContainer.php(83): ReflectionClass->newInstanceArgs()
#6 [...]/nextcloud-29.0.7/lib/private/AppFramework/Utility/SimpleContainer.php(128): OC\AppFramework\Utility\SimpleContainer->buildClass()
#7 [...]/nextcloud-29.0.7/lib/private/AppFramework/Utility/SimpleContainer.php(146): OC\AppFramework\Utility\SimpleContainer->resolve()
#8 [...]/nextcloud-29.0.7/lib/private/AppFramework/DependencyInjection/DIContainer.php(471): OC\AppFramework\Utility\SimpleContainer->query()
#9 [...]/nextcloud-29.0.7/lib/private/AppFramework/DependencyInjection/DIContainer.php(443): OC\AppFramework\DependencyInjection\DIContainer->queryNoFallback()
#10 [...]/nextcloud-29.0.7/lib/private/AppFramework/Utility/SimpleContainer.php(96): OC\AppFramework\DependencyInjection\DIContainer->query()
#11 [internal function]: OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility{closure}()
#12 [...]/nextcloud-29.0.7/lib/private/AppFramework/Utility/SimpleContainer.php(83): array_map()
#13 [...]/nextcloud-29.0.7/lib/private/AppFramework/Utility/SimpleContainer.php(128): OC\AppFramework\Utility\SimpleContainer->buildClass()
#14 [...]/nextcloud-29.0.7/lib/private/AppFramework/Utility/SimpleContainer.php(146): OC\AppFramework\Utility\SimpleContainer->resolve()
#15 [...]/nextcloud-29.0.7/lib/private/AppFramework/DependencyInjection/DIContainer.php(471): OC\AppFramework\Utility\SimpleContainer->query()
#16 [...]/nextcloud-29.0.7/lib/private/AppFramework/DependencyInjection/DIContainer.php(443): OC\AppFramework\DependencyInjection\DIContainer->queryNoFallback()
#17 [...]/nextcloud-29.0.7/lib/private/AppFramework/Utility/SimpleContainer.php(96): OC\AppFramework\DependencyInjection\DIContainer->query()
#18 [internal function]: OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility{closure}()
#19 [...]/nextcloud-29.0.7/lib/private/AppFramework/Utility/SimpleContainer.php(83): array_map()
#20 [...]/nextcloud-29.0.7/lib/private/AppFramework/Utility/SimpleContainer.php(128): OC\AppFramework\Utility\SimpleContainer->buildClass()
#21 [...]/nextcloud-29.0.7/lib/private/AppFramework/Utility/SimpleContainer.php(146): OC\AppFramework\Utility\SimpleContainer->resolve()
#22 [...]/nextcloud-29.0.7/lib/private/AppFramework/DependencyInjection/DIContainer.php(471): OC\AppFramework\Utility\SimpleContainer->query()
#23 [...]/nextcloud-29.0.7/lib/private/ServerContainer.php(155): OC\AppFramework\DependencyInjection\DIContainer->queryNoFallback()
#24 [...]/nextcloud-29.0.7/lib/private/AppFramework/Utility/SimpleContainer.php(64): OC\ServerContainer->query()
#25 [...]/nextcloud-29.0.7/lib/public/Server.php(55): OC\AppFramework\Utility\SimpleContainer->get()
#26 [...]/nextcloud-29.0.7/lib/private/SetupCheck/SetupCheckManager.php(48): OCP\Server::get()
#27 [...]/nextcloud-29.0.7/core/Command/SetupChecks.php(72): OC\SetupCheck\SetupCheckManager->runAll()
#28 [...]/nextcloud-29.0.7/3rdparty/symfony/console/Command/Command.php(298): OC\Core\Command\SetupChecks->execute()
#29 [...]/nextcloud-29.0.7/core/Command/Base.php(177): Symfony\Component\Console\Command\Command->run()
#30 [...]/nextcloud-29.0.7/3rdparty/symfony/console/Application.php(1040): OC\Core\Command\Base->run()
#31 [...]/nextcloud-29.0.7/3rdparty/symfony/console/Application.php(301): Symfony\Component\Console\Application->doRunCommand()
#32 [...]/nextcloud-29.0.7/3rdparty/symfony/console/Application.php(171): Symfony\Component\Console\Application->doRun()
#33 [...]/nextcloud-29.0.7/lib/private/Console/Application.php(213): Symfony\Component\Console\Application->run()
#34 [...]/nextcloud-29.0.7/console.php(102): OC\Console\Application->run()
#35 [...]/nextcloud-29.0.7/occ(11): require_once('...')
#36 {main}

but no errors for e.g.:
php occ maintenance:repair --include-expensive -vvv

Steps to reproduce

  1. php occ -vvv setupchecks
  2. observe the error

Expected behavior

no error to be printed to console

Nextcloud Server version

29

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?

None

What user-backends are you using?

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

Configuration report

substr(): Argument #1 ($string) must be of type string, bool given
{
    "system": {
        "default_phone_region": "RO",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 6379
        },
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "adrhc.go.ro"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "logtimezone": "Europe\/Bucharest",
        "debug": false,
        "logfilemode": 432,
        "logfile": "\/home\/gigi\/apps\/log\/nextcloud.log",
        "loglevel": 2,
        "log_rotate_size": 10485760,
        "dbtype": "mysql",
        "version": "29.0.7.1",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "theme": "",
        "maintenance": false,
        "trashbin_retention_obligation": "auto",
        "overwriteprotocol": "https",
        "overwritehost": "adrhc.go.ro",
        "overwritewebroot": "\/nextcloud",
        "overwrite.cli.url": "https:\/\/gigihc.go.ro\/nextcloud",
        "preview_max_memory": 4096,
        "preview_max_filesize_image": 256,
        "preview_max_x": 4096,
        "preview_max_y": 4096,
        "preview_max_scale_factor": 5,
        "enabledPreviewProviders": [
            "OC\\Preview\\Illustrator",
            "OC\\Preview\\Movie",
            "OC\\Preview\\MSOffice2003",
            "OC\\Preview\\MSOffice2007",
            "OC\\Preview\\MSOfficeDoc",
            "OC\\Preview\\PDF",
            "OC\\Preview\\Photoshop",
            "OC\\Preview\\Postscript",
            "OC\\Preview\\StarOffice",
            "OC\\Preview\\SVG",
            "OC\\Preview\\TIFF",
            "OC\\Preview\\Font",
            "OC\\Preview\\PNG",
            "OC\\Preview\\JPEG",
            "OC\\Preview\\GIF",
            "OC\\Preview\\BMP",
            "OC\\Preview\\XBitmap",
            "OC\\Preview\\MP3",
            "OC\\Preview\\TXT",
            "OC\\Preview\\MarkDown",
            "OC\\Preview\\OpenDocument",
            "OC\\Preview\\Krita",
            "OC\\Preview\\Image",
            "OC\\Preview\\EMF"
        ],
        "defaultapp": "",
        "check_for_working_htaccess": false,
        "memories.exiftool": "\/home\/gigi\/apps\/opt\/php-pages\/nextcloud-29.0.6\/apps\/memories\/bin-ext\/exiftool-amd64-glibc",
        "memories.vod.path": "\/home\/gigi\/apps\/opt\/php-pages\/nextcloud-29.0.6\/apps\/memories\/bin-ext\/go-vod-amd64",
        "memories.vod.ffmpeg": "\/usr\/bin\/ffmpeg",
        "memories.vod.ffprobe": "\/usr\/bin\/ffprobe",
        "memories.db.triggers.fcu": true,
        "memories.vod.vaapi": true,
        "memories.gis_type": 1,
        "memories.index.path.blacklist": "\\\/@(Recycle|eaDir)|\\.trash\\\/",
        "jpeg_quality": 100
    }
}

List of activated Apps

substr(): Argument #1 ($string) must be of type string, bool given
Enabled:
  - activity: 2.21.1
  - camerarawpreviews: 0.8.5
  - circles: 29.0.0-dev
  - cloud_federation_api: 1.12.0
  - comments: 1.19.0
  - contactsinteraction: 1.10.0
  - dashboard: 7.9.0
  - dav: 1.30.1
  - federatedfilesharing: 1.19.0
  - federation: 1.19.0
  - files: 2.1.1
  - files_downloadlimit: 2.0.0
  - files_external: 1.21.0
  - files_pdfviewer: 2.10.0
  - files_reminders: 1.2.0
  - files_sharing: 1.21.0
  - files_trashbin: 1.19.0
  - files_versions: 1.22.0
  - firstrunwizard: 2.18.0
  - logreader: 2.14.0
  - lookup_server_connector: 1.17.0
  - memories: 7.3.1
  - nextcloud_announcements: 1.18.0
  - notes: 4.11.0
  - notifications: 2.17.0
  - oauth2: 1.17.1
  - password_policy: 1.19.0
  - passwords: 2024.9.20
  - photos: 2.5.0
  - previewgenerator: 5.6.0
  - privacy: 1.13.0
  - provisioning_api: 1.19.0
  - recognize: 7.1.0
  - recommendations: 2.1.0
  - related_resources: 1.4.0
  - serverinfo: 1.19.0
  - settings: 1.12.0
  - sharebymail: 1.19.0
  - spreed: 19.0.9
  - support: 1.12.0
  - survey_client: 1.17.0
  - systemtags: 1.19.0
  - text: 3.10.1
  - theming: 2.4.0
  - twofactor_backupcodes: 1.18.0
  - updatenotification: 1.19.1
  - user_status: 1.9.0
  - viewer: 2.3.0
  - weather_status: 1.9.0
  - workflowengine: 2.11.0
Disabled:
  - admin_audit: 1.19.0
  - bruteforcesettings: 2.9.0
  - encryption: 2.17.0
  - suspicious_login: 7.0.0 (installed 6.0.0)
  - twofactor_totp: 11.0.0-dev
  - user_ldap: 1.20.0

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

{"reqId":"IHJumMBkBvtEyo0UfhHJ","level":2,"time":"2024-09-17T08:43:20+03:00","remoteAddr":"","user":"--","app":"cron","method":"","url":"/nextcloud/cron.php","message":"Cron job used more than 300 MB of ram after executing job OCA\\Recognize\\BackgroundJobs\\ClusterFacesJob (id: 3484, arguments: {\"userId\":\"gigi1\"}): 1.2 GB (before: 57.4 MB)","userAgent":"--","version":"29.0.7.1","data":{"app":"cron"}}
{"reqId":"Ol0tAEDXhKuQOdgSvCdU","level":2,"time":"2024-09-17T09:07:28+03:00","remoteAddr":"","user":"--","app":"cron","method":"","url":"/nextcloud/cron.php","message":"Cron job used more than 300 MB of ram after executing job OCA\\Recognize\\BackgroundJobs\\ClusterFacesJob (id: 3486, arguments: {\"userId\":\"gigi2\"}): 1.2 GB (before: 25.9 MB)","userAgent":"--","version":"29.0.7.1","data":{"app":"cron"}}
{"reqId":"pJcBNQpHU0gl071TLNp9","level":2,"time":"2024-09-17T09:37:44+03:00","remoteAddr":"","user":"--","app":"cron","method":"","url":"/nextcloud/cron.php","message":"Cron job used more than 300 MB of ram after executing job OCA\\Recognize\\BackgroundJobs\\ClusterFacesJob (id: 3488, arguments: {\"userId\":\"gigi3\"}): 1.2 GB (before: 25.9 MB)","userAgent":"--","version":"29.0.7.1","data":{"app":"cron"}}

Additional info

My Nextcloud instance seems to work fine and no new logs are created when the occ commands report errors.

Nextcloud version: 29.0.7 - 29.0.7.1

@adrhc adrhc added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Sep 17, 2024
@adrhc
Copy link
Author

adrhc commented Sep 17, 2024

When I disable the Passwords application the errors are no longer present.

@joshtrichards
Copy link
Member

https://github.com/nextcloud/server/issues/1 [...]/nextcloud-29.0.7/apps/passwords/lib/Services/EnvironmentService.php(306): OC\AppFramework\Http\Request->getScriptName()
https://github.com/nextcloud/server/pull/2 [...]/nextcloud-29.0.7/apps/passwords/lib/Services/EnvironmentService.php(287): OCA\Passwords\Services\EnvironmentService->isCronJob()
https://github.com/nextcloud/server/pull/3 [...]/nextcloud-29.0.7/apps/passwords/lib/Services/EnvironmentService.php(184): OCA\Passwords\Services\EnvironmentService->determineRunType()
https://github.com/nextcloud/server/issues/4 [internal function]: OCA\Passwords\Services\EnvironmentService->__construct()

When I disable the Passwords application the errors are no longer present.

Stack trace suggests that. I didn't look too closely, but perhaps something to report to them then: https://github.com/marius-wieschollek/passwords/issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 29-feedback bug needs info
Projects
None yet
Development

No branches or pull requests

3 participants