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

External storage broken after upgrade to 19.0.2 #22485

Closed
alexeyvolkoff opened this issue Aug 29, 2020 · 5 comments
Closed

External storage broken after upgrade to 19.0.2 #22485

alexeyvolkoff opened this issue Aug 29, 2020 · 5 comments
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug needs info stale Ticket or PR with no recent activity

Comments

@alexeyvolkoff
Copy link

alexeyvolkoff commented Aug 29, 2020

External storage app fails to display external share after upgrade to 19.0.2.
This directory is unavailable, please check the logs or contact the administrator

Checking storage configuration works fine, grren check displayed. Password is correct.

Log:

OCP\Files\StorageInvalidException: Sabre\HTTP\ClientHttpException: Unauthorized

/var/www/nextcloud/lib/private/Files/Storage/DAV.php - line 246:OC\Files\Storage\DAV->convertException()
/var/www/nextcloud/lib/private/Files/Storage/Common.php - line 878:OC\Files\Storage\DAV->opendir()
<>OC\Files\Storage\Common->getDirectoryContent()
/var/www/nextcloud/lib/private/Files/Cache/Scanner.php - line 408:iterator_to_array()
/var/www/nextcloud/lib/private/Files/Cache/Scanner.php - line 388:OC\Files\Cache\Scanner->handleChildren()
/var/www/nextcloud/lib/private/Files/Cache/Scanner.php - line 340:OC\Files\Cache\Scanner->scanChildren()
/var/www/nextcloud/lib/private/Files/View.php - line 1339:OC\Files\Cache\Scanner->scan()

Call stack from cli:

[root@onmydisk nextcloud]# sudo -u apache php occ files:scan --path=alexey

Starting scan for user 1 out of 1 (alexey)
Exception during scan: Sabre\HTTP\ClientHttpException: Unauthorized
#0 /var/www/nextcloud/lib/private/Files/Storage/DAV.php(246): OC\Files\Storage\DAV->convertException()
#1 /var/www/nextcloud/lib/private/Files/Storage/Common.php(878): OC\Files\Storage\DAV->opendir()
#2 [internal function]: OC\Files\Storage\Common->getDirectoryContent()
#3 /var/www/nextcloud/lib/private/Files/Cache/Scanner.php(408): iterator_to_array()
#4 /var/www/nextcloud/lib/private/Files/Cache/Scanner.php(388): OC\Files\Cache\Scanner->handleChildren()
#5 /var/www/nextcloud/lib/private/Files/Cache/Scanner.php(340): OC\Files\Cache\Scanner->scanChildren()
#6 /var/www/nextcloud/lib/private/Files/Utils/Scanner.php(260): OC\Files\Cache\Scanner->scan()
#7 /var/www/nextcloud/apps/files/lib/Command/Scan.php(151): OC\Files\Utils\Scanner->scan()
#8 /var/www/nextcloud/apps/files/lib/Command/Scan.php(207): OCA\Files\Command\Scan->scanFiles()
#9 /var/www/nextcloud/3rdparty/symfony/console/Command/Command.php(255): OCA\Files\Command\Scan->execute()
#10 /var/www/nextcloud/core/Command/Base.php(169): Symfony\Component\Console\Command\Command->run()
#11 /var/www/nextcloud/3rdparty/symfony/console/Application.php(1012): OC\Core\Command\Base->run()
#12 /var/www/nextcloud/3rdparty/symfony/console/Application.php(272): Symfony\Component\Console\Application->doRunCommand()
#13 /var/www/nextcloud/3rdparty/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun()
#14 /var/www/nextcloud/lib/private/Console/Application.php(215): Symfony\Component\Console\Application->run()
#15 /var/www/nextcloud/console.php(100): OC\Console\Application->run()
#16 /var/www/nextcloud/occ(11): require_once('/var/www/nextcl...')
#17 {main}

Added additional error_log to exception handler:

Sabre\HTTP\ClientHttpException: Unauthorized in /var/www/nextcloud/3rdparty/sabre/http/lib/Client.php:163
Stack trace:
#0 /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Client.php(232): Sabre\HTTP\Client->send()
#1 /var/www/nextcloud/lib/private/Files/Storage/DAV.php(226): Sabre\DAV\Client->propFind()
#2 /var/www/nextcloud/lib/private/Files/Storage/Common.php(878): OC\Files\Storage\DAV->opendir()
#3 [internal function]: OC\Files\Storage\Common->getDirectoryContent()
#4 /var/www/nextcloud/lib/private/Files/Cache/Scanner.php(408): iterator_to_array()
#5 /var/www/nextcloud/lib/private/Files/Cache/Scanner.php(388): OC\Files\Cache\Scanner->handleChildren()
#6 /var/www/nextcloud/lib/private/Files/Cache/Scanner.php(340): OC\Files\Cache\Scanner->scanChildren()
#7 /var/www/nextcloud/lib/private/Files/Utils/Scanner.php(260): OC\Files\Cache\Scanner->scan()
#8 /var/www/nextcloud/apps/files/lib/Command/Scan.php(151): OC\Files\Utils\Scanner->scan()
#9 /var/www/nextcloud/apps/files/lib/Command/Scan.php(207): OCA\Files\Command\Scan->scanFiles()
#10 /var/www/nextcloud/3rdparty/symfony/console/Command/Command.php(255): OCA\Files\Command\Scan->execute()
#11 /var/www/nextcloud/core/Command/Base.php(169): Symfony\Component\Console\Command\Command->run()
#12 /var/www/nextcloud/3rdparty/symfony/console/Application.php(1012): OC\Core\Command\Base->run()
#13 /var/www/nextcloud/3rdparty/symfony/console/Application.php(272): Symfony\Component\Console\Application->doRunCommand()
#14 /var/www/nextcloud/3rdparty/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun()
#15 /var/www/nextcloud/lib/private/Console/Application.php(215): Symfony\Component\Console\Application->run()
#16 /var/www/nextcloud/console.php(100): OC\Console\Application->run(

Checked credentials - OK.
Checked server logs on the other side - digest authorization OK.

UPDATE. New findings:

Looks like Sabre http client error handling is broken. I have added error_log to error handling block in
3rdparty/sabre/http/lib/Client.php, line 142:

// This was a HTTP error
                if ($code >= 400) {
                    $this->emit('error', [$request, $response, &$retry, $retryCount]);
                    $this->emit('error:'.$code, [$request, $response, &$retry, $retryCount]);
                    error_log("error: $code $retry $retryCount");
                }

And this is what I got:

error: 401  0
Sabre\HTTP\ClientHttpException: Unauthorized in /var/www/nextcloud/3rdparty/sabre/http/lib/Client.php:164
Stack trace:
#0 /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Client.php(232): Sabre\HTTP\Client->send()
....skipped

When client receives 401 response, it should add auth header and resend the request. As I see on the remote side, it does not happen. According to debug output, $retry is 0, $retryCount is missing. So the request is not being re-sent and the exception is thrown here:

if ($this->throwExceptions && $code >= 400) {
            throw new ClientHttpException($response);
        }

It is definitely a bug.

Steps to reproduce

  1. Upgrade to 19.0.2

Operating system:
Centos

Web server:
nginx v1.16.1

Database:
MariaDB v.5.5.65

PHP version:
7.4.7

Nextcloud version: (see Nextcloud admin page)
19.0.2

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

Signing status:

Signing status ``` Login as admin user into your Nextcloud and access http://example.com/index.php/settings/integrity/failed paste the results here. ``` No errors have been found.

List of activated apps:

App list
If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
from within your Nextcloud installation folder

[root@onmydisk nextcloud]# sudo -u apache php occ app:list
Enabled:

  • accessibility: 1.5.0
  • activity: 2.12.0
  • admin_audit: 1.9.0
  • bruteforcesettings: 1.6.0
  • cloud_federation_api: 1.2.0
  • comments: 1.9.0
  • contactsinteraction: 1.0.0
  • dav: 1.15.0
  • documentserver_community: 0.1.7
  • federatedfilesharing: 1.9.0
  • federation: 1.9.0
  • files: 1.14.0
  • files_external: 1.10.0
  • files_pdfviewer: 1.8.0
  • files_rightclick: 0.16.0
  • files_sharing: 1.11.0
  • files_trashbin: 1.9.0
  • files_versions: 1.12.0
  • files_videoplayer: 1.8.0
  • firstrunwizard: 2.8.0
  • logreader: 2.4.0
  • lookup_server_connector: 1.7.0
  • mail: 1.4.1
  • nextcloud_announcements: 1.8.0
  • notifications: 2.7.0
  • oauth2: 1.7.0
  • onlyoffice: 4.3.0
  • password_policy: 1.9.1
  • photos: 1.1.0
  • privacy: 1.3.0
  • provisioning_api: 1.9.0
  • recommendations: 0.7.0
  • serverinfo: 1.9.0
  • settings: 1.1.0
  • sharebymail: 1.9.0
  • socialsharing_facebook: 2.1.0
  • socialsharing_twitter: 2.1.0
  • spreed: 9.0.3
  • support: 1.2.1
  • survey_client: 1.7.0
  • systemtags: 1.9.0
  • text: 3.0.1
  • theming: 1.10.0
  • twofactor_backupcodes: 1.8.0
  • updatenotification: 1.9.0
  • user_external: 0.10.0
  • viewer: 1.3.0
  • workflowengine: 2.1.0
    Disabled:
  • encryption
  • user_ldap

Nextcloud configuration:

Config report
If you have access to your command line run e.g.:
sudo -u www-data php occ config:list system
from within your Nextcloud installation folder

or 

Insert your config.php content here. 
Make sure to remove all sensitive content such as passwords. (e.g. database password, passwordsalt, secret, smtp password, …)

Are you using external storage, if yes which one: local/smb/sftp/...
WebDAV

Are you using encryption: yes/no
No

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...

@alexeyvolkoff alexeyvolkoff added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Aug 29, 2020
@stanelie
Copy link

stanelie commented Sep 9, 2020

I have the same issue.
I can work around it by replacing the apps/files_external/3rdparty/icewind/smb folder with the one from Nextcloud version 18.0.3. No idea what side effects this could have.

Here is where I learned to do that, this problem has been around for a while :
#20622

@alexeyvolkoff
Copy link
Author

alexeyvolkoff commented Sep 16, 2020

@stanelie thanks for your response, but i'm not sure if SMB issue is relevant, as you downgraded the SMB code to workaround. Mine is related to WebDAV storage. @icewind1991 can you please check if the latest files_external app works with some vanilla WebDAV server?

@maurocampanelli
Copy link

maurocampanelli commented Sep 18, 2020

I have the same issue.
I can work around it by replacing the apps/files_external/3rdparty/icewind/smb folder with the one from Nextcloud version 18.0.3. No idea what side effects this could have.

Here is where I learned to do that, this problem has been around for a while :
#20622

Workaround works for me but I had to overwrite two folders:
apps/files_external/3rdparty/icewind/smb
apps/files_external/lib
I had issues using Ubuntu 16.04 and 20.04 after Nextcloud upgrade from 18 to 19 and new test installs on Ubuntu 20.04 and Centos 8 installing and configuring Nextcloud 19 from scratch.
I authenticate users against Active Directory, mount shares in SMB/CIFS and the issue is that some of their folders (Documents and Desktop) are not accessible but existing files are writable and I can create files in the parent folder where Documents and Desktop are stored.
Well, again, this workaround works for me ... I hope it lasts.

@szaimen
Copy link
Contributor

szaimen commented Jun 11, 2021

Is this Issue still valid in NC21.0.2? If not, please close this issue. Thanks! :)

@ghost
Copy link

ghost commented Jul 11, 2021

This issue has been automatically marked as stale because it has not had recent activity and seems to be missing some essential information. It will be closed if no further activity occurs. Thank you for your contributions.

@ghost ghost added the stale Ticket or PR with no recent activity label Jul 11, 2021
@ghost ghost closed this as completed Jul 25, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug needs info stale Ticket or PR with no recent activity
Projects
None yet
Development

No branches or pull requests

4 participants