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

Scheduler-Task runs endlessly #1

Open
MK-42 opened this issue Jun 16, 2017 · 3 comments
Open

Scheduler-Task runs endlessly #1

MK-42 opened this issue Jun 16, 2017 · 3 comments

Comments

@MK-42
Copy link

MK-42 commented Jun 16, 2017

Mailspool worked flawlessly for some weeks in our installation. Yesterday night and this night the system stopped sending mails. They get correctly spooled to the configured folder, but not sent out. Cron is running and invoking Scheduler correctly (as reported from the scheduler module in the backend). Only the Mailspool-Task is running since that time in the night when mailing stopped and is obviously not terminating.

The TYPO3 Log only complains about that scheduler task already running and not starting it again due to that. So I suspect something is blocking the task from terminating and therefore it wont start again to send other mails.

Any idea how to debug that? Or maybe even an Idea what could go wrong there?

Edit: I just found the timeout options in the edit form of the scheduler task. Are there known-to-work default values for that? What does "recovering messages that took to long to send" mean?

@r3h6
Copy link
Owner

r3h6 commented Jun 18, 2017

Timeout option is for Swiftmailer:
Swiftmailer appends .sending when sending a message. If a message is not sent successfull, the file will not be deleted. The schedular task tries to recover such files, every time before sending new ones.
https://github.com/swiftmailer/swiftmailer/blob/master/lib/classes/Swift/FileSpool.php

Do you have any files with .sending in the folder?
Did you try to manually cancel the task in TYPO3?
Any hints in the log files, for some exception or error regarding sending mails?

@MK-42
Copy link
Author

MK-42 commented Jun 20, 2017

Did you try to manually cancel the task in TYPO3?

Yes. That did solve the problem, but I don't know if it discarded a mail.

Do you have any files with .sending in the folder?

Unfortunately I can't tell, because I stopped the scheduler-job before looking there.

Any hints in the log files, for some exception or error regarding sending mails?

Nothing suspicious, the scheduler was complaining that the task was already running and due to that not restarting again

[scheduler]: Task is already running and multiple executions are not allowed, skipping! Class: TYPO3\CMS\Extbase\Scheduler\Task, UID: 1

From that I can tell that the hanging task was running from 4:50 until 13:00 o'clock, when I terminated it. It happened again (I think yesterday). After that I allowed parallel execution of the scheduler task. Is it safe to do so? Are there default timeouts configured for swiftmailer, or should I set some in the scheduler task? I would really like to debug that and find out why that task stalled... Do you have an Idea where to look for debug output other than the typo3 log / where to enable more verbose swiftmailer logging?

@r3h6
Copy link
Owner

r3h6 commented Jun 20, 2017

If there's no timeLimit or messageLimit set, the task should run as long as there are .messages files in the spool (directory).

If you worry about parallel execution you can set the timeLimit same as your cron interval.

I think the schedularer task stopped due an error and could not mark himself as finished.
I don't think one task runs so long, except daemon option is set, which you should not set.

Stopping the task, does not remove any mails from the spool. Check once your spool directory for .sending files. If you have any of them, maybe they could cause the problem. If one mesage always raise an exception when sending for instance.

Depending on your settings, exceptions from swiftmailer should be logged by TYPO3.
I don't know about specific logging for swiftmailer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants