Issue after upgrade Argument #3 ($logger) must be of type Psr\\Log\\LoggerInterface

Nextcloud version: 29.0.5/6

Operating system and version: Ubuntu 24.04

Apache or nginx version: Nginx version 1.26.2

PHP version: 8.3

Hello all,

I executed the update from 29.0.5 to 29.0.5 via built-in updater and it was successful, but when finally forwarded to the website and during further direct access the following message appear:

Internal Server Error

The server was unable to complete your request.

If this happens again, please send the technical details below to the server administrator.

More details can be found in the server log.

Technical details

  • Remote Address: xxx
  • Request ID: xxx

The nextcloud.log shows this:

{"reqId":"HUbo7WUFPAUszxHFfEEj","level":3,"time":"2024-09-06T08:11:13+02:00","remoteAddr":"2a02:8108:1600:6a00:a98a:7b8e:939:9f9b","user":"ChristianNC12","app":"index","method":"GET","url":"/","message":"OCA\\GroupFolders\\ACL\\ACLManager::__construct(): Argument #3 ($logger) must be of type Psr\\Log\\LoggerInterface, OC\\User\\User given, called in /home/xyz123/domains/cloud.xyz123.de/public_html/apps/groupfolders/lib/ACL/ACLManagerFactory.php on line 43","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:129.0) Gecko/20100101 Firefox/129.0","version":"29.0.5.1","exception":{"Exception":"TypeError","Message":"OCA\\GroupFolders\\ACL\\ACLManager::__construct(): Argument #3 ($logger) must be of type Psr\\Log\\LoggerInterface, OC\\User\\User given, called in /home/xyz123/domains/cloud.xyz123.de/public_html/apps/groupfolders/lib/ACL/ACLManagerFactory.php on line 43","Code":0,"Trace":[{"file":"/home/xyz123/domains/cloud.xyz123.de/public_html/apps/groupfolders/lib/ACL/ACLManagerFactory.php","line":43,"function":"__construct","class":"OCA\\GroupFolders\\ACL\\ACLManager","type":"->"},{"file":"/home/xyz123/domains/cloud.xyz123.de/public_html/apps/groupfolders/lib/Mount/MountProvider.php","line":140,"function":"getACLManager","class":"OCA\\GroupFolders\\ACL\\ACLManagerFactory","type":"->"},{"file":"/home/xyz123/domains/cloud.xyz123.de/public_html/lib/private/Files/Config/MountProviderCollection.php","line":89,"function":"getMountsForUser","class":"OCA\\GroupFolders\\Mount\\MountProvider","type":"->"},{"file":"/home/xyz123/domains/cloud.xyz123.de/public_html/lib/private/Files/Config/MountProviderCollection.php","line":138,"function":"getMountsFromProvider","class":"OC\\Files\\Config\\MountProviderCollection","type":"->"},{"file":"/home/xyz123/domains/cloud.xyz123.de/public_html/lib/private/Files/SetupManager.php","line":218,"function":"addMountForUser","class":"OC\\Files\\Config\\MountProviderCollection","type":"->"},{"file":"/home/xyz123/domains/cloud.xyz123.de/public_html/lib/private/Files/SetupManager.php","line":321,"function":"OC\\Files\\{closure}","class":"OC\\Files\\SetupManager","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/home/xyz123/domains/cloud.xyz123.de/public_html/lib/private/Files/SetupManager.php","line":217,"function":"setupForUserWith","class":"OC\\Files\\SetupManager","type":"->"},{"file":"/home/xyz123/domains/cloud.xyz123.de/public_html/lib/private/Files/Filesystem.php","line":362,"function":"setupForUser","class":"OC\\Files\\SetupManager","type":"->"},{"file":"/home/xyz123/domains/cloud.xyz123.de/public_html/lib/private/Cache/File.php","line":56,"function":"initMountPoints","class":"OC\\Files\\Filesystem","type":"::"},{"file":"/home/xyz123/domains/cloud.xyz123.de/public_html/lib/private/Cache/File.php","line":177,"function":"getStorage","class":"OC\\Cache\\File","type":"->"},{"file":"/home/xyz123/domains/cloud.xyz123.de/public_html/lib/base.php","line":887,"function":"gc","class":"OC\\Cache\\File","type":"->"},{"function":"{closure}","class":"OC","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/home/xyz123/domains/cloud.xyz123.de/public_html/lib/private/Hooks/EmitterTrait.php","line":105,"function":"call_user_func_array"},{"file":"/home/xyz123/domains/cloud.xyz123.de/public_html/lib/private/Hooks/PublicEmitter.php","line":40,"function":"emit","class":"OC\\Hooks\\BasicEmitter","type":"->"},{"file":"/home/xyz123/domains/cloud.xyz123.de/public_html/lib/private/User/Session.php","line":380,"function":"emit","class":"OC\\Hooks\\PublicEmitter","type":"->"},{"file":"/home/xyz123/domains/cloud.xyz123.de/public_html/lib/private/User/Session.php","line":649,"function":"completeLogin","class":"OC\\User\\Session","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/home/xyz123/domains/cloud.xyz123.de/public_html/lib/private/User/Session.php","line":853,"function":"loginWithToken","class":"OC\\User\\Session","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/home/xyz123/domains/cloud.xyz123.de/public_html/lib/base.php","line":1129,"function":"tryTokenLogin","class":"OC\\User\\Session","type":"->"},{"file":"/home/xyz123/domains/cloud.xyz123.de/public_html/lib/base.php","line":1042,"function":"handleLogin","class":"OC","type":"::"},{"file":"/home/xyz123/domains/cloud.xyz123.de/public_html/index.php","line":49,"function":"handleRequest","class":"OC","type":"::"}],"File":"/home/xyz123/domains/cloud.xyz123.de/public_html/apps/groupfolders/lib/ACL/ACLManager.php","Line":38,"message":"OCA\\GroupFolders\\ACL\\ACLManager::__construct(): Argument #3 ($logger) must be of type Psr\\Log\\LoggerInterface, OC\\User\\User given, called in /home/xyz123/domains/cloud.xyz123.de/public_html/apps/groupfolders/lib/ACL/ACLManagerFactory.php on line 43","exception":{},"CustomMessage":"OCA\\GroupFolders\\ACL\\ACLManager::__construct(): Argument #3 ($logger) must be of type Psr\\Log\\LoggerInterface, OC\\User\\User given, called in /home/xyz123/domains/cloud.xyz123.de/public_html/apps/groupfolders/lib/ACL/ACLManagerFactory.php on line 43"}}

