Activity App Not Sending Out Emails About Creation / Deletion of files

Having issues getting the activity app to send out emails about files being created or deleted.

Steps to reproduce

  1. Configured SMTP server in the Admin panel and tested the sending of the email works
  2. Created users. Confirmed that each user received an email about account creation.
  3. Logged in as each user and checked all the boxes in the Notification section
  4. Created a folder as admin and shared it with the users above. Confirmed each received a notification about the file being shared with them.
  5. As admin uploaded some files to the shared folder
  6. Logged in as each user to verify the action was shown on the Activity page

Expected behaviour

Users should receive hourly emails about the files being uploaded to the shared folder.

Actual behaviour

No emails are sent. Instead the following errors appear in the low:

Undefined index: amq_affecteduser at /owncloud/apps/activity/lib/mailqueuehandler.php#80`

Server configuration

Operating system:
QNAP NAS

Database:
SQLite

ownCloud version: (see ownCloud admin page)
8.0.4

Updated from an older ownCloud or fresh install:
fresh

Where did you install ownCloud from:
QNAP App Store

List of activated apps:

  • Activity 1.2.0
  • Deleted Files 0.6.3
  • File Locking
  • Mail Template Editor 0.1
  • PDF VIewer 0.7
  • Pictures 0.6.0
  • Provisioning API 0.2
  • Share Files 0.6.1
  • Text Editor 0.4
  • Updater 0.4
  • Video Viewer 0.1.3

Are you using external storage, if yes which one:
no

Are you using encryption:
no

Are you using an external user-backend, if yes which one:
no

ownCloud log (data/owncloud.log)

{"reqId":"b9a18613afdf8a240266d41798a174da","remoteAddr":"x.x.x.x","app":"PHP","message":"Undefined index: amq_affecteduser at \/share\/CE_CACHEDEV1_DATA\/.qpkg\/owncloud\/owncloud\/apps\/activity\/lib\/mailqueuehandler.php#80","level":3,"time":"2020-04-03T20:21:41+00:00"},
{"reqId":"b9a18613afdf8a240266d41798a174da","remoteAddr":"x.x.x.x","app":"PHP","message":"Undefined index: amq_affecteduser at \/share\/CE_CACHEDEV1_DATA\/.qpkg\/owncloud\/owncloud\/apps\/activity\/lib\/mailqueuehandler.php#80","level":3,"time":"2020-04-03T20:21:41+00:00"},
{"reqId":"b9a18613afdf8a240266d41798a174da","remoteAddr":"x.x.x.x","app":"PHP","message":"Undefined index: amq_affecteduser at \/share\/CE_CACHEDEV1_DATA\/.qpkg\/owncloud\/owncloud\/apps\/activity\/lib\/mailqueuehandler.php#80","level":3,"time":"2020-04-03T20:21:41+00:00"},
{"reqId":"b9a18613afdf8a240266d41798a174da","remoteAddr":"x.x.x.x","app":"PHP","message":"Undefined index: amq_affecteduser at \/share\/CE_CACHEDEV1_DATA\/.qpkg\/owncloud\/owncloud\/apps\/activity\/lib\/mailqueuehandler.php#80","level":3,"time":"2020-04-03T20:21:41+00:00"},
{"reqId":"b9a18613afdf8a240266d41798a174da","remoteAddr":"x.x.x.x","app":"PHP","message":"Undefined index: amq_affecteduser at \/share\/CE_CACHEDEV1_DATA\/.qpkg\/owncloud\/owncloud\/apps\/activity\/lib\/mailqueuehandler.php#80","level":3,"time":"2020-04-03T20:21:41+00:00"},
{"reqId":"b9a18613afdf8a240266d41798a174da","remoteAddr":"x.x.x.x","app":"PHP","message":"Undefined index: amq_affecteduser at \/share\/CE_CACHEDEV1_DATA\/.qpkg\/owncloud\/owncloud\/apps\/activity\/lib\/mailqueuehandler.php#80","level":3,"time":"2020-04-03T20:21:41+00:00"},
{"reqId":"b9a18613afdf8a240266d41798a174da","remoteAddr":"x.x.x.x","app":"PHP","message":"Undefined index: amq_affecteduser at \/share\/CE_CACHEDEV1_DATA\/.qpkg\/owncloud\/owncloud\/apps\/activity\/lib\/mailqueuehandler.php#80","level":3,"time":"2020-04-03T20:21:41+00:00"},
{"reqId":"b9a18613afdf8a240266d41798a174da","remoteAddr":"x.x.x.x","app":"PHP","message":"Undefined index: amq_affecteduser at \/share\/CE_CACHEDEV1_DATA\/.qpkg\/owncloud\/owncloud\/apps\/activity\/lib\/mailqueuehandler.php#80","level":3,"time":"2020-04-03T20:21:41+00:00"},
{"reqId":"b9a18613afdf8a240266d41798a174da","remoteAddr":"x.x.x.x","app":"PHP","message":"Undefined index: amq_affecteduser at \/share\/CE_CACHEDEV1_DATA\/.qpkg\/owncloud\/owncloud\/apps\/activity\/lib\/mailqueuehandler.php#80","level":3,"time":"2020-04-03T20:21:41+00:00"},

Hey,

i think this ASAP needs an update. ownCloud 8.0 seems to be end-of-life since 3 1/2 half years according to:

and currently ownCloud 10.4.0 is the most recent version.

Hey,

i just have found out that the used version 8.0.4 of ownCloud is even nearly 5 years old (released on June 2015).

I think something outdated like this is not something i would trust my files to (even when only running on a NAS / in an internal network). :frowning_face:

Unfortunately I don’t think it is possible to upgrade ownCloud on QNAP as the PHP version on this is also outdated…

1 Like

I wanted to come back and share an actual solution to the problem at hand:

It turns out the issue was a typo in the following file:

/Web/owncloud/apps/activity/lib/mailqueuehandler.php

The error is triggered on line 80 in that file which reads:

$affectedUsers[] = $row['amq_affecteduser'];

Turns out that for some reason “amq_affecteduser” quotation marks around it. So line 80 in the file must look like this:

$affectedUsers[] = $row['"amq_affecteduser"'];

Note how amq_affecteduser is surrounded by single quotes ’ and then double quotes ".

Once you make this small change, the notifications are sent out as normal. Hopefully this will help someone who ran into the same issue.

Thanks to everyone suggesting an upgrade. That’s in the plans, but it can’t be done in place since the Qnap NAS uses an older version of PHP. To run Owncloud X you need to set up a whole new instance using the Docker images and virtualize it via the Qnap Container Station, then migrate all your settings and users and files, which is a whole project in itself. The solution above will let you get the functionality you need in the meantime.