ownCloud 9.1.5 + SwiftStack


#1

Hi,

I'm trying to set up ownCloud v9.1.5 with a SwiftStack cluster in a demo environment on my laptop. I'm using v2 auth, though without Keystone (our SwiftStackAuth middleware supports v1 and v2 auth). We have internal docs for ownCloud v8.x, which matches the current v9.x docs.

I configured ownCloud and a SwiftStack node on two VMs, logged in as admin user to ownCloud to verify all was working locally, then added an objectstore directive to use as primary storage. I also tried commenting out the datadirectory config as well.

I've verified I can access the owncloud user account in Swift using valid credentials:

$ curl -s http://192.168.56.61/auth/v2.0 -d '{"auth":{"passwordCredentials":{"username":"owncloud","password":"password1"}}}' | json_pp
{
   "access" : {
      "user" : {
         "roles" : [
            {
               "id" : "owncloud",
               "name" : "owncloud"
            },
            {
               "name" : "AUTH_owncloud",
               "id" : "AUTH_owncloud"
            }
         ],
         "name" : "owncloud",
         "id" : "owncloud"
      },
      "serviceCatalog" : [
         {
            "name" : "Swift Object Storage (http://192.168.56.61)",
            "type" : "object-store",
            "endpoints" : [
               {
                  "tenantId" : "AUTH_owncloud",
                  "region" : "default",
                  "versionId" : 1,
                  "publicURL" : "http://192.168.56.61/v1/AUTH_owncloud"
               }
            ]
         }
      ],
      "token" : {
         "id" : "AUTH_tk93bc66d9db8048978a070f449b08058f",
         "expires" : "2017-05-09T14:12:37Z",
         "tenant" : {
            "id" : "AUTH_owncloud",
            "name" : "AUTH_owncloud"
         }
      }
   }
}

Here is the config:

<?php
$CONFIG = array (
  'updatechecker' => false,
  'instanceid' => 'ocu55fa68v1w',
  'passwordsalt' => 'djLAl/8dfEahp3a9l0JQkkhOI04MJF',
  'secret' => 'w5MmLO8jKQKQlFw9jfTd6XmmK8aAfH9L8FbUXKbgbKJQ7HxD',
  'trusted_domains' =>
  array (
    0 => '192.168.56.99',
    1 => 'owncloud.example.com',
  ),
  'datadirectory' => '/var/www/html/owncloud/data',
  'overwrite.cli.url' => 'http://192.168.56.99/owncloud',
  'dbtype' => 'mysql',
  'version' => '9.1.5.2',
  'dbname' => 'owncloud',
  'dbhost' => 'localhost',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'oc_admin',
  'dbpassword' => '+a5W6LvbSrhbTCIcLtpxdvnqDRB4uE',
  'logtimezone' => 'UTC',
  'installed' => true,
  'objectstore' => array(
        'class' => 'OC\\Files\\ObjectStore\\Swift',
        'arguments' => array(
                'username' => 'owncloud',
                'password' => 'password1',
                'container' => 'owncloud',
                'autocreate' => true,
                'region' => 'default',
                'url' => 'http://192.168.56.61/auth/v2.0',
                'tenantName' => 'AUTH_owncloud',
                'serviceName' => 'Swift Object Storage (http://storage.example.com)',
                'urlType' => 'internal'
          ),
    ),
);

When I login as admin, create a folder, and then try to create a text file or drag a file into that folder, ownCloud gives me this error in the GUI:

Error uploading file "file.txt": No endpoints for service type [object-store], name [Swift Object Storage (http://storage.example.com)], region [default] and urlType

The Swift proxy log shows that authentication is taking place, but there are not PUTs or POSTs after that:

2017-05-09T01:37:23.485838+00:00 snode1 proxy-server: 192.168.56.99 192.168.56.99 09/May/2017/01/37/23 POST /auth/v2.0/tokens HTTP/1.0 200 - OpenCloud/1.9.0%20cURL/7.29.0%20PHP/5.4.16 - 108 677 - txf2806641f0464f75864ba-0059111d53 - 0.0608 - - 1494293843.423624039 1494293843.484469891 -

and the owncloud log file shows this:

{"reqId":"WRCyJVPYFccwOLCfH3p-dQAAAAA","remoteAddr":"192.168.56.1","app":"index","message":"Exception: {\"Exception\":\"OpenCloud\\\\Common\\\\Exceptions\\\\EndpointError\",\"Message\":\"No endpoints for service type [object-store], name [Swift Object Storage (http:\\\/\\\/storage.example.com)], region [default] and urlType [internal]\",\"Code\":0,\"Trace\":\"#0 \\\/var\\\/www\\\/html\\\/owncloud\\\/3rdparty\\\/rackspace\\\/php-opencloud\\\/lib\\\/OpenCloud\\\/Common\\\/Service\\\/CatalogService.php(72): OpenCloud\\\\Common\\\\Service\\\\CatalogService->findEndpoint()\\n#1 \\\/var\\\/www\\\/html\\\/owncloud\\\/3rdparty\\\/rackspace\\\/php-opencloud\\\/lib\\\/OpenCloud\\\/ObjectStore\\\/Service.php(43): OpenCloud\\\\Common\\\\Service\\\\CatalogService->__construct(Object(OpenCloud\\\\OpenStack), NULL, 'Swift Object St...', 'default', 'internal')\\n#2 \\\/var\\\/www\\\/html\\\/owncloud\\\/3rdparty\\\/rackspace\\\/php-opencloud\\\/lib\\\/OpenCloud\\\/Common\\\/Service\\\/ServiceBuilder.php(43): OpenCloud\\\\ObjectStore\\\\Service->__construct(Object(OpenCloud\\\\OpenStack), NULL, 'Swift Object St...', 'default', 'internal')\\n#3 \\\/var\\\/www\\\/html\\\/owncloud\\\/3rdparty\\\/rackspace\\\/php-opencloud\\\/lib\\\/OpenCloud\\\/OpenStack.php(459): OpenCloud\\\\Common\\\\Service\\\\ServiceBuilder::factory(Object(OpenCloud\\\\OpenStack), 'OpenCloud\\\\Objec...', Array)\\n#4 \\\/var\\\/www\\\/html\\\/owncloud\\\/lib\\\/private\\\/Files\\\/ObjectStore\\\/Swift.php(85): OpenCloud\\\\OpenStack->objectStoreService('Swift Object St...', 'default', 'internal')\\n#5 \\\/var\\\/www\\\/html\\\/owncloud\\\/lib\\\/private\\\/Files\\\/ObjectStore\\\/Swift.php(112): OC\\\\Files\\\\ObjectStore\\\\Swift->init()\\n#6 \\\/var\\\/www\\\/html\\\/owncloud\\\/lib\\\/private\\\/Files\\\/ObjectStore\\\/ObjectStoreStorage.php(389): OC\\\\Files\\\\ObjectStore\\\\Swift->writeObject('urn:oid:110', Resource id #619)\\n#7 [internal function]: OC\\\\Files\\\\ObjectStore\\\\ObjectStoreStorage->writeBack('\\\/tmp\\\/oc_tmp_gfU...')\\n#8 \\\/var\\\/www\\\/html\\\/owncloud\\\/lib\\\/private\\\/Files\\\/Stream\\\/Close.php(103): call_user_func(Array, '\\\/tmp\\\/oc_tmp_gfU...')\\n#9 [internal function]: OC\\\\Files\\\\Stream\\\\Close->stream_close()\\n#10 \\\/var\\\/www\\\/html\\\/owncloud\\\/apps\\\/files_external\\\/3rdparty\\\/icewind\\\/streams\\\/src\\\/Wrapper.php(124): fclose(Resource id #612)\\n#11 \\\/var\\\/www\\\/html\\\/owncloud\\\/apps\\\/files_external\\\/3rdparty\\\/icewind\\\/streams\\\/src\\\/CallbackWrapper.php(107): Icewind\\\\Streams\\\\Wrapper->stream_close()\\n#12 [internal function]: Icewind\\\\Streams\\\\CallbackWrapper->stream_close()\\n#13 \\\/var\\\/www\\\/html\\\/owncloud\\\/lib\\\/private\\\/Security\\\/CertificateManager.php(128): fclose(Resource id #615)\\n#14 \\\/var\\\/www\\\/html\\\/owncloud\\\/lib\\\/private\\\/Security\\\/CertificateManager.php(205): OC\\\\Security\\\\CertificateManager->createCertificateBundle()\\n#15 \\\/var\\\/www\\\/html\\\/owncloud\\\/lib\\\/private\\\/Http\\\/Client\\\/Client.php(73): OC\\\\Security\\\\CertificateManager->getAbsoluteBundlePath(NULL)\\n#16 \\\/var\\\/www\\\/html\\\/owncloud\\\/lib\\\/private\\\/Http\\\/Client\\\/Client.php(135): OC\\\\Http\\\\Client\\\\Client->setDefaultOptions()\\n#17 \\\/var\\\/www\\\/html\\\/owncloud\\\/settings\\\/Controller\\\/CheckSetupController.php(194): OC\\\\Http\\\\Client\\\\Client->get('https:\\\/\\\/www.own...')\\n#18 \\\/var\\\/www\\\/html\\\/owncloud\\\/settings\\\/Controller\\\/CheckSetupController.php(335): OC\\\\Settings\\\\Controller\\\\CheckSetupController->isUsedTlsLibOutdated()\\n#19 [internal function]: OC\\\\Settings\\\\Controller\\\\CheckSetupController->check()\\n#20 \\\/var\\\/www\\\/html\\\/owncloud\\\/lib\\\/private\\\/AppFramework\\\/Http\\\/Dispatcher.php(159): call_user_func_array(Array, Array)\\n#21 \\\/var\\\/www\\\/html\\\/owncloud\\\/lib\\\/private\\\/AppFramework\\\/Http\\\/Dispatcher.php(89): OC\\\\AppFramework\\\\Http\\\\Dispatcher->executeController(Object(OC\\\\Settings\\\\Controller\\\\CheckSetupController), 'check')\\n#22 \\\/var\\\/www\\\/html\\\/owncloud\\\/lib\\\/private\\\/AppFramework\\\/App.php(99): OC\\\\AppFramework\\\\Http\\\\Dispatcher->dispatch(Object(OC\\\\Settings\\\\Controller\\\\CheckSetupController), 'check')\\n#23 \\\/var\\\/www\\\/html\\\/owncloud\\\/lib\\\/private\\\/AppFramework\\\/Routing\\\/RouteActionHandler.php(46): OC\\\\AppFramework\\\\App::main('CheckSetupContr...', 'check', Object(OC\\\\AppFramework\\\\DependencyInjection\\\\DIContainer), Array)\\n#24 [internal function]: OC\\\\AppFramework\\\\Routing\\\\RouteActionHandler->__invoke(Array)\\n#25 \\\/var\\\/www\\\/html\\\/owncloud\\\/lib\\\/private\\\/Route\\\/Router.php(280): call_user_func(Object(OC\\\\AppFramework\\\\Routing\\\\RouteActionHandler), Array)\\n#26 \\\/var\\\/www\\\/html\\\/owncloud\\\/lib\\\/base.php(891): OC\\\\Route\\\\Router->match('\\\/settings\\\/ajax\\\/...')\\n#27 \\\/var\\\/www\\\/html\\\/owncloud\\\/index.php(54): OC::handleRequest()\\n#28 {main}\",\"File\":\"\\\/var\\\/www\\\/html\\\/owncloud\\\/3rdparty\\\/rackspace\\\/php-opencloud\\\/lib\\\/OpenCloud\\\/Common\\\/Service\\\/CatalogService.php\",\"Line\":196}","level":3,"time":"2017-05-08T18:00:07+00:00","method":"GET","url":"\/owncloud\/index.php\/settings\/ajax\/checksetup","user":"admin"}
{"reqId":"WRCySXOqwCadbt1ORs--ygAAAAQ","remoteAddr":"192.168.56.1","app":"objectstore","message":"Could not create object: No endpoints for service type [object-store], name [Swift Object Storage (http:\/\/storage.example.com)], region [default] and urlType [internal]","level":3,"time":"2017-05-08T18:00:41+00:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php","user":"admin"}
{"reqId":"WRDBO-J1LW9T7dMG5Mq62QAAAAQ","remoteAddr":"192.168.56.1","app":"objectstore","message":"Could not create object: No endpoints for service type [object-store], name [Swift Object Storage (http:\/\/storage.example.com)], region [default] and urlType [internal]","level":3,"time":"2017-05-08T19:04:27+00:00","method":"POST","url":"\/owncloud\/index.php\/apps\/files\/ajax\/upload.php","user":"admin"}

I don't understand why it's saying there's no endpoints. I checked the payload with tcpdump and Swiftstack is certainly replying with the v2 token/endpoint/auth info.

Also, the integrity URL output from logged in admin user says "No errors have been found."

Suggestions?