marius-wieschollek / passwords

A simple, yet feature rich password manager for Nextcloud
GNU Affero General Public License v3.0
201 stars 39 forks source link

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

Open bugbountyguy opened 4 months ago

bugbountyguy commented 4 months ago

⚠️ This issue respects the following points: ⚠️

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

marius-wieschollek commented 4 months ago

This seems like the same error message.

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

bugbountyguy commented 4 months ago

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 commented 4 months ago

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