Skip to content

OpenStack Swift external storage broke after upgrade to 14.0.0 #11264

Description

@mlanner

Steps to reproduce

  1. Upgrade from 13.0.0 to 14.0.0
  2. Try to load external storage folders with Swift as backend

Expected behaviour

Should be able to access files

Actual behaviour

Complains that the setup is incorrect. This worked fine in 13.0.0. It appears that the new OpenStack v3 integration has broken previous v2 integration.

Server configuration

Operating system: Ubuntu 16.04.5

Web server: Apache2

Database: MySQL 5.7

PHP version: 7.0

Nextcloud version: (see Nextcloud admin page)

Updated from an older Nextcloud/ownCloud or fresh install: Upgrade from NC

Where did you install Nextcloud from: Zip

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.

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

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: Swift

Are you using encryption: no

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

LDAP configuration (delete this part if not used)

LDAP config
With access to your command line run e.g.:
sudo -u www-data php occ ldap:show-config
from within your Nextcloud installation folder

Without access to your command line download the data/owncloud.db to your local
computer or access your SQL server remotely and run the select query:
SELECT * FROM `oc_appconfig` WHERE `appid` = 'user_ldap';


Eventually replace sensitive data as the name/IP-address of your LDAP server or groups.

Client configuration

Browser:

Operating system:

Logs

Web server error log

Web server error log
Insert your webserver log here

Nextcloud log (data/nextcloud.log)

Nextcloud log
Insert your Nextcloud log here

Browser log

Browser log
Insert your browser log here, this could for example include:

a) The javascript console log
b) The network log
c) ...

Activity

  1. mlanner commented on Sep 18, 2018

    @mlanner
    Author

    Also, when clicking on the folder (in pink) the following message appears:

    There was an error with message: Empty response from the server. Do you want to review mount point config in personal settings page?

    If one clicks on the "OK" button, it simply sends me back to the folder list and not to the "mount point config in personal settings page" as expected.

    I have also confirmed that the Nextcloud server can reach the Swift cluster just fine.

  2. nextcloud-bot commented on Sep 18, 2018

    @nextcloud-bot
    Member

    GitMate.io thinks possibly related issues are #4730 (Storage), #3789 (External storage), #11225 (PHP Fatal error after upgrade to 14.0.0), #8041 ([primary storage on Openstack swift] Update to 12.0.5 / 13RC breaks Nextcloud), and #1282 ( Authentication problem after upgrade to 10.0.0).

  3. mlanner commented on Sep 18, 2018

    @mlanner
    Author

    None of the above bot-suggested tickets appear to be relevant.

  4. teleassist commented on Oct 16, 2018

    @teleassist

    Same issue for me, i've got this message from command line updater :

    Nextcloud or one of the apps require upgrade - only a limited number of commands are available You may use your browser or the occ upgrade command to do the upgrade Set log level to debug Updating database schema Updated database Checking for update of app activity in appstore An unhandled exception has been thrown: Error: Call to undefined method GuzzleHttp\Client::request() in /var/www/nextcloud/3rdparty/php-opencloud/openstack/src/Common/Api/OperatorTrait.php:118 Stack trace: #0 /var/www/nextcloud/3rdparty/php-opencloud/openstack/src/Common/Api/OperatorTrait.php(126): OpenStack\Common\Service\AbstractService->sendRequest(Object(OpenStack\Common\Api\Operation), Array) #1 /var/www/nextcloud/3rdparty/php-opencloud/openstack/src/Identity/v2/Service.php(52): OpenStack\Common\Service\AbstractService->execute(Array, Array) #2 /var/www/nextcloud/lib/private/Files/ObjectStore/SwiftFactory.php(147): OpenStack\Identity\v2\Service->generateToken(Array) #3 /var/www/nextcloud/lib/private/Files/ObjectStore/SwiftFactory.php(117): OC\Files\ObjectStore\SwiftFactory->auth(Object(OpenStack\Identity\v2\Service), '8WcCwwSpbKpm@ht...') #4 /var/www/nextcloud/lib/private/Files/ObjectStore/SwiftFactory.php(189): OC\Files\ObjectStore\SwiftFactory->getClient() #5 /var/www/nextcloud/lib/private/Files/ObjectStore/SwiftFactory.php(177): OC\Files\ObjectStore\SwiftFactory->createContainer() #6 /var/www/nextcloud/lib/private/Files/ObjectStore/Swift.php(57): OC\Files\ObjectStore\SwiftFactory->getContainer() #7 /var/www/nextcloud/lib/private/Files/ObjectStore/Swift.php(89): OC\Files\ObjectStore\Swift->getContainer() #8 /var/www/nextcloud/lib/private/Files/ObjectStore/ObjectStoreStorage.php(276): OC\Files\ObjectStore\Swift->readObject('urn:oid:336') #9 /var/www/nextcloud/lib/private/Files/Storage/Common.php(191): OC\Files\ObjectStore\ObjectStoreStorage->fopen('appdata_oc0lh55...', 'r') #10 /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php(244): OC\Files\Storage\Common->file_get_contents('appdata_oc0lh55...') #11 /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Availability.php(266): OC\Files\Storage\Wrapper\Wrapper->file_get_contents('appdata_oc0lh55...') #12 /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php(244): OC\Files\Storage\Wrapper\Availability->file_get_contents('appdata_oc0lh55...') #13 /var/www/nextcloud/lib/private/Files/View.php(1146): OC\Files\Storage\Wrapper\Wrapper->file_get_contents('appdata_oc0lh55...') #14 /var/www/nextcloud/lib/private/Files/View.php(588): OC\Files\View->basicOperation('file_get_conten...', '/appdata_oc0lh5...', Array) #15 /var/www/nextcloud/lib/private/Files/Node/File.php(52): OC\Files\View->file_get_contents('/appdata_oc0lh5...') #16 /var/www/nextcloud/lib/private/Files/SimpleFS/SimpleFile.php(88): OC\Files\Node\File->getContent() #17 /var/www/nextcloud/lib/private/App/AppStore/Fetcher/Fetcher.php(146): OC\Files\SimpleFS\SimpleFile->getContent() #18 /var/www/nextcloud/lib/private/Installer.php(385): OC\App\AppStore\Fetcher\Fetcher->get() #19 /var/www/nextcloud/lib/private/Updater.php(445): OC\Installer->isUpdateAvailable('activity') #20 /var/www/nextcloud/lib/private/Updater.php(256): OC\Updater->upgradeAppStoreApps(Array) #21 /var/www/nextcloud/lib/private/Updater.php(126): OC\Updater->doUpgrade('14.0.3.0', '13.0.6.1') #22 /var/www/nextcloud/core/Command/Upgrade.php(262): OC\Updater->upgrade() #23 /var/www/nextcloud/3rdparty/symfony/console/Command/Command.php(251): OC\Core\Command\Upgrade->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #24 /var/www/nextcloud/3rdparty/symfony/console/Application.php(946): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #25 /var/www/nextcloud/3rdparty/symfony/console/Application.php(248): Symfony\Component\Console\Application->doRunCommand(Object(OC\Core\Command\Upgrade), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #26 /var/www/nextcloud/3rdparty/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #27 /var/www/nextcloud/lib/private/Console/Application.php(213): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #28 /var/www/nextcloud/console.php(96): OC\Console\Application->run() #29 /var/www/nextcloud/occ(11): require_once('/var/www/nextcl...')

  5. teleassist commented on Oct 30, 2018

    @teleassist

    Any news for this ?

  6. felix-walter commented on Nov 21, 2018

    @felix-walter

    I also encountered this issue today and got the following log message:

    {"reqId":"<redacted>","level":1,"time":"November 21, 2018 21:38:20","remoteAddr":"<redacted>","user":"felix","app":"no app in context","method":"PUT","url":"\/apps\/files_external\/globalstorages\/1","message":"External storage not available: Storage unauthorized. Scope has to be defined for V3 requests","userAgent":"<redacted>","version":"14.0.3.0"}
    

    Searching the last part of the message I found the following commit which is in v14, but not in v13: ba71918

    Thus, the issue seems that we cannot set the required scope in the external storage configuration UI. Strangely, it also does not work when using OpenStack v2 authentication.

  7. pecuna commented on Jan 23, 2019

    @pecuna

    NC 14.0.6 still can not integrate with Openstack Object storage (Mitaka + Ceph Jewel)
    Nothing is showing in logs (NC and Keystone). Identity endpoint is v3.

  8. vpecinka commented on Jan 23, 2019

    @vpecinka
    Contributor

    Hi @teleassist

    this is maybe off topic, but you can run into it later: I noticed you use urn:oid: object prefix. Similar to my case (I have id: prefix for objects). I have other problem and found that there is problem in Guzzlehttp. Maybe this patch (tuned for you) will help you, please try and give me feedback. The problem I found is that the library handles wrongly : in relative urls.

    --- nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php	2019-01-01 03:35:39.796954000 +0100
    +++ nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php	2019-01-01 03:35:39.796954000 +0100
    @@ -142,6 +142,9 @@
     
         private function buildUri($uri, array $config)
         {
    +         // fix by VP
    +         $uri = str_replace("/urn:oid:", "/urn%3Aoid%3A", $uri);
    +
             // for BC we accept null which would otherwise fail in uri_for
             $uri = Psr7\uri_for($uri === null ? '' : $uri);
    
  9. skydiablo commented on Jan 24, 2019

    @skydiablo
    Contributor

    NC 15, same here!

    I also encountered this issue today and got the following log message:

    {"reqId":"<redacted>","level":1,"time":"November 21, 2018 21:38:20","remoteAddr":"<redacted>","user":"felix","app":"no app in context","method":"PUT","url":"\/apps\/files_external\/globalstorages\/1","message":"External storage not available: Storage unauthorized. Scope has to be defined for V3 requests","userAgent":"<redacted>","version":"14.0.3.0"}
    

    Searching the last part of the message I found the following commit which is in v14, but not in v13: ba71918

    Thus, the issue seems that we cannot set the required scope in the external storage configuration UI. Strangely, it also does not work when using OpenStack v2 authentication.

  10. kesselb commented on Jan 24, 2019

    @kesselb
    Contributor

    Yes. There is no option to set the scope.

    new DefinitionParameter('url', $l->t('Identity endpoint URL'))

    If you change the file like below it should be possible to define a scope. Unfortunately I don't have a working test setup for OpenStack 😞

    new DefinitionParameter('url', $l->t('Identity endpoint URL')),
    new DefinitionParameter('scope', $l->t('Scope'))
    
  11. added
    0. Needs triagePending check for reproducibility or if it fits our roadmap
    on Jan 24, 2019
  12. kesselb commented on Jan 24, 2019

    @kesselb
    Contributor
  13. added
    1. to developAccepted and waiting to be taken care of
    and removed
    0. Needs triagePending check for reproducibility or if it fits our roadmap
    on Jan 24, 2019
  14. 15 remaining items

  15. dinacel commented on Feb 17, 2020

    @dinacel

    @remidebette as your the one who verifyed its working can you make a conclusion did you comment out the
    https://github.com/nextcloud/server/blob/master/lib/private/Files/ObjectStore/SwiftFactory.php#L134-L136

    # if (!isset($this->params['scope'])) {
    # throw new StorageAuthException('Scope has to be defined for V3 requests');
    # }
    #
    

    ?
    is it still needed? or do you simply supply a fake scope?

    I can confirm it is still required to comment out these lines because there's no way to set the scope (at least in the external storage GUI).

  16. zizzfizzix commented on Feb 26, 2020

    @zizzfizzix

    is it still needed? or do you simply supply a fake scope?

    I'm using swift as primary storage and setting scope made it work, no need to edit any nextcloud code.

  17. fxeon commented on Feb 27, 2020

    @fxeon

    is it still needed? or do you simply supply a fake scope?

    I'm using swift as primary storage and setting scope made it work, no need to edit any nextcloud code.

    Hi, can you please provide your config.php, i'm stuck with V2 and can't get V3 to work. Thanks

    Edit: I think I got it

      ' objectstore' => array(
             'class' => 'OC\\Files\\ObjectStore\\Swift',
             'arguments' => array(
                     'autocreate' => true,
                     'user' => [
                             'name' => 'MyUserName',
                             'password' => 'SupaStrongPasswd',
                             'domain' => [
                                     'name' => 'Default'
                             ]
                     ],
                     'scope' => [
                             'project' => [
                                     'name' => 'OS_PROJECT_NAME',
                                     'domain' => [
                                             'name' => 'Default',
                                     ],
                             ],
                     ],
                     'serviceName' => 'swift',
                     'region' => 'GRA',
                     'url' => "https://auth.cloud.ovh.net/v3",
                     'bucket' => 'nextcloud'
             )
       ),
    

    I had to clean files in CLI to get it working
    sudo -u www-data php occ files:cleanup

  18. alviss7 commented on Feb 27, 2020

    @alviss7

    Thanks a lot, I managed to make it work with Keystone v3, the mail documentation is confusing, I plan to fix it today as soon as I have time:
    https://docs.nextcloud.com/server/18/admin_manual/configuration_files/primary_storage.html#openstack-swift.

  19. zizzfizzix commented on Feb 27, 2020

    @zizzfizzix

    Edit: I think I got it

      ' objectstore' => array(
             'class' => 'OC\\Files\\ObjectStore\\Swift',
             'arguments' => array(
                     'autocreate' => true,
                     'user' => [
                             'name' => 'MyUserName',
                             'password' => 'SupaStrongPasswd',
                             'domain' => [
                                     'name' => 'Default'
                             ]
                     ],
                     'scope' => [
                             'project' => [
                                     'name' => 'OS_PROJECT_NAME',
                                     'domain' => [
                                             'name' => 'Default',
                                     ],
                             ],
                     ],
                     'serviceName' => 'swift',
                     'region' => 'GRA',
                     'url' => "https://auth.cloud.ovh.net/v3",
                     'bucket' => 'nextcloud'
             )
       ),
    

    Yeah, that's it.

    I had to clean files in CLI to get it working
    sudo -u www-data php occ files:cleanup

    Mine was throwing an error when I left it (late at night), but started working apparently a couple minutes later (as I checked the next day).

  20. fxeon commented on Feb 27, 2020

    @fxeon

    The cleanup part might indeed not be needed. It happened that I could gain access to my nextcloud page right after I did it. Beforehand it kept throwing me "Storage temporarily not available". As it was late as well I didn't investigate any further.

  21. humpfhumpf commented on Feb 27, 2020

    @humpfhumpf

    Please, do not forget that External Storage to OVH is also impacted (the ones configured in database in oc_external_mounts table), and not only Primary Storage.

  22. added this to the Nextcloud 19 milestone on Apr 15, 2020
  23. asve23fq commented on Jan 5, 2021

    @asve23fq

    Hello, after upgrade to Nextcloud 19 OVH external storage stopped working as usual. However, when I selected "External storages" in the Settings I noticed that now there is an additional configuration field: "Tenant:". To find the value I connected to my OVH account, went to Public Cloud project and logged into "Horizon" (Openstack management interface). There I went to the Projects tab. I took 16 digit ID that shows as the name of OVH project and copy/pasted it into the Tenant field in Nextcloud. This worked great and now OVH storage works without any modification of configuration files. So basically it seems to be that the issue described in this topic has been fixed.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    1. to developAccepted and waiting to be taken care ofbug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions