nextcloud / user_external

👥 External user authentication methods like IMAP, SMB and FTP
https://apps.nextcloud.com/apps/user_external
108 stars 64 forks source link

Errors when external user shares a file with another external user (and related functions) #124

Closed cscognamiglio closed 4 years ago

cscognamiglio commented 4 years ago

Steps to reproduce

  1. Install nexcloud
  2. activate and configure user_external
  3. login with an external user, try to share a file with another user

Expected behaviour

File is shared between users and visual confirmation on the web app works

Actual behaviour

The file/dir is shared but an error is logged and the web UI shows a notification saying that a problem as occurred. In reality the file has been shared correctly and I have to reload the page (refresh with the browser) to see it.

Peeking into the source code (after I had a look at the logs) I found:

$userFolder = $this->root->getUserFolder($userId);
$file = $userFolder->getById($fileId)[0];

Is failing (index 0 not found). So I am wondering if it has something to do with UID not found on the internal users table.

Affected Authentication backend

HTTP Basic authentication

Server configuration

Operating system: Docker on CentOS 7

Web server: Nginx

Database: Mysql 8.0.19

PHP version: 7.3.14

Nextcloud version: (see Nextcloud admin page) 18.0.0

Updated from an older Nextcloud/ownCloud or fresh install: Fresh install

Where did you install Nextcloud from: Docker official image

Nextcloud log (data/nextcloud.log)

Nextcloud log ``` {"reqId":"LlYNUPEAEDhpD9uaLExe","level":3,"time":"2020-02-05T14:25:44+00:00","remoteAddr":"x.y.z.t","user":"user@example.com","app":"PHP","method":"POST","url":"/ocs/v2.php/apps/files_sharing/api/v1/shares","message":"Undefined offset: 0 at /var/www/html/custom_apps/maps/lib/Service/PhotofilesService.php#106","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:72.0) Gecko/20100101 Firefox/72.0","version":"18.0.0.10"} ```
violoncelloCH commented 4 years ago

can you verify if disabling the maps app fixes the issue? if not, can you check if sharing between two "normal" users works?

cscognamiglio commented 4 years ago

Hi, thanks for the fast reply. I seem to have solved the issue, I have done a number of things as this was a fresh installation that I am still tuning. I am not sure which one fixed it. What I did:

And now it seems to work. I enabled debug level in logs and I am seeing a lot of warnings but nothing related to this issue that seems to be fixed.

Apologies if this seems now to be "noise" but I think it would have been helpful if I had seen more meaningful messages (from nextcloud or maybe the plugin if it was related to it...).

If the issue was because some user didn't have an email setup or because the SMTP server wasn't setup, well, I didn't see any error that was clearly saying so...

my 2 cents!

violoncelloCH commented 4 years ago

yes, of course, log output could always be improved (it's rather a question about time/resource and priorities though...) thank you anyway for your report; let's close this as it's working for you again :)