-
Notifications
You must be signed in to change notification settings - Fork 69
Closed
Labels
Description
Note: the steps are assumed based on log entries I found with this error.
Steps to reproduce
- Have a user select the timezone "Etc/Unknown" (not sure how, I'll need to check)
- Have the user generate some activities
- Wait for activities to be sent by email
Expected behaviour
Activities sent using UTC timezone.
Actual behaviour
Errors in log and likely no emails sent.
Server configuration
Nextcloud 21.0.7
Logs
{
"reqId": "XXXXX",
"level": 3,
"time": "2021-12-10T07:40:02+00:00",
"remoteAddr": "",
"user": "--",
"app": "activity",
"method": "",
"url": "--",
"message": {
"Exception": "Exception",
"Message": "DateTimeZone::__construct(): Unknown or bad timezone (Etc/Unknown)",
"Code": 0,
"Trace": [
{
"file": "/var/www/html/apps/activity/lib/MailQueueHandler.php",
"line": 354,
"function": "__construct",
"class": "DateTimeZone",
"type": "->",
"args": [
"Etc/Unknown"
]
},
{
"file": "/var/www/html/apps/activity/lib/MailQueueHandler.php",
"line": 163,
"function": "sendEmailToUser",
"class": "OCA\\Activity\\MailQueueHandler",
"type": "->",
"args": [
"",
"",
"en",
"Etc/Unknown",
1639122001
]
},
{
"file": "/var/www/html/apps/activity/lib/BackgroundJob/EmailNotification.php",
"line": 61,
"function": "sendEmails",
"class": "OCA\\Activity\\MailQueueHandler",
"type": "->",
"args": [
500,
1639122001
]
},
{
"file": "/var/www/html/lib/private/BackgroundJob/Job.php",
"line": 52,
"function": "run",
"class": "OCA\\Activity\\BackgroundJob\\EmailNotification",
"type": "->",
"args": [
null
]
},
{
"file": "/var/www/html/lib/private/BackgroundJob/TimedJob.php",
"line": 59,
"function": "execute",
"class": "OC\\BackgroundJob\\Job",
"type": "->",
"args": [
{
"__class__": "OC\\BackgroundJob\\JobList"
},
{
"__class__": "OC\\Log"
}
]
},
{
"file": "/var/www/html/cron.php",
"line": 128,
"function": "execute",
"class": "OC\\BackgroundJob\\TimedJob",
"type": "->",
"args": [
{
"__class__": "OC\\BackgroundJob\\JobList"
},
{
"__class__": "OC\\Log"
}
]
}
],
"File": "/var/www/html/apps/activity/lib/MailQueueHandler.php",
"Line": 354,
"CustomMessage": "Failed sending activity email to user \"{user}\""
},
"userAgent": "--",
"version": "21.0.7.0"
}
Notes
I suggest that we initialize the DateTimeZone earlier and catch its error. In case of error, fall back to "UTC" which is way better than failing and never sending the email.
Reactions are currently unavailable