Skip to content

[Bug]: Redis via unix socket spams log with deprecation warning #54813

@VolkerStolz

Description

@VolkerStolz

⚠️ This issue respects the following points: ⚠️

Bug description

I'm running Nextcloud with a unix domain socket to a Redis server.

The log is spammed around once per second with:

Debug PHP Redis::pconnect(): Passing null to parameter #2 ($port) of type int is deprecated at /var/www/html/lib/private/RedisFactory.php#104

I've successfully tweaked the following line to use -1 instead of null as recommended by PHPRedis, and i) the warnings go away and ii) my Redis connection still works ;-)

$port = $config['port'] ?? ($host[0] !== '/' ? 6379 : null);

Of course the alternative is to set the port to -1 in the configuration explicitly, but that seems like redundant effort and rather the default should be corrected.

Steps to reproduce

  1. Configure Redis via a unix socket
  2. Observe flood of Debug messages

Expected behavior

No spam in log.

Nextcloud Server version

31

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.3

Web server

Apache (supported)

Database engine version

PostgreSQL

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": "\/",
        "apps_paths": [
            {   
                "path": "\/var\/www\/html\/apps",
                "url": "\/apps",
                "writable": false
            },
            {   
                "path": "\/var\/www\/html\/custom_apps",
                "url": "\/custom_apps",
                "writable": true
            }
        ],
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "localhost",
            "***REMOVED SENSITIVE VALUE***"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "pgsql",
        "version": "31.0.7.1",
        "overwrite.cli.url": "http:\/\/localhost",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "overwriteprotocol": "https",
        "maintenance": false,
        "maintenance_window_start": 1,
        "app_install_overwrite": [
            "epubreader",
            "cookbook",
            "files_texteditor",
            "news"
        ],
        "loglevel": 0,
        "default_phone_region": "DE",
        "mail_smtpmode": "smtp",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_sendmailmode": "smtp",
        "mail_smtpport": "25",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "memories.exiftool": "\/var\/www\/html\/custom_apps\/memories\/bin-ext\/exiftool-amd64-glibc",
        "memories.vod.path": "\/var\/www\/html\/custom_apps\/memories\/bin-ext\/go-vod-amd64",
        "enabledPreviewProviders": [
            "OC\\Preview\\Image",
            "OC\\Preview\\HEIC",
            "OC\\Preview\\TIFF"
        ],
        "memories.gis_type": 2,
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "redis": {
            "host": "/var/run/redis-server.sock",
            "password": "***REMOVED SENSITIVE VALUE***"
        },
        "mail_smtpsecure": "",
        "mail_smtpauth": false,
        "mail_smtpauthtype": "PLAIN",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***"
    }
}

List of activated Apps

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

Additional info

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    1. to developAccepted and waiting to be taken care of31-feedbackbugfeature: cachingRelated to our caching system: scssCacher, jsCombiner...

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions