Error sending notification email - "Session has been closed"
The users are not receiving email notifications from the system and the log is full of entries like the one below.
Email config is working, tested sending test from the admin page and received email.
Not sure if this is related but, I've made changes according to https://github.com/owncloud/core/issues/23212 , https://github.com/owncloud/activity/pull/490 and https://github.com/owncloud/core/pull/23292
Steps to reproduce
Configure user to receive email notifications.
Expected behaviour
Email should be sent without errors
Actual behaviour
No activity email is sent and error is logged in system log
Server configuration
Operating system: centos-release-7-2.1511.el7.centos.2.10.x86_64 Web server: nginx 1.9.12 Database: mariadb 10.1 PHP version: 5.6.18 ownCloud version: (see ownCloud admin page) 9.0.0 Updated from an older ownCloud or fresh install: updated from 8.2.2 Where did you install ownCloud from: tar file Signing status (ownCloud 9.0 and above): No errors have been found.
List of activated apps: Enabled:
- activity: 2.2.1
- comments: 0.2
- dav: 0.1.5
- federatedfilesharing: 0.1.0
- federation: 0.0.4
- files: 1.4.4
- files_pdfviewer: 0.8
- files_sharing: 0.9.1
- files_texteditor: 2.1
- files_trashbin: 0.8.0
- files_versions: 1.2.0
- files_videoplayer: 0.9.8
- firstrunwizard: 1.1
- notifications: 0.2.3
- provisioning_api: 0.4.1
- systemtags: 0.2
- templateeditor: 0.1
- updatenotification: 0.1.0
The content of config/config.php:
"system": {
"instanceid": "oc1387q0ck5c",
"passwordsalt": "***REMOVED SENSITIVE VALUE***",
"secret": "***REMOVED SENSITIVE VALUE***",
"trusted_domains": [
"***REMOVED SENSITIVE VALUE***"
],
"datadirectory": "\/Storage-Disk1\/owncloud\/data",
"overwrite.cli.url": "***REMOVED SENSITIVE VALUE***",
"dbtype": "mysql",
"version": "9.0.0.19",
"dbname": "ownclouddb",
"dbhost": "localhost",
"dbtableprefix": "oc_",
"dbuser": "***REMOVED SENSITIVE VALUE***",
"dbpassword": "***REMOVED SENSITIVE VALUE***",
"logtimezone": "UTC",
"installed": true,
"mail_smtpmode": "smtp",
"mail_smtpsecure": "tls",
"mail_smtpauthtype": "LOGIN",
"mail_smtpauth": 1,
"mail_smtpport": "587",
"mail_from_address": "webmaster",
"mail_domain": "briopul.pt",
"mail_smtphost": "smtp.smartcloudpt.pt",
"mail_smtpname": "***REMOVED SENSITIVE VALUE***",
"mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
"filelocking.enabled": "true",
"memcache.local": "\\OC\\Memcache\\APCu",
"theme": "",
"loglevel": 2,
"maintenance": false,
"trashbin_retention_obligation": "auto, auto"
**Are you using external storage, if yes which one: No Are you using encryption: yes/no No **Are you using an external user-backend, if yes which one: No
ownCloud log (data/owncloud.log)
Error while running background job (class: OCA\Activity\BackgroundJob\EmailNotification, arguments: ): {"Exception":"Exception","Message":"Session has been closed - no further changes to the session are allowed","Code":0,"Trace":"#0 /var/www/html/owncloud/lib/private/session/memory.php(49): OC\Session\Memory->validateSession()\n#1 /var/www/html/owncloud/lib/private/security/csrf/tokenstorage/sessionstorage.php(63): OC\Session\Memory->set('requesttoken', 'JNmvzObAdFXLLzu...')\n#2 /var/www/html/owncloud/lib/private/security/csrf/csrftokenmanager.php(57): OC\Security\CSRF\TokenStorage\SessionStorage->setToken('JNmvzObAdFXLLzu...')\n#3 /var/www/html/owncloud/lib/public/util.php(496): OC\Security\CSRF\CsrfTokenManager->getToken()\n#4 /var/www/html/owncloud/lib/private/template.php(75): OCP\Util::callRegister()\n#5 /var/www/html/owncloud/apps/activity/lib/mailqueuehandler.php(250): OC_Template->__construct('activity', 'email.notificat...', '')\n#6 /var/www/html/owncloud/apps/activity/lib/backgroundjob/emailnotification.php(134): OCA\Activity\MailQueueHandler->sendEmailToUser('userabc', 'userabc@brio...', 'pt_PT', 'Europe/London', 1458745201)\n#7 /var/www/html/owncloud/apps/activity/lib/backgroundjob/emailnotification.php(94): OCA\Activity\BackgroundJob\EmailNotification->runStep(500, 1458745201)\n#8 /var/www/html/owncloud/lib/private/backgroundjob/job.php(52): OCA\Activity\BackgroundJob\EmailNotification->run(NULL)\n#9 /var/www/html/owncloud/lib/private/backgroundjob/timedjob.php(53): OC\BackgroundJob\Job->execute(Object(OC\BackgroundJob\JobList), Object(OC\Log))\n#10 /var/www/html/owncloud/cron.php(141): OC\BackgroundJob\TimedJob->execute(Object(OC\BackgroundJob\JobList), Object(OC\Log))\n#11 {main}","File":"/var/www/html/owncloud/lib/private/session/memory.php","Line":105}
https://github.com/owncloud/activity/pull/486 will fix that. Please try the 9.0.1 beta.
https://owncloud.org/install/#testing-development
I can confirm the fix solves the issue.
Thanks.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.