Skip to content

[Bug]: NC 26 - OCA\Text\Service\EncodingService::encodeToUtf8(): Argument #1 ($string) must be of type string, bool given #3980

@MikeDev101

Description

@MikeDev101

⚠️ 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 just finished upgrading my Nextcloud Proxmox container to NC 26. After fixing various PHP configuration settings and enabling system cron for the first time, I started getting errors while loading descriptions in the files app.
sample

Trying to load the README file using the built-in file reader keeps failing.

I tried to view/tinker with the PHP files to see what was going on, seems like I'm not getting anything proper out of the getContent() function.

code

I have no clue what I'm doing in PHP... I'm just a backend Python dev. Thought I would share this to see if it's me being a dummy or if something went wrong with NC 26.

Steps to reproduce

  1. Upgrade NC 25.0.4 to NC 26.0.0.
  2. Access the Files app.
  3. Try to access *.md files.

Expected behavior

The file description should appear in the top menu, and the file should be rendered in the editor when opened manually.

Installation method

Other Community project

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?

Updated to a major version (ex. 22.2.3 to 23.0.1)

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": {
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "localhost",
            "(REDACTED - PUBLIC HOSTNAME)",
            "(REDACTED - LAN IP)"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "26.0.0.11",
        "overwrite.cli.url": "http:\/\/localhost",
        "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***",
        "memcache.local": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 6379,
            "timeout": 0
        },
        "filelocking.enabled": true,
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "maintenance": false,
        "theme": "",
        "loglevel": 2,
        "app_install_overwrite": [
            "occweb",
            "impersonate",
            "group_default_quota",
            "duplicatefinder",
            "richdocumentscode",
            "quota_warning",
            "uppush",
            "sharerenamer"
        ],
        "default_phone_region": "US",
        "mail_smtpmode": "smtp",
        "mail_smtpsecure": "tls",
        "mail_sendmailmode": "smtp",
        "mail_smtpauth": 1,
        "mail_smtpauthtype": "LOGIN",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "587",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "mail_smtptimeout": 60,
        "updater.secret": "***REMOVED SENSITIVE VALUE***",
        "allow_local_remote_servers": true
    }
}

List of activated Apps

Enabled:
  - activity: 2.18.0
  - admin_audit: 1.16.0
  - circles: 26.0.0
  - cloud_federation_api: 1.9.0
  - comments: 1.16.0
  - contacts: 5.2.0
  - contactsinteraction: 1.7.0
  - dashboard: 7.6.0
  - data_request: 1.13.0
  - dav: 1.25.0
  - deck: 1.9.0
  - federatedfilesharing: 1.16.0
  - federation: 1.16.0
  - files: 1.21.1
  - files_external: 1.18.0
  - files_pdfviewer: 2.7.0
  - files_rightclick: 1.5.0
  - files_sharing: 1.18.0
  - files_trashbin: 1.16.0
  - files_versions: 1.19.1
  - fileslibreofficeedit: 1.1.0
  - firstrunwizard: 2.15.0
  - forms: 3.2.0
  - impersonate: 1.13.0
  - integration_github: 2.0.1
  - integration_google: 1.0.9
  - integration_onedrive: 1.1.4
  - logreader: 2.11.0
  - lookup_server_connector: 1.14.0
  - mail: 3.0.0
  - nextcloud_announcements: 1.15.0
  - notes: 4.7.2
  - notifications: 2.14.0
  - oauth2: 1.14.0
  - occweb: 0.1.0
  - password_policy: 1.16.0
  - passwords: 2023.3.21
  - privacy: 1.10.0
  - provisioning_api: 1.16.0
  - quota_warning: 1.15.0
  - recommendations: 1.5.0
  - registration: 2.1.0
  - related_resources: 1.1.0-alpha1
  - secrets: 1.4.0
  - serverinfo: 1.16.0
  - settings: 1.8.0
  - sharebymail: 1.16.0
  - sharerenamer: 3.1.0
  - spreed: 16.0.0
  - support: 1.9.0
  - suspicious_login: 4.4.0
  - systemtags: 1.16.0
  - text: 3.7.2
  - theming: 2.1.1
  - twofactor_admin: 4.1.9
  - twofactor_backupcodes: 1.15.0
  - twofactor_email: 2.7.2
  - twofactor_nextcloud_notification: 3.6.0
  - twofactor_reminder: 1.0.0
  - twofactor_totp: 8.0.0-alpha.0
  - twofactor_webauthn: 1.1.2
  - updatenotification: 1.16.0
  - uppush: 1.2.0
  - user_status: 1.6.0
  - viewer: 1.10.0
  - workflowengine: 2.8.0
Disabled:
  - bruteforcesettings: 2.6.0
  - encryption: 2.14.0
  - onlyoffice: 7.8.0 (installed 7.8.0)
  - photos: 2.2.0 (installed 2.0.1)
  - richdocuments: 8.0.0 (installed 8.0.0)
  - richdocumentscode: 22.5.802 (installed 22.5.802)
  - survey_client: 1.14.0 (installed 1.13.0)
  - user_ldap: 1.16.0
  - weather_status: 1.6.0 (installed 1.5.0)

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

{"reqId":"79kCTxFSKYVPbvtaKZT2","level":3,"time":"2023-03-23T01:45:19+00:00","remoteAddr":"172.70.174.27","user":"mikedev","app":"index","method":"PUT","url":"/index.php/apps/text/session/create","message":"OCA\\Text\\Service\\EncodingService::encodeToUtf8(): Argument nextcloud/server#1 ($string) must be of type string, bool given, called in /var/www/nextcloud/apps/text/lib/Service/ApiService.php on line 279 in file '/var/www/nextcloud/apps/text/lib/Service/EncodingService.php' line 39","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0","version":"26.0.0.11","exception":{"Exception":"Exception","Message":"OCA\\Text\\Service\\EncodingService::encodeToUtf8(): Argument nextcloud/server#1 ($string) must be of type string, bool given, called in /var/www/nextcloud/apps/text/lib/Service/ApiService.php on line 279 in file '/var/www/nextcloud/apps/text/lib/Service/EncodingService.php' line 39","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":183,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud/lib/base.php","line":1055,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/index.php","line":36,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","Line":169,"Previous":{"Exception":"TypeError","Message":"OCA\\Text\\Service\\EncodingService::encodeToUtf8(): Argument nextcloud/server#1 ($string) must be of type string, bool given, called in /var/www/nextcloud/apps/text/lib/Service/ApiService.php on line 279","Code":0,"Trace":[{"file":"/var/www/nextcloud/apps/text/lib/Service/ApiService.php","line":279,"function":"encodeToUtf8","class":"OCA\\Text\\Service\\EncodingService","type":"->"},{"file":"/var/www/nextcloud/apps/text/lib/Service/ApiService.php","line":148,"function":"loadContent","class":"OCA\\Text\\Service\\ApiService","type":"->"},{"file":"/var/www/nextcloud/apps/text/lib/Controller/SessionController.php","line":57,"function":"create","class":"OCA\\Text\\Service\\ApiService","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":230,"function":"create","class":"OCA\\Text\\Controller\\SessionController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":137,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":183,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud/lib/base.php","line":1055,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/index.php","line":36,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/apps/text/lib/Service/EncodingService.php","Line":39},"CustomMessage":"--"},"id":"641bb25cb3353"}

Additional info

Software used to create my NC instance:
Turnkey Nextcloud Container - First used with NC 25.0.3.
The server is running on top of Proxmox VE.

Proxmox VE v7.3-6.
Host CPU: E3-1275v2 (8 vCores and max shares allocated for container)
RAM: 16GB (2GB Allocated for the container)
Storage: 256GB allocated for container

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions