Skip to content

add debug output and missing exception handlers to fix #459 - #460

Closed
madmas wants to merge 2 commits into
nextcloud:masterfrom
madmas:endlessNotificationsFix
Closed

add debug output and missing exception handlers to fix #459#460
madmas wants to merge 2 commits into
nextcloud:masterfrom
madmas:endlessNotificationsFix

Conversation

@madmas

@madmasmadmas commented May 6, 2020

Copy link
Copy Markdown

add debug outout and exception handling fix to get rid of over-and-over sent notifications.

I think esp. the changes to line 410 helped to fix the issue.

@kesselb

Copy link
Copy Markdown
Contributor

How does logException fixes something? Mind to share $e->getMessage() to see why sending the email failed?

@madmas

Copy link
Copy Markdown
Author

Hi @kesselb , sorry, I switched the lines, I think the actual fix is below, in line 415. 410 of course only helps in regard of debugging ;-)

Signed-off-by: Markus Schlichting <markus.schlichting@karakun.com>
@madmas
madmasforce-pushed the endlessNotificationsFix branch from e85a42f to 19e481fCompareJune 24, 2020 10:12
@kesselb

Copy link
Copy Markdown
Contributor

Mind to share the exception? Also you overwrite the actual exception message. That makes it harder to debug.

@kesselbkesselb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not convinced. Right now the error handling code fails and the original exception message is replaced with a generic error message.

Comment threadlib/MailQueueHandler.php Outdated
Comment threadlib/MailQueueHandler.php Outdated
} catch (\Exception $e) {
$this->logger->logException($e, [
'message' => 'Failed sending email to user "{user}"',
'user' => $user,

@kesselbkesselbJun 24, 2020

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Log the exception with $this->logger->logException($e); and log a additional warning $this->logger->warning('Failed to send notification email for user {user}', ['user' => $userName]);. You cannot use $user because it's a IUser object. Ah that might work as the normalizer will format it. I would still prefer the $userName ;)

change the glue for implode from | to ,
Co-authored-by: kesselb <mail@danielkesselberg.de>
@madmas

Copy link
Copy Markdown
Author

I'm not convinced. Right now the error handling code fails and the original exception message is replaced with a generic error message.

My experience was vice versa - with the output I added with shown here, I got much more details.
I cannot share the exception as after implementing this, I don't see them happen on my system anymore....

@kesselb

Copy link
Copy Markdown
Contributor

We still don't know why sending the notification failed in the first place. This is fixing symptoms not problems 😟

This was referenced Jan 21, 2025
@blizzzblizzz mentioned this pull request Jan 29, 2025
1 task
@blizzzblizzz modified the milestones: Nextcloud 31, Nextcloud 32Jan 29, 2025
@blizzzblizzz modified the milestones: Nextcloud 33, Nextcloud 34Feb 16, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@madmas@kesselb@susnux@blizzz@miaulalala@skjnldsv