Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No notification send for upload on public share #2931

Closed
sebasbaumh opened this issue Jan 4, 2017 · 1 comment
Closed

No notification send for upload on public share #2931

sebasbaumh opened this issue Jan 4, 2017 · 1 comment

Comments

@sebasbaumh
Copy link

Steps to reproduce

  1. Create a new Folder UploadTest.
  2. Share it via link and allow only uploading files, enable password protection.
  3. Enable mail and stream notifications for this user in his personal activity settings.
  4. Access this link from another browser/computer and upload a small test file.

Expected behaviour

The user gets notified via mail and the uploaded file shows up in his activity thread.

Actual behaviour

No notification is send to the user and the activities view of the folder does not list the change.
Nevertheless the uploaded file is visible and accessible - there is just no notice for the user (whether via mail or in his activity thread).

To me it just looks like the file author is NULL because the file is uploaded using a public link without a logged in user. In consequence the check for the author fails.
So either you have to permit NULL as an author, create a anonymous/public author to be set or set the owner as author. Though the last one would be pretty confusing for the owner himself as the uploader usually will not be the owner himself.

Server configuration

Operating system:
Ubuntu 16.10 (GNU/Linux 4.8.0-22-generic x86_64)
Web server:
Apache 2.4.18-2
Database:
PostgreSQL 9.5
PHP version:
7.0.8-3
Nextcloud version: (see Nextcloud admin page)
11.0.0 (stable)
Updated from an older Nextcloud/ownCloud or fresh install:
Updated from 10.0.0 (stable)
Where did you install Nextcloud from:

Signing status:

Signing status
No errors have been found.

List of activated apps:

App list
Enabled:
  - activity: 2.4.1
  - comments: 1.1.0
  - dav: 1.1.1
  - federatedfilesharing: 1.1.1
  - files: 1.6.1
  - files_pdfviewer: 1.0.1
  - files_retention: 1.0.1
  - files_sharing: 1.1.1
  - files_texteditor: 2.2
  - files_trashbin: 1.1.0
  - files_versions: 1.4.0
  - files_videoplayer: 1.0.0
  - logreader: 2.0.0
  - lookup_server_connector: 1.0.0
  - nextcloud_announcements: 1.0
  - notifications: 1.0.1
  - password_policy: 1.1.0
  - provisioning_api: 1.1.0
  - serverinfo: 1.1.1
  - sharebymail: 1.0.1
  - systemtags: 1.1.3
  - theming: 1.1.1
  - twofactor_backupcodes: 1.0.0
  - updatenotification: 1.1.1
  - workflowengine: 1.1.1
Disabled:
  - admin_audit
  - encryption
  - external
  - federation
  - files_accesscontrol
  - files_automatedtagging
  - files_external
  - firstrunwizard
  - gallery
  - survey_client
  - templateeditor
  - user_external
  - user_ldap
  - user_saml

The content of config/config.php:

Config report
{
    "system": {
        "instanceid": "oc9z8o8yb8dz",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "***REMOVED SENSITIVE VALUE***"
        ],
        "datadirectory": "\/var\/www\/nextcloud\/data",
        "skeletondirectory": "",
        "overwrite.cli.url": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "pgsql",
        "version": "11.0.0.10",
        "dbname": "nextcloud",
        "dbhost": "localhost",
        "dbport": "",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "logtimezone": "UTC",
        "installed": true,
        "mail_from_address": "nextcloud",
        "mail_smtpmode": "smtp",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "25",
        "maintenance": false,
        "loglevel": 2
    }
}

Are you using external storage, if yes which one: local/smb/sftp/...
no
Are you using encryption: yes/no
no
Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...
no

Client configuration

Browser:
Chrome Version 55.0.2883.87 m (64-bit)
Operating system:
Windowx 7 x64

Logs

Web server error log

Web server error log (no entries)
(no entries)

Nextcloud log (data/nextcloud.log)

Nextcloud log (clear text)
Error	no app in context	InvalidArgumentException: The given author user is invalidN;
/var/www/nextcloud/apps/activity/lib/FilesHooks.php - line 889: OC\Activity\Event->setAuthor(NULL)
/var/www/nextcloud/apps/activity/lib/FilesHooks.php - line 182: OCA\Activity\FilesHooks->addNotificationsForUser('admin', 'created_public', Array, 140, '/UploadTest/Tor...', true, true, '3600', 'file_created')
/var/www/nextcloud/apps/activity/lib/FilesHooks.php - line 113: OCA\Activity\FilesHooks->addNotificationsForFileAction('/UploadTest/Tor...', 'file_created', '', 'created_public')
/var/www/nextcloud/apps/activity/lib/FilesHooksStatic.php - line 45: OCA\Activity\FilesHooks->fileCreate('/UploadTest//To...')
/var/www/nextcloud/lib/private/legacy/hook.php - line 106: OCA\Activity\FilesHooksStatic fileCreate(Array)
/var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php - line 283: OC_Hook emit('OC_Filesystem', 'post_create', Array)
/var/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php - line 215: OCA\DAV\Connector\Sabre\File->emitPostHooks(false)
/var/www/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php - line 137: OCA\DAV\Connector\Sabre\File->put(Resource id #74)
/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 1072: OCA\DAV\Connector\Sabre\Directory->createFile('TortoiseSVN-1.9...', Resource id #74)
/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php - line 525: Sabre\DAV\Server->createFile('TortoiseSVN-1.9...', Resource id #74, NULL)
[internal function] Sabre\DAV\CorePlugin->httpPut(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
/var/www/nextcloud/3rdparty/sabre/event/lib/EventEmitterTrait.php - line 105: call_user_func_array(Array, Array)
/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 479: Sabre\Event\EventEmitter->emit('method PUT', Array)
/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - line 254: Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
/var/www/nextcloud/apps/dav/appinfo/v1/publicwebdav.php - line 104: Sabre\DAV\Server->exec()
/var/www/nextcloud/public.php - line 77: require_once('/var/www/nextcl...')
{main}
Nextcloud log (data/nextcloud.log)
{"reqId":"PsFqgxjQrKfkYwvZzE9L","remoteAddr":"46.237.208.78","app":"no app in context","message":"Exception: {\"Exception\":\"InvalidArgumentException\",\"Message\":\"The given author user is invalidN;\",\"Code\":0,\"Trace\":\"#0 \\\/var\\\/www\\\/nextcloud\\\/apps\\\/activity\\\/lib\\\/FilesHooks.php(889): OC\\\\Activity\\\\Event->setAuthor(NULL)\\n#1 \\\/var\\\/www\\\/nextcloud\\\/apps\\\/activity\\\/lib\\\/FilesHooks.php(182): OCA\\\\Activity\\\\FilesHooks->addNotificationsForUser('admin', 'created_public', Array, 140, '\\\/UploadTest\\\/Tor...', true, true, '3600', 'file_created')\\n#2 \\\/var\\\/www\\\/nextcloud\\\/apps\\\/activity\\\/lib\\\/FilesHooks.php(113): OCA\\\\Activity\\\\FilesHooks->addNotificationsForFileAction('\\\/UploadTest\\\/Tor...', 'file_created', '', 'created_public')\\n#3 \\\/var\\\/www\\\/nextcloud\\\/apps\\\/activity\\\/lib\\\/FilesHooksStatic.php(45): OCA\\\\Activity\\\\FilesHooks->fileCreate('\\\/UploadTest\\\/\\\/To...')\\n#4 \\\/var\\\/www\\\/nextcloud\\\/lib\\\/private\\\/legacy\\\/hook.php(106): OCA\\\\Activity\\\\FilesHooksStatic::fileCreate(Array)\\n#5 \\\/var\\\/www\\\/nextcloud\\\/apps\\\/dav\\\/lib\\\/Connector\\\/Sabre\\\/File.php(283): OC_Hook::emit('OC_Filesystem', 'post_create', Array)\\n#6 \\\/var\\\/www\\\/nextcloud\\\/apps\\\/dav\\\/lib\\\/Connector\\\/Sabre\\\/File.php(215): OCA\\\\DAV\\\\Connector\\\\Sabre\\\\File->emitPostHooks(false)\\n#7 \\\/var\\\/www\\\/nextcloud\\\/apps\\\/dav\\\/lib\\\/Connector\\\/Sabre\\\/Directory.php(137): OCA\\\\DAV\\\\Connector\\\\Sabre\\\\File->put(Resource id #74)\\n#8 \\\/var\\\/www\\\/nextcloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(1072): OCA\\\\DAV\\\\Connector\\\\Sabre\\\\Directory->createFile('TortoiseSVN-1.9...', Resource id #74)\\n#9 \\\/var\\\/www\\\/nextcloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/CorePlugin.php(525): Sabre\\\\DAV\\\\Server->createFile('TortoiseSVN-1.9...', Resource id #74, NULL)\\n#10 [internal function]: Sabre\\\\DAV\\\\CorePlugin->httpPut(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#11 \\\/var\\\/www\\\/nextcloud\\\/3rdparty\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n#12 \\\/var\\\/www\\\/nextcloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(479): Sabre\\\\Event\\\\EventEmitter->emit('method:PUT', Array)\\n#13 \\\/var\\\/www\\\/nextcloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(254): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#14 \\\/var\\\/www\\\/nextcloud\\\/apps\\\/dav\\\/appinfo\\\/v1\\\/publicwebdav.php(104): Sabre\\\\DAV\\\\Server->exec()\\n#15 \\\/var\\\/www\\\/nextcloud\\\/public.php(77): require_once('\\\/var\\\/www\\\/nextcl...')\\n#16 {main}\",\"File\":\"\\\/var\\\/www\\\/nextcloud\\\/lib\\\/private\\\/Activity\\\/Event.php\",\"Line\":165}","level":3,"time":"2017-01-04T08:50:55+00:00","method":"PUT","url":"\/nextcloud\/public.php\/webdav\/TortoiseSVN-1.9.5-de.pdf","user":"--","version":"11.0.0.10"}
@MorrisJobke
Copy link
Member

cc @nickvergessen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants