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]: Cron doesn't seem to be working lately #644

Open
6 tasks done
bugbountyguy opened this issue Mar 6, 2024 · 7 comments
Open
6 tasks done

[BUG]: Cron doesn't seem to be working lately #644

bugbountyguy opened this issue Mar 6, 2024 · 7 comments
Labels
bug Something in the app is not working as expected

Comments

@bugbountyguy
Copy link

bugbountyguy commented Mar 6, 2024

⚠️ This issue respects the following points: ⚠️

  • This is a single bug, not a question or a configuration/webserver/proxy issue.
  • This is not a bug in the browser extension or another client.
  • This issue is not already reported on Github (I've searched it).
  • Nextcloud Server and the Passwords App is up to date. See Nextcloud Apps.
  • There are no warnings and errors reported in the Passwords App settings in the admin area
  • The following apps are not installed: Rainloop

Server Information

{
    "version": {
        "server": "28.0.3.2",
        "app": "2024.3.20",
        "lsr": false,
        "php": "8.2.16",
        "cronPhp": "8.2.16"
    },
    "environment": {
        "os": "Linux",
        "architecture": "x86_64",
        "bits": 64,
        "database": "mysql",
        "cron": "cron",
        "proxy": false,
        "sslProxy": false,
        "subdirectory": false
    },
    "services": {
        "images": "imagick",
        "favicons": "default",
        "previews": "default",
        "security": "hibp",
        "words": "auto",
        "previewApi": false,
        "faviconApi": false
    },
    "status": {
        "autoBackupRestored": false
    },
    "settings": {
        "channel": "stable",
        "nightlies": true,
        "handbook": false,
        "performance": 5
    },
    "encryption": {
        "sse": {
            "SSEv1r1": false,
            "SSEv1r2": true,
            "SSEv2r1": false,
            "SSEv3r1": false,
            "none": true,
            "default": "none"
        },
        "cse": {
            "CSEv1r1": true,
            "none": true,
            "default": "CSEv1r1"
        }
    }
}

Client Information

N/A (server side issue)

Bug description

I saw the other bug report, but was unable to reply to it. The mention was of the reporter having an old version of PHP - however, my PHP is up to date on both the app and cron, so I don't think that's related? I've got the latest nextcloud:apache images that are available.

I'm getting an exception in the nextcloud logs, which is resulting in cron failing and cascading to the other cron jobs:

Mar  6 09:15:01 127.0.0.1 nextcloud: {"reqId":"[[FILTERED]]","level":3,"time":"2024-03-06T15:15:00+00:00","remoteAddr":"","user":"--","app":"cron","method":"","url":"--","message":"Exception thrown: ArgumentCountError","userAgent":"--","version":"28.0.3.2","exception":{"Exception":"ArgumentCountError","Message":"Too few arguments to function OCA\\Passwords\\Cron\\CheckPasswordsJob::__construct(), 0 passed in /var/www/html/lib/private/BackgroundJob/JobList.php on line 330 and exactly 9 expected","Code":0,"Trace":[{"file":"/var/www/html/lib/private/BackgroundJob/JobList.php","line":330,"function":"__construct","class":"OCA\\Passwords\\Cron\\CheckPasswordsJob","type":"->","args":[]},{"file":"/var/www/html/lib/private/BackgroundJob/JobList.php","line":235,"function":"buildJob","class":"OC\\BackgroundJob\\JobList","type":"->","args":[[69928,"OCA\\Passwords\\Cron\\CheckPasswordsJob","null",0,1709625704,0,38,"[[FILTERED]]",0]]},{"file":"/var/www/html/cron.php","line":145,"function":"getNext","class":"OC\\BackgroundJob\\JobList","type":"->","args":[false]}],"File":"/var/www/html/custom_apps/passwords/lib/Cron/CheckPasswordsJob.php","Line":58,"CustomMessage":"Exception thrown: ArgumentCountError"}} 

Steps to reproduce

I guess update to the latest version of passwords and nextcloud and you'll have this happen

Expected behavior

Cron works

Nextcloud Logs

See above

Browser Logs

No response

@bugbountyguy bugbountyguy added the bug Something in the app is not working as expected label Mar 6, 2024
@marius-wieschollek
Copy link
Owner

This seems like the same error message.

Have you tried runnin the cron.php file manually and see if the issue disappears?

@bugbountyguy
Copy link
Author

This is kinda weird. I put a try/catch statement around the line that was erroring out so that the rest of the crons would be able to run instead of just dying early. I went and removed that now and then tried to run it manually, no error. I kept that try and catch commented out, and no more errors are showing up in the logs. Perhaps there's a job that doesn't happen as frequently and the flooded errors were due to constant retries or something? Lemme get back to you later to see if it shows up again and I'll try the manual run of cron.php again (within 24 hours) to see what happens.

@marius-wieschollek
Copy link
Owner

The check passwords job is supposed to run once a day.

@dboehmer
Copy link

I have the same issue and posted a bug report accidentally to the wrong GitHub project as nextcloud/password_policy#628

My workaround was to disable the Passwords app in Nextcloud. This made the cronjob run successfully again but is obviously no real solution. I just enabled it again for testing and it’s still broken.

  • App version as of today: 2024.7.20
  • Nextcloud version: 29.0.4

@Tiller
Copy link

Tiller commented Aug 21, 2024

Hi,
I've had the same issue today after installing Passwords on my 29.0.5 instance. However, I did figure out the issue : my cron was setup in my www-data's crontab as follow:

*/5 * * * * php8.1 -f /var/www/nextcloud/cron.php

As I upgraded to php 8.2 some time ago, it should have been updated to :

*/5 * * * * php8.2 -f /var/www/nextcloud/cron.php

This fixed the issue. So I believe the latest version of Passwords is incompatible with php 8.1.

$  sudo -u www-data php8.1 -f /var/www/nextcloud/cron.php 
ArgumentCountError: Too few arguments to function OCA\Passwords\Cron\SynchronizeShares::__construct(), 0 passed in /var/www/nextcloud/lib/private/BackgroundJob/JobList.php on line 330 and exactly 9 expected in /var/www/nextcloud/apps/passwords/lib/Cron/SynchronizeShares.php:58
Stack trace:
#0 /var/www/nextcloud/lib/private/BackgroundJob/JobList.php(330): OCA\Passwords\Cron\SynchronizeShares->__construct()
#1 /var/www/nextcloud/lib/private/BackgroundJob/JobList.php(235): OC\BackgroundJob\JobList->buildJob()
#2 /var/www/nextcloud/cron.php(163): OC\BackgroundJob\JobList->getNext()
#3 {main}

$  sudo -u www-data php8.2 -f /var/www/nextcloud/cron.php
<OK>

@dboehmer
Copy link

Unfortunately the PHP version for the cronjob is already set to 8.2 in the settings at my shared web space provider.

@dboehmer
Copy link

Update: Inspired by the report above I set the PHP version for the cronjob to 8.3 and that seems to have solved the issue. I get no more hourly error reports from Nextcloud and the status page doesn’t indicate the cronjob had not run. 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something in the app is not working as expected
Projects
None yet
Development

No branches or pull requests

4 participants