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]: OC\Memcache\Redis::DEFAULT_TTL must be public #48007

Closed
5 of 8 tasks
enaut opened this issue Sep 15, 2024 · 6 comments
Closed
5 of 8 tasks

[Bug]: OC\Memcache\Redis::DEFAULT_TTL must be public #48007

enaut opened this issue Sep 15, 2024 · 6 comments
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 30-feedback bug regression

Comments

@enaut
Copy link

enaut commented Sep 15, 2024

⚠️ This issue respects the following points: ⚠️

Bug description

When I enable redis caching the server stops working and throws 500 errors.

Steps to reproduce

  1. Uncomment the setting in config.php:
  'memcache.local' => '\\OC\\Memcache\\APCu',
  #'memcache.locking' => '\\OC\\Memcache\\Redis',  ← ## This one ##
  'redis' =>
  array (
    'host' => '/run/redis/redis.sock',
    'port' => 0,
  ),
  1. restart php-fpm with systemctl restart php-fpm
  2. In the webbrowser reload the page → All white and says error 500 in the request log.

Expected behavior

Well no error and loading the page fast (after warmup)

Nextcloud Server version

master

Operating system

Other

PHP engine version

PHP 8.3

Web server

Nginx

Database engine version

PostgreSQL

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

Upgraded to a MAJOR version (ex. 28 to 29)

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": {                                                                                                                                                                                                                               
        "instanceid": "***REMOVED SENSITIVE VALUE***",                                                                                                                                                                                        
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",                                                                                                                                                                                      
        "secret": "***REMOVED SENSITIVE VALUE***",                                                                                                                                                                                            
        "trusted_domains": [                                                                                                                                                                                                                  
            "my.domain.de"                                                                                                                                                                                                              
        ],                                                                                                                                                                                                                                    
        "datadirectory": "***REMOVED SENSITIVE VALUE***",                                                                                                                                                                                     
        "overwrite.cli.url": "https:\/\/my.domain.de",                                                                                                                                                                                  
        "dbtype": "pgsql",                                                                                                                                                                                                                    
        "version": "30.0.0.14",                                                                                                                                                                                                               
        "dbname": "***REMOVED SENSITIVE VALUE***",                                                                                                                                                                                            
        "dbhost": "***REMOVED SENSITIVE VALUE***",                                                                                                                                                                                            
        "dbtableprefix": "oc_",                                                                                                                                                                                                               
        "dbuser": "***REMOVED SENSITIVE VALUE***",                                                                                                                                                                                            
        "dbpassword": "***REMOVED SENSITIVE VALUE***",                                                                                                                                                                                        
        "logtimezone": "UTC",                                                                                                                                                                                                                 
        "installed": true,                                                                                                                                                                                                                    
        "appstore.experimental.enabled": true,                                                                                                                                                                                                
        "mail_smtpmode": "smtp",                                                                                                                                                                                                              
        "mail_smtpsecure": "ssl",                                                                                                                                                                                                             
        "mail_smtpauth": 1,                                                                                                                                                                                                                   
        "mail_smtpport": "465",                                                                                                                                                                                                               
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauthtype": "LOGIN",
        "mail_sendmailmode": "smtp",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "maintenance": false,
        "updater.release.channel": "stable",
        "log_type": "systemd",
        "syslog_tag": "Nextcloud",
        "loglevel": 2,
        "logfile": "",
        "log_type_audit": "systemd",
        "syslog_tag_audit": "Nextcloud-Audit",
        "logfile_audit": "",
        "logdateformat": "d. F Y H:i:s",
        "customclient_android": "https:\/\/f-droid.org\/repository\/browse\/?fdid=com.nextcloud.client",
        "app.mail.imaplog.enabled": true,
        "theme": "",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 0
        },
        "mysql.utf8mb4": true,
        "app_install_overwrite": [
            "mail",
            "onlyoffice",
            "deck",
            "news",
            "polls",
            "calendar",
            "files_markdown",
            "maps",
            "contacts",
            "spreed",
            "documentserver_community",
            "groupfolders",
            "circles",
            "richdocumentscode",
            "suspicious_login",
            "appointments",
            "issuetemplate",
            "bbb",
            "impersonate"
        ],
        "data-fingerprint": "bc67efc91548dde65549f2d69cc78629",
        "default_phone_region": "DE",
        "maintenance_window_start": 1
    }
}

List of activated Apps

Enabled:                                                                                                                                                                                                                                      
  - activity: 3.0.0                                                                                                                                                                                                                           
  - admin_audit: 1.20.0                                                                                                                                                                                                                       
  - appointments: 2.1.10                                                                                                                                                                                                                      
  - calendar: 5.0.0                                                                                                                                                                                                                           
  - calendar_resource_management: 0.8.0                                                                                                                                                                                                       
  - circles: 30.0.0-dev                                                                                                                                                                                                                       
  - cloud_federation_api: 1.13.0                                                                                                                                                                                                              
  - collectives: 2.14.3                                                                                                                                                                                                                       
  - comments: 1.20.1                                                                                                                                                                                                                          
  - contacts: 6.1.0                                                                                                                                                                                                                           
  - contactsinteraction: 1.11.0                                                                                                                                                                                                               
  - dashboard: 7.10.0                                                                                                                                                                                                                         
  - dav: 1.31.1                                                                                                                                                                                                                               
  - deck: 1.13.1                                                                                                                                                                                                                              
  - federatedfilesharing: 1.20.0                                                                                                                                                                                                              
  - federation: 1.20.0                                                                                                                                                                                                                        
  - files: 2.2.0                                                                                                                                                                                                                              
  - files_downloadlimit: 3.0.0                                                                                                                                                                                                                
  - files_pdfviewer: 3.0.0                                                                                                                                                                                                                    
  - files_reminders: 1.3.0                                                                                                                                                                                                                    
  - files_sharing: 1.22.0                                                                                                                                                                                                                     
  - files_trashbin: 1.20.1                                                                                                                                                                                                                    
  - files_versions: 1.23.0                                                                                                                                                                                                                    
  - impersonate: 1.17.0
  - issuetemplate: 0.7.0
  - lookup_server_connector: 1.18.0
  - mail: 4.0.0
  - maps: 1.4.0
  - news: 25.0.0-alpha8
  - nextcloud_announcements: 2.0.0
  - notifications: 3.0.0
  - oauth2: 1.18.1
  - password_policy: 2.0.0
  - photos: 3.0.2
  - polls: 7.2.3
  - privacy: 2.0.0
  - provisioning_api: 1.20.0
  - recommendations: 3.0.0
  - related_resources: 1.5.0
  - richdocuments: 8.5.0
  - richdocumentscode: 24.4.702
  - serverinfo: 2.0.0
  - settings: 1.13.0
  - sharebymail: 1.20.0
  - spreed: 20.0.0
  - survey_client: 2.0.0
  - suspicious_login: 8.0.0
  - systemtags: 1.20.0
  - tasks: 0.16.1
  - text: 4.1.0
  - theming: 2.5.0
  - twofactor_backupcodes: 1.19.0
  - updatenotification: 1.20.0
  - viewer: 3.0.0
  - webhook_listeners: 1.1.0-dev
  - workflowengine: 2.12.0
Disabled:
  - bbb: 2.6.0 (installed 2.6.0)
  - bruteforcesettings: 3.0.0 (installed 2.1.0)
  - encryption: 2.18.0 (installed 2.5.0)
  - event_update_notification: 2.4.0 (installed 2.4.0)
  - files_external: 1.22.0
  - files_rightclick: 0.15.1 (installed 1.6.0)
  - firstrunwizard: 3.0.0 (installed 2.15.0)
  - forms: 4.2.4 (installed 4.2.4)
  - holiday_calendars: 0.3.0 (installed 0.3.0)
  - logreader: 3.0.0 (installed 2.14.0)
  - phonetrack: 0.8.1 (installed 0.8.1)
  - support: 2.0.0 (installed 1.4.0)
  - theming_customcss: 1.17.0 (installed 1.17.0)
  - twofactor_nextcloud_notification: 4.0.0
  - twofactor_totp: 12.0.0-dev (installed 6.0.0)
  - user_ldap: 1.21.0
  - user_status: 1.10.0 (installed 1.1.1)
  - weather_status: 1.10.0 (installed 1.1.0)

Nextcloud Signing status

no errors have been found

Nextcloud Logs

none relevant

Additional info

This is actually Nextcloud 30 (but not selectable in the dropdown)

In the nginx error log there are errors like:

2024/09/15 11:49:23 [error] 4717#4717: *1517 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Access level to OC\Memcache\Redis::DEFAULT_TTL must be public (as in interface OCP\ICache) in /var/www/Nextcloud/lib/private/Memcache/Redis.php on line 34" while reading response header from upstream, client: [ipv4], server: nc.teilgedanken.de, request: "GET /index.php/apps/files/preview-service-worker.js HTTP/2.0", upstream: "fastcgi://unix:/run/php-fpm/www.sock:", host: "my.domain.de"
2024/09/15 11:49:27 [error] 4716#4716: *4594 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Access level to OC\Memcache\Redis::DEFAULT_TTL must be public (as in interface OCP\ICache) in /var/www/Nextcloud/lib/private/Memcache/Redis.php on line 34" while reading response header from upstream, client: [ipv6], server: nc.teilgedanken.de, request: "GET /apps/richdocuments/settings/fonts.json HTTP/1.1", upstream: "fastcgi://unix:/run/php-fpm/www.sock:", host: "my.domain.de"
@enaut enaut added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Sep 15, 2024
@enaut
Copy link
Author

enaut commented Sep 15, 2024

I tried a little... I added the line back that defined the DEFAULT_TTL, added it back as public, but nothing solved the error...
I don't know enough php to do more than fooling around. But if someone could guide me a little that I may be of help for testing.

@joshtrichards
Copy link
Member

Weird. This should have turned up in our automated testing pretty quickly. And no one else has reported it so far... I'd expect it to be one of the first things that would get reported.

That line number reference makes no sense to me, but it kinda sorta does if PHP is trying to use the v29 redis.conf.

Are you absolutely certain those files were updated properly and php-fpm really restarted? Does an occ integrity:check-core pass?

How did you deploy the update?

Oh, and exactly which full version of PHP 8.3?

@enaut
Copy link
Author

enaut commented Sep 16, 2024

Php

[root@vmd148615 Memcache]# php -v
PHP 8.3.11 (cli) (built: Aug 27 2024 19:16:34) (NTS gcc x86_64)
Copyright (c) The PHP Group
Zend Engine v4.3.11, Copyright (c) Zend Technologies
    with Zend OPcache v8.3.11, Copyright (c), by Zend Technologies

occ integrity:check-core did show that file because I messed with it - I now redownloaded that file from the v30 tag now it does pass without message again.

I upgraded with updater/updater.phar.

I don't see any redis.conf file except for in the circles app which I deactivated just to be sure.

I too wondered why no one else has that problem... however I restarted multiple times and thought that with a restart any cached whatever should be reset? Where could the old file linger?

@enaut
Copy link
Author

enaut commented Sep 16, 2024

I found the issue: my opcache was caching everything but I thought the opcache is reset on php_fpm restart?

@enaut enaut closed this as completed Sep 16, 2024
@joshtrichards
Copy link
Member

Perhaps you have opcache.file_cache enabled?

@enaut
Copy link
Author

enaut commented Sep 16, 2024

I just verified that file_cache is not enabled. What I changed back was:

; When disabled, you must reset the OPcache manually or restart the
; webserver for changes to the filesystem to take effect.
opcache.validate_timestamps=1   ; was 0 and probably the reason

; How often (in seconds) to check file timestamps for changes to the shared
; memory storage allocation. ("1" means validate once per second, but only
; once per request. "0" means always validate)
opcache.revalidate_freq=2   ; I had set it to 60

However as the validate_timestamps comment says explicitly that restarting the server helps I thought I'm safe by restarting nginx, php-fpm and redis, but even rebooting the server did not help... so the comment might be missleading or the issue was still something else... But thanks for helping anyways!

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 30-feedback bug regression
Projects
None yet
Development

No branches or pull requests

3 participants