I can’t find any hint while search to counteract this specific issue.

I did a restore to the previous version, when accessing the website it shows the typical after-upgrade information that some apps have to be updated and while executing it shows that it is running the update for 29.0.5 (as it was in the backup). It also is successful but still it shows the same error message afterwards.

The access.log shows the expected html 500, there is no entry in error.log or php error.log.

Does anyone have an idea?

Thanks in advance!
Christian

That error message is about the groupfolders app.

Could you please file a bugreport with your issue here:


Much and good luck,
ernolf

The reference to ACLManagerFactory line 43 suggests you’re GF app is updated (17.0.3), but also suggests a discrepancy from what is in the code. Can you restart php-fpm? This sounds like maybe PHP caching matter or similar.

P.S. If that does fix it, have you by chance changed your opcache validation settings from the defaults?

1 Like

Oh my! That did it! I was able to login to restored version 26.0.5 after restarting the php-fpm service. I executed the upgrade, had some display issues afterwards, as I was not able to see files etc. and relogin after logout.

I just removed the current cookies, closed browser and voila, it’s up and running again.

Thank you very much! That saved a lot of work doing everthing from scratch!

2 Likes

Regarding opcache… I don’t see anything special in my php.ini.

That’s in my /etc/php/8.3/fpm/php.ini

[opcache]
; Determines if Zend OPCache is enabled
;opcache.enable=1
opcache.enable=1

; Determines if Zend OPCache is enabled for the CLI version of PHP
;opcache.enable_cli=0

; The OPcache shared memory storage size.
opcache.memory_consumption=256

; The amount of memory for interned strings in Mbytes.
;opcache.interned_strings_buffer=8
opcache.interned_strings_buffer=24

; The maximum number of keys (scripts) in the OPcache hash table.
; Only numbers between 200 and 1000000 are allowed.
;opcache.max_accelerated_files=10000

; The maximum percentage of "wasted" memory until a restart is scheduled.
;opcache.max_wasted_percentage=5

; When this directive is enabled, the OPcache appends the current working
; directory to the script key, thus eliminating possible collisions between
; files with the same name (basename). Disabling the directive improves
; performance, but may break existing applications.
;opcache.use_cwd=1

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

; 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
opcache.revalidate_freq=60

; Enables or disables file search in include_path optimization
;opcache.revalidate_path=0

; If disabled, all PHPDoc comments are dropped from the code to reduce the
; size of the optimized code.
;opcache.save_comments=1
opcache.save_comments=1

; If enabled, compilation warnings (including notices and deprecations) will
; be recorded and replayed each time a file is included. Otherwise, compilation
; warnings will only be emitted when the file is first cached.
;opcache.record_warnings=0

; Allow file existence override (file_exists, etc.) performance feature.
;opcache.enable_file_override=0

; A bitmask, where each bit enables or disables the appropriate OPcache
; passes
;opcache.optimization_level=0x7FFFBFFF

;opcache.dups_fix=0

; The location of the OPcache blacklist file (wildcards allowed).
; Each OPcache blacklist file is a text file that holds the names of files
; that should not be accelerated. The file format is to add each filename
; to a new line. The filename may be a full path or just a file prefix
; (i.e., /var/www/x  blacklists all the files and directories in /var/www
; that start with 'x'). Line starting with a ; are ignored (comments).
;opcache.blacklist_filename=

; Allows exclusion of large files from being cached. By default all files
; are cached.
;opcache.max_file_size=0

; How long to wait (in seconds) for a scheduled restart to begin if the cache
; is not being accessed.
;opcache.force_restart_timeout=180

; OPcache error_log file name. Empty string assumes "stderr".
;opcache.error_log=

; All OPcache errors go to the Web server log.
; By default, only fatal errors (level 0) or errors (level 1) are logged.
; You can also enable warnings (level 2), info messages (level 3) or
; debug messages (level 4).
;opcache.log_verbosity_level=1

; Preferred Shared Memory back-end. Leave empty and let the system decide.
;opcache.preferred_memory_model=

; Protect the shared memory from unexpected writing during script execution.
; Useful for internal debugging only.
;opcache.protect_memory=0

; Allows calling OPcache API functions only from PHP scripts which path is
; started from specified string. The default "" means no restriction
;opcache.restrict_api=

; Mapping base of shared memory segments (for Windows only). All the PHP
; processes have to map shared memory into the same address space. This
; directive allows to manually fix the "Unable to reattach to base address"
; errors.
;opcache.mmap_base=

; Facilitates multiple OPcache instances per user (for Windows only). All PHP
; processes with the same cache ID and user share an OPcache instance.
;opcache.cache_id=

; Enables and sets the second level cache directory.
; It should improve performance when SHM memory is full, at server restart or
; SHM reset. The default "" disables file based caching.
;opcache.file_cache=

; Enables or disables opcode caching in shared memory.
;opcache.file_cache_only=0

; Enables or disables checksum validation when script loaded from file cache.
;opcache.file_cache_consistency_checks=1

; Implies opcache.file_cache_only=1 for a certain process that failed to
; reattach to the shared memory (for Windows only). Explicitly enabled file
; cache is required.
;opcache.file_cache_fallback=1

; Enables or disables copying of PHP code (text segment) into HUGE PAGES.
; Under certain circumstances (if only a single global PHP process is
; started from which all others fork), this can increase performance
; by a tiny amount because TLB misses are reduced.  On the other hand, this
; delays PHP startup, increases memory usage and degrades performance
; under memory pressure - use with care.
; Requires appropriate OS configuration.
;opcache.huge_code_pages=0

; Validate cached file permissions.
;opcache.validate_permission=0

; Prevent name collisions in chroot'ed environment.
;opcache.validate_root=0

; If specified, it produces opcode dumps for debugging different stages of
; optimizations.
;opcache.opt_debug_level=0

; Specifies a PHP script that is going to be compiled and executed at server
; start-up.
; https://php.net/opcache.preload
;opcache.preload=

; Preloading code as root is not allowed for security reasons. This directive
; facilitates to let the preloading to be run as another user.
; https://php.net/opcache.preload_user
;opcache.preload_user=

; Prevents caching files that are less than this number of seconds old. It
; protects from caching of incompletely updated files. In case all file updates
; on your site are atomic, you may increase performance by setting it to "0".
;opcache.file_update_protection=2

; Absolute path used to store shared lockfiles (for *nix only).
;opcache.lockfile_path=/tmp

The pool.d part is affecting it , too:

php_admin_value[opcache.save_comments] = 1
php_admin_value[opcache.revalidate_freq] = 60
php_admin_value[opcache.jit] = 1255
php_admin_value[opcache.jit_buffer_size] = 128M
php_admin_value[opcache.memory_consumption] = 1024

Do you see anything that’s wrong?

This is why. It nullifies your revalidate_freq setting.

It’s also why there are several warnings on this page: Server tuning — Nextcloud latest Administration Manual latest documentation about doing this. :wink:

Nothing wrong with doing it per se (if you know what you’re doing/why), but means you’re responsible for restarting things when updating anything.

We get invalid bug reports from people that have disabled opcache validation (or have set it to really long periods of time) all the time. :slight_smile:

That said, opcache handling isn’t perfect. It’s probably a good idea to reset things after updates if you’re experiencing any problems… just to rule out caching problems (regardless of settings).

2 Likes