AIO: not sending e-mail after backup or upgrade

Hi,

I’m managing two NC AIO instances on the same server, with similar setup (I think).
Both run on docker rootless and both are currently running version 31.0.10 with automatic upgrades.

The difference is: instance A sends me an e-mail daily after the backup or upgrade, while the other (B) not. And I’m sure (I verified it) both are doing daily backups and upgrading when needed.

B have e-mail configured and working: if I modify a shared file, a notification is successfully sent to the user.

I don’t see any log about e-mail in the admin or AIO interface, neither any e-mail attempt in my Postfix logs.

Where is this AIO notification configured? How can I debug it?

edit : when logged as admin in the admin interface, I see the ‘daily backup successful!’ message in the notification area, just no e-mail

Hi, see How to notify non-admin users about backup success/failures

Thanks.

  • no “check-box Send notifications about successful backup” in AIO interface
  • admin profile in NC admin interface has an e-mail configured
    • I may one day want to send those notifications to other users but for now receiving them on admin e-mail address is sufficient
  • I changed the admin notification setting: “Send email reminders about unhandled notifications after: 1 day”

I will see tomorrow if it solved the problem

1 Like

This morning I got an e-mail from site A (backup) but still none from site B :frowning: And no connection to the SMTP server from Nextcloud.

Is there any way to debug further?

I tried occ config:app:get updatenotification app_updated.enabled but no return.
And I’m not sure this is the way, because I’m looking for notifications from AIO itself not NC (but maybe the split between both is not that evident neither)

Hi, can you post the output of sudo docker logs nextcloud-aio-mastercontainer here?

Logs starting at the end of N-2 backup (because there is a stacktrace)


Daily backup script has finished
Total reclaimed space: 0B
++ head -1 /mnt/docker-aio-config/data/daily_backup_time
+ BACKUP_TIME=04:00
+ export BACKUP_TIME
+ export DAILY_BACKUP=1
+ DAILY_BACKUP=1
++ sed -n 2p /mnt/docker-aio-config/data/daily_backup_time
+ '[' '' '!=' automaticUpdatesAreNotEnabled ']'
+ export AUTOMATIC_UPDATES=1
+ AUTOMATIC_UPDATES=1
++ sed -n 3p /mnt/docker-aio-config/data/daily_backup_time
+ '[' '' '!=' successNotificationsAreNotEnabled ']'
+ export SEND_SUCCESS_NOTIFICATIONS=1
+ SEND_SUCCESS_NOTIFICATIONS=1
+ set +x
Deleting duplicate sessions
NOTICE: PHP message: 404 Not Found
Type: Slim\Exception\HttpNotFoundException
Code: 404
Message: Not found.
File: /var/www/docker-aio/php/vendor/slim/slim/Slim/Middleware/RoutingMiddleware.php
Line: 76
Trace: #0 /var/www/docker-aio/php/vendor/slim/slim/Slim/Routing/RouteRunner.php(62): Slim\Middleware\RoutingMiddleware->performRouting(Object(GuzzleHttp\Psr7\ServerRequest))
#1 /var/www/docker-aio/php/vendor/slim/csrf/src/Guard.php(482): Slim\Routing\RouteRunner->handle(Object(GuzzleHttp\Psr7\ServerRequest))
#2 /var/www/docker-aio/php/vendor/slim/slim/Slim/MiddlewareDispatcher.php(178): Slim\Csrf\Guard->process(Object(GuzzleHttp\Psr7\ServerRequest), Object(Slim\Routing\RouteRunner))
#3 /var/www/docker-aio/php/vendor/slim/twig-view/src/TwigMiddleware.php(117): Psr\Http\Server\RequestHandlerInterface@anonymous->handle(Object(GuzzleHttp\Psr7\ServerRequest))
#4 /var/www/docker-aio/php/vendor/slim/slim/Slim/MiddlewareDispatcher.php(129): Slim\Views\TwigMiddleware->process(Object(GuzzleHttp\Psr7\ServerRequest), Object(Psr\Http\Server\RequestHandlerInterface@anonymous))
#5 /var/www/docker-aio/php/src/Middleware/AuthMiddleware.php(36): Psr\Http\Server\RequestHandlerInterface@anonymous->handle(Object(GuzzleHttp\Psr7\ServerRequest))
#6 /var/www/docker-aio/php/vendor/slim/slim/Slim/MiddlewareDispatcher.php(283): AIO\Middleware\AuthMiddleware->__invoke(Object(GuzzleHttp\Psr7\ServerRequest), Object(Psr\Http\Server\RequestHandlerInterface@anonymous))
#7 /var/www/docker-aio/php/vendor/slim/slim/Slim/Middleware/ErrorMiddleware.php(77): Psr\Http\Server\RequestHandlerInterface@anonymous->handle(Object(GuzzleHttp\Psr7\ServerRequest))
#8 /var/www/docker-aio/php/vendor/slim/slim/Slim/MiddlewareDispatcher.php(129): Slim\Middleware\ErrorMiddleware->process(Object(GuzzleHttp\Psr7\ServerRequest), Object(Psr\Http\Server\RequestHandlerInterface@anonymous))
#9 /var/www/docker-aio/php/vendor/slim/slim/Slim/MiddlewareDispatcher.php(73): Psr\Http\Server\RequestHandlerInterface@anonymous->handle(Object(GuzzleHttp\Psr7\ServerRequest))
#10 /var/www/docker-aio/php/vendor/slim/slim/Slim/App.php(209): Slim\MiddlewareDispatcher->handle(Object(GuzzleHttp\Psr7\ServerRequest))
#11 /var/www/docker-aio/php/vendor/slim/slim/Slim/App.php(193): Slim\App->handle(Object(GuzzleHttp\Psr7\ServerRequest))
#12 /var/www/docker-aio/php/public/index.php(198): Slim\App->run()
#13 {main}
Tips: To display error details in HTTP response set "displayErrorDetails" to true in the ErrorHandler constructor.
Daily backup script has started
Connection to nextcloud-aio-apache (172.18.0.7) 11011 port [tcp/*] succeeded!
Starting mastercontainer update...
(The script might get exited due to that. In order to update all the other containers correctly, you need to run this script with the same settings a second time.)
Waiting for watchtower to stop
Updating container images...
Creating daily backup...
Waiting for backup container to stop
Starting and updating containers...
Waiting for the Nextcloud container to start
Waiting for the Nextcloud container to start
Connection to nextcloud-aio-nextcloud (172.18.0.6) 9000 port [tcp/*] succeeded!
Sending backup notification...
Daily backup script has finished
Total reclaimed space: 0B
++ head -1 /mnt/docker-aio-config/data/daily_backup_time
+ BACKUP_TIME=04:00
+ export BACKUP_TIME
+ export DAILY_BACKUP=1
+ DAILY_BACKUP=1
++ sed -n 2p /mnt/docker-aio-config/data/daily_backup_time
+ '[' '' '!=' automaticUpdatesAreNotEnabled ']'
+ export AUTOMATIC_UPDATES=1
+ AUTOMATIC_UPDATES=1
++ sed -n 3p /mnt/docker-aio-config/data/daily_backup_time
+ '[' '' '!=' successNotificationsAreNotEnabled ']'
+ export SEND_SUCCESS_NOTIFICATIONS=1
+ SEND_SUCCESS_NOTIFICATIONS=1
+ set +x
Daily backup script has started
Connection to nextcloud-aio-apache (172.18.0.7) 11011 port [tcp/*] succeeded!
Starting mastercontainer update...
(The script might get exited due to that. In order to update all the other containers correctly, you need to run this script with the same settings a second time.)
Waiting for watchtower to stop
Updating container images...
Creating daily backup...
Waiting for backup container to stop
Starting and updating containers...
Waiting for the Nextcloud container to start
Connection to nextcloud-aio-nextcloud (172.18.0.6) 9000 port [tcp/*] succeeded!
Sending backup notification...
Daily backup script has finished
Total reclaimed space: 0B
++ head -1 /mnt/docker-aio-config/data/daily_backup_time
+ BACKUP_TIME=04:00
+ export BACKUP_TIME
+ export DAILY_BACKUP=1
+ DAILY_BACKUP=1
++ sed -n 2p /mnt/docker-aio-config/data/daily_backup_time
+ '[' '' '!=' automaticUpdatesAreNotEnabled ']'
+ export AUTOMATIC_UPDATES=1
+ AUTOMATIC_UPDATES=1
++ sed -n 3p /mnt/docker-aio-config/data/daily_backup_time
+ '[' '' '!=' successNotificationsAreNotEnabled ']'
+ export SEND_SUCCESS_NOTIFICATIONS=1
+ SEND_SUCCESS_NOTIFICATIONS=1
+ set +x

I see export SEND_SUCCESS_NOTIFICATIONS=1

Ok, so notifications seem to be enabled and

Notification was sent.

Did you check already if mail sending works in general for the configured admin user?

See Email — Nextcloud latest Administration Manual latest documentation

Yes. I clicked on “Send an e-mail” in the administration settings - basic settings, and received it

I may have found something unexpected looking at the SMTP server logs:

  • when NC AIO sends e-mail for backup/update it uses one SASL account (HOST@EXAMPLE.COM) → this SASL account is the one used by the local Postfix server to send e-mail to the relayhost
    • this one is OK for site A but not site B
  • when I send an e-mail from inside the NC admin UI, it uses the configured account : SITE-A@EXAMPLE.COM and SITE-B@EXAMPLE.COM

This is unexpected (for me) but may be normal. It doesn’t explain anything for now but it’s a “path”/”lead” (not sure which one to use)

I may have found something, I’ll wait tomorrow to see if it solves the problem

I have found the solution to my problem: my rootless docker container was not allowed to contact the host which runs the SMTP server.

This was not a problem coming from Nextcloud / Nextcloud AIO itself.
But the fact that the e-mails coming from NC itself were working was confusing: it’s simply because NC and the AIO interface use different methods to send e-mails.

Thanks @szaimen for you help.

1 Like

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.