Open Quintasan opened 5 months ago
Why is your configuration report outputing version 28.0.4.1
and you log 27.0.1.2
?
Why is your configuration report outputing version
28.0.4.1
and you log27.0.1.2
?
Because I have a 90mb logfile running since at least one year. If you want me to upload the entire file then I can do so but it's full of the same messages.
Here's a fresh entry for this:
{
"reqId": "353srMO2NBgDtEVrOoOQ",
"level": 3,
"time": "2024-03-29T08:40:27+00:00",
"remoteAddr": "",
"user": "--",
"app": "PHP",
"method": "",
"url": "--",
"message": "Cannot declare class OC\\Command\\CommandJob, because the name is already in use at /srv/www/cloud.frelia.org/lib/private/Command/CommandJob.php#31",
"userAgent": "--",
"version": "28.0.4.1",
"data": {
"app": "PHP"
}
}
Can you briefly enable log.backtrace
and provide the stack trace associated with one of the errors?
@joshtrichards should this affect running via sudo -u www-data php /srv/www/cloud.frelia.org/cron.php
? ~I added 'log.backtrace' => true,
to config/config.php
but I get no backtrace anyway~
{
"reqId": "g4qYPOX5Jldi3MClKOEy",
"level": 3,
"time": "2024-03-29T13:44:25+00:00",
"remoteAddr": "",
"user": "--",
"app": "PHP",
"method": "",
"url": "--",
"message": "Cannot declare class OC\\Command\\CommandJob, because the name is already in use at /srv/www/cloud.frelia.org/lib/private/Command/CommandJob.php#31",
"userAgent": "--",
"version": "28.0.4.1",
"data": {
"app": "PHP",
"backtrace": [
{
"file": "/srv/www/cloud.frelia.org/lib/private/Log.php",
"line": 139,
"function": "log",
"class": "OC\\Log",
"type": "->"
},
{
"file": "/srv/www/cloud.frelia.org/lib/private/Log/PsrLoggerAdapter.php",
"line": 110,
"function": "critical",
"class": "OC\\Log",
"type": "->"
},
{
"file": "/srv/www/cloud.frelia.org/lib/private/Log/ErrorHandler.php",
"line": 58,
"function": "critical",
"class": "OC\\Log\\PsrLoggerAdapter",
"type": "->"
},
{
"function": "onShutdown",
"class": "OC\\Log\\ErrorHandler",
"type": "->"
}
]
}
}
Doesn't look helpful though
Yeah I was worried that might be the case since this is a PHP fatal error. sigh
I don't see how this is coming from our code base. We don't declare that class anywhere else and there haven't been other similar reports. (We'd no doubt have a ton fairly quickly after it appearing).
I don't see anything within the apps you have installed either.
A shot in the dark: Can you share the output of occ background-job:list
?
Community Manual installation with Archive
What's the history of this installation? Has it been around awhile or is it fairly new? Also, how do you typically deploy updates?
Also, what's the output of: grep CommandJob -r /srv/www/cloud.frelia.org --exclude-dir=data
?
A shot in the dark: Can you share the output of
occ background-job:list
?
@joshtrichards as you would expect:
sudo -u www-data php occ background-job:list 255 ↵
PHP Fatal error: Cannot declare class OC\Command\CommandJob, because the name is already in use in /srv/www/cloud.frelia.org/lib/private/Command/CommandJob.php on line 31
What's the history of this installation? Has it been around awhile or is it fairly new? Also, how do you typically deploy updates?
It has been around since... at least May 2018. At least that's what the timestamp on my data directory indicates. I usually deploy using the Web UI and before that I manually extracted tarballs.
Also, what's the output of:
grep CommandJob -r /srv/www/cloud.frelia.org --exclude-dir=data
?
╭─quintasan@frelia /srv
╰─$ grep CommandJob -r /srv/www/cloud.frelia.org --exclude-dir=data
/srv/www/cloud.frelia.org/core/signature.json: "lib\/private\/Command\/CommandJob.php": "78781dbfa98a7f9cf263a56118a721759ef81bfbfbd37a36972d5de003e85c2b500e02d26cf69442805c7a3fd14516de6dacbffe0dc00b7f80449118fb5f2412",
/srv/www/cloud.frelia.org/lib/composer/composer/autoload_static.php: 'OC\\Command\\CommandJob' => __DIR__ . '/../../..' . '/lib/private/Command/CommandJob.php',
/srv/www/cloud.frelia.org/lib/composer/composer/autoload_classmap.php: 'OC\\Command\\CommandJob' => $baseDir . '/lib/private/Command/CommandJob.php',
/srv/www/cloud.frelia.org/lib/private/Command/CommandJob.php:class CommandJob extends QueuedJob {
/srv/www/cloud.frelia.org/lib/private/Command/CronBus.php: return CommandJob::class;
Any chance you're sharing your Redis server with a second Nextcloud instance?
Also can you see if changing your memcache.local
to APCu makes any difference:
"memcache.local": "\\OC\\Memcache\\APCu",
(I'm assuming this is a standalone server; in which case APCu is recommended for memcache.local
anyhow).
Any chance you're sharing your Redis server with a second Nextcloud instance?
Nope. That's a single small VPS running a single Nextcloud instance.
Also can you see if changing your
memcache.local
to APCu makes any difference
Lemme do it.
Uh, I'm confused as hell right now:
# config.php
'memcache.local' => '\OC\Memcache\APCu',
'memcache.distributed' => '\OC\Memcache\Redis',
'memcache.locking' => '\OC\Memcache\Redis',
'redis' =>
array (
'host' => '/var/run/redis/redis-server.sock',
'port' => 0,
),
╭─quintasan@frelia /srv/www/cloud.frelia.org
╰─$ sudo -u www-data php /srv/www/cloud.frelia.org/cron.php
OCP\HintException: [0]: Memcache OC\Memcache\APCu not available for local cache (Is the matching PHP module installed and enabled?)
but php8.3-apcu
is installed
Once, again, I realized I'm a dummy so:
sudo -u www-data php --define apc.enable_cli=1 /srv/www/cloud.frelia.org/cron.php
PHP Fatal error: Cannot declare class OC\Command\CommandJob, because the name is already in use in /srv/www/cloud.frelia.org/lib/private/Command/CommandJob.php on line 31
It appears we're back to square one
Have you customized your PHP runtime configuration at all?
Share the output of:
php -v
php -m
php --ri "Zend OPcache"
@joshtrichards there you go
I see you have the extension igbinary
installed. Are you using it for something? Is APCu maybe configured to use it?
php --ri apcu
@joshtrichards
╭─quintasan@frelia ~
╰─$ php --ri apcu
apcu
APCu Support => Enabled
Version => 5.1.23
APCu Debugging => Disabled
MMAP Support => Enabled
MMAP File Mask =>
Serialization Support => php, igbinary
Build Date => Nov 25 2023 13:05:34
Directive => Local Value => Master Value
apc.enabled => On => On
apc.shm_segments => 1 => 1
apc.shm_size => 32M => 32M
apc.entries_hint => 4096 => 4096
apc.gc_ttl => 3600 => 3600
apc.ttl => 0 => 0
apc.smart => 0 => 0
apc.mmap_file_mask => no value => no value
apc.enable_cli => On => On
apc.slam_defense => Off => Off
apc.preload_path => no value => no value
apc.coredump_unmap => Off => Off
apc.use_request_time => Off => Off
apc.serializer => php => php
I'm not sure why why you're experiencing this, but it seems to be something specific to your environment. There haven't been any similar reports. There is no evidence to suggest it's a bug in Nextcloud Server itself.
The error itself is generally a fairly straightforward condition to fix (from a development perspective, if it were a bug on this end), but the underlying cause in your situation appears to be unusual. It's possible it's even a bug in PHP. Given you've tried multiple PHP versions though, I'm skeptical of that. Something else about your environment though...
If you're motivated/able, you might try bringing up a fresh OS/hosting environment (with few changes beyond stock) and migrating your existing Nextcloud installation to it to see if the error returns. Precisely what OS/distribution (and version) is this anyhow?
You might try posting at the community help forum - https://help.nextcloud.com - see if some additional eyes turn up something about your environment.
I'm afraid there's not much else we can do from this end, since there is nothing to suggest it's a bug over here.
P.S. PHP recently improved the error reporting for this message, to indicate the source: php/php-src/commit/1c30c5e707c1c289676734df6f1056ac20f4479c (which would be very informative in your particular situation), but unfortunately that's only for the upcoming 8.4 AFAIK.
This issue has been automatically marked as stale because it has not had recent activity and seems to be missing some essential information. It will be closed if no further activity occurs. Thank you for your contributions.
⚠️ This issue respects the following points: ⚠️
Bug description
My background jobs systemd service is constantly failing with:
PHP Fatal error: Cannot declare class OC\Command\CommandJob, because the name is already in use in /srv/www/cloud.frelia.org/lib/private/Command/CommandJob.php on line 31
Steps to reproduce
sudo -u www-data php /srv/www/cloud.frelia.org/cron.php
Expected behavior
cron.php runs normally
Installation method
Community Manual installation with Archive
Nextcloud Server version
28
Operating system
Debian/Ubuntu
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. 22 to 23)
Are you using the Nextcloud Server Encryption module?
Encryption is Disabled
What user-backends are you using?
Configuration report
List of activated Apps
Nextcloud Signing status
Nextcloud Logs
Additional info
Based on the error above it appears I have had the issue since version 27 at least
So far I tried: