Skip to content

Cronjob 'mollie_send_pending_payment_reminders' gets stuck in 'running' (probably due to it crashing) #367

Closed
@hostep

Description

@hostep

Describe the bug
We've upgraded this module from 1.17.0 to 1.23.0 a week ago. Since a few days we detected that the mollie_send_pending_payment_reminders cronjob gets stuck in the running status in the cron_schedule database table.
If a cronjob is set to running it means Magento won't run new scheduled jobs anymore until that job is gone.
We have a script to detect these things if a job is in running for more than 24 hours and when that happens we automatically change the status to error.
I've now seen this problem happening 3 times on 3 consecutive days, so this appears to be a problem that keeps coming back.

From looking at the mollie.log file, I only find the output: Preparing to send the payment reminder for order ... but never Payment reminder record moved to sent table for order ....
This seems to indicate that something is crashing in the method moveReminderFromPendingToSent and this error is not being handled properly by some try catch statement for example and we have no idea from the log file what error this is exactly.

Used versions

  • Magento Version number(eg 2.3.5): 2.2.3
  • Open source/Enterprise/B2b: Open Source
  • Mollie version number (Check configuration): 1.23.0
  • PHP version number: 7.0.33

To Reproduce
Steps to reproduce the behavior:
Not sure, hopefully the description above might give some idea

Expected behavior
Cronjob shouldn't stay in running state. Exception handling should happen so the cronjob terminates without errors. Also we should preferably find an exception message in some log file.
But I don't know if this is the best idea, because this error would then be hidden until somebody inspects the log files.
Maybe the cronjob should go into the error status and the exception message could be saved in the messages field of the cron_schedule database? I think Magento does this automatically sometimes, but not sure how it works exactly.

Actual behavior
Cronjob stays in running state forever when an exception happens.

Metadata

Metadata

Assignees

No one assigned

    Labels

    InvestigatingWe are working on this issue together with the customer.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions