Regarding the OCP\Files\NotFoundException errors while trying to implement Object Storage as primary storage to Nextcloud 17.0.1

Hi, I’m Ikeda from Japan.
Whether you have any solutions or not, I appreciate you
for at least clicking into this topic.

Here is my server’s spec.
Nextcloud 17.0.1
CentOS 7.7 (VPS)
Apache version 2.4.6
PHP version rh-php72

The issues I’m facing is:
I’m trying to implement Object Storage (which is OpenStackSwift base) as primary storage to Nextcloud 17. However, after I “logged in” to Nextcloud, I received an internal server error (details below).

And this is the first time I’ve seen this error.

What I did in order to implement object storage as primary storage to nextcloud and what I’ve done after I met the errors:

There are three big steps

  1. Configuring Object Storage as Primary Storage
  2. Met Internal Server Error, and search for solutions and attempted to solve it
  3. I can managed to access to the login page of nextcloud, but after I logged in, again Internal Server Error.

The differences between step 2’s error and step 3’s error:
In step 2 I can’t even access into nextcloud and the object storage was not connected to nextcloud, and there weren’t any logs left in log application in nextcloud (not meaning CLI in local disk). While in step 3 I can access into nextcloud and even logged into it, and object storage is connected with nextcloud ( I assume, because a lot of oid:urn files have been created), and tons of error logs left in nextcloud after I comment out the object storage related configurations and reboot.

Details:
I copied the template configurations of using object storage as primary storage listed inside the config.sample.php to config.php. My whole configurations of nextcloud are listed below.

#<?php
$CONFIG = array (
‘instanceid’ => ‘xxxxxxxxxxxxxx’,
‘passwordsalt’ => ‘xxxxxxxxxxxx’,
‘secret’ => ‘xxxxxxxxxxxxxxxxxxxxxxxxx’,
‘trusted_domains’ =>
array (
0 => ‘xxxxxxxxxxxxxx.mydns.jp’,
1 => ‘xxxxxxxxxx.local’,
2 => ‘xxxxxxxxxxxx.local’,
),
‘session_lifetime’ => 6015,
‘remember_login_cookie_lifetime’ => 60
60247,
‘session_keepalive’ => true,
‘default_language’ => ‘ja’,
‘default_locale’ => ‘ja_JP’,
‘datadirectory’ => ‘/var/nextcloud/data’,
‘dbtype’ => ‘mysql’,
‘version’ => ‘17.0.1.1’,
‘overwrite.cli.url’ => ‘https://xxxxxxxxxxx.mydns.jp/nextcloud’,
‘dbname’ => ‘nextcloud’,
‘dbhost’ => ‘localhost’,
‘dbport’ => ‘’,
‘dbtableprefix’ => ‘oc_’,
‘mysql.utf8mb4’ => true,
‘dbuser’ => ‘nextcloud’,
‘dbpassword’ => ‘xxxxxxxxxxx’,
‘installed’ => true,
‘maintenance’ => false,
‘onlyoffice’ =>
array (
‘verify_peer_off’ => true,
),
‘ldapIgnoreNamingRules’ => false,
‘ldapProviderFactory’ => ‘OCA\User_LDAP\LDAPProviderFactory’,
‘mail_smtpmode’ => ‘smtp’,
‘mail_smtpsecure’ => ‘ssl’,
‘mail_sendmailmode’ => ‘smtp’,
‘mail_from_address’ => ‘xxxxxxx’,
‘mail_domain’ => ‘xxxxxxx.jp’,
‘mail_smtpauthtype’ => ‘LOGIN’,
‘mail_smtpauth’ => 1,
‘mail_smtphost’ => ‘xxxxxxx.xserver.jp’,
‘mail_smtpport’ => ‘465’,
‘mail_smtpname’ => ‘xxxxxxxxxxxxxxx.jp’,
‘mail_smtppassword’ => ‘xxxxxxxxx’,
‘app_install_overwrite’ =>
array (
0 => ‘ojsxc’,
),
‘objectstore’ => [
‘class’ => ‘OC\Files\ObjectStore\Swift’,
‘arguments’ => [
‘username’ => ‘gncuxxxxxxxxxxx’,
‘password’ => ‘xxxxxxxxxxxxxxxxxxx’,
‘container’ => ‘nextcloud’,
‘objectPrefix’ => ‘oid:urn:’,
‘autocreate’ => true,
‘region’ => ‘tyo1’,
‘url’ => ‘https://identity.tyo1.conoha.io/v2.0’,
‘tenantName’ => ‘gnctxxxxxxxxxxxx’,
‘serviceName’ => ‘Object Storage Service’,
‘urlType’ => ‘publicURL’,

],
],
);

After I edited the config.php, I rebooted the VPS, and found the step 2’s internal server error. Then I did a lot of research and found one solution that I can attempt is:

edit a file called SwiftFactory.php

Path to this file:
nextcloud/lib/private/Files/ObjectStore/SwiftFactory.php

The content of this file:
https://github.com/nextcloud/server/blob/stable14/lib/private/Files/ObjectStore/SwiftFactory.php#L224

The line 224 is the area that I edited, and the changes is:

change $objectStoreService = $client->objectStoreV1();
to $objectStoreService = $client->objectStoreV1($this->params);

unfortunately I’m not familiar with php so I don not know what I’m doing, just followed instructions…Orz

then to add a new configuration to config.php:
‘objectstore’ => [
‘class’ => ‘OC\Files\ObjectStore\Swift’,
‘arguments’ => [
‘catalogName’ => ‘Object Storage Service’, <<<this is what I added
‘username’ => ‘gncuxxxxxx’,
‘password’ => ‘xxxxxxxxxxx’,
‘container’ => ‘nextcloud’,
‘objectPrefix’ => ‘oid:urn:’,
‘autocreate’ => true,
‘region’ => ‘tyo1’,
‘url’ => ‘https://identity.tyo1.conoha.io/v2.0’,
‘tenantName’ => ‘gnctxxxxxxx’,
‘serviceName’ => ‘Object Storage Service’,
‘urlType’ => ‘publicURL’,

],
],

After the editing, I rebooted the VPS, and resulted in step 3’s error.

Nextcloud log:
[index] Error: OCP\Files\NotFoundException: object oid:urn:1094 not found in object store

0. /var/www/html/nextcloud/lib/private/Files/ObjectStore/ObjectStoreStorage.php line 286
OC\Files\ObjectStore\Swift->readObject(“oid:urn:1094”)

  1. /var/www/html/nextcloud/lib/private/Files/Storage/Common.php line 194
    OC\Files\ObjectStore\ObjectStoreStorage->fopen(“appdata_ocodg5n … e”, “r”)
  2. /var/www/html/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php line 245
    OC\Files\Storage\Common->file_get_contents(“appdata_ocodg5n … e”)
  3. /var/www/html/nextcloud/lib/private/Files/Storage/Wrapper/Availability.php line 261
    OC\Files\Storage\Wrapper\Wrapper->file_get_contents(“appdata_ocodg5n … e”)
  4. /var/www/html/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php line 245
    OC\Files\Storage\Wrapper\Availability->file_get_contents(“appdata_ocodg5n … e”)
  5. /var/www/html/nextcloud/apps/files_accesscontrol/lib/StorageWrapper.php line 263
    OC\Files\Storage\Wrapper\Wrapper->file_get_contents(“appdata_ocodg5n … e”)
  6. /var/www/html/nextcloud/lib/private/Files/View.php line 1160
    OCA\FilesAccessControl\StorageWrapper->file_get_contents(“appdata_ocodg5n … e”)
  7. /var/www/html/nextcloud/lib/private/Files/View.php line 595
    OC\Files\View->basicOperation(“file_get_contents”, “/appdata_ocodg5 … e”, [“read”])
  8. /var/www/html/nextcloud/lib/private/Files/Node/File.php line 52
    OC\Files\View->file_get_contents("/appdata_ocodg5 … e")
  9. /var/www/html/nextcloud/lib/private/Files/SimpleFS/SimpleFile.php line 88
    OC\Files\Node\File->getContent()
  10. /var/www/html/nextcloud/lib/private/Template/IconsCacher.php line 110
    OC\Files\SimpleFS\SimpleFile->getContent()
  11. /var/www/html/nextcloud/lib/private/Template/SCSSCacher.php line 336
    OC\Template\IconsCacher->setIconsCss(“html,body,div,s … }”)
  12. /var/www/html/nextcloud/lib/private/Template/SCSSCacher.php line 181
    OC\Template\SCSSCacher->cache("/var/www/html/nextcloud/core/css", “f317-2845-server.css”, “server.scss”, OC\Files\SimpleFS\SimpleFolder {}, “/nextcloud/core/css”)
  13. /var/www/html/nextcloud/lib/private/Template/CSSResourceLocator.php line 109
    OC\Template\SCSSCacher->process("/var/www/html/nextcloud", “core/css/server.scss”, “core”)
  14. /var/www/html/nextcloud/lib/private/Template/CSSResourceLocator.php line 61
    OC\Template\CSSResourceLocator->cacheAndAppendScssIfExist("/var/www/html/nextcloud", “core/css/server.scss”)
  15. /var/www/html/nextcloud/lib/private/Template/ResourceLocator.php line 78
    OC\Template\CSSResourceLocator->doFind(“css/server”)
  16. /var/www/html/nextcloud/lib/private/TemplateLayout.php line 305
    OC\Template\ResourceLocator->find([“css/server”,"c … "])
  17. /var/www/html/nextcloud/lib/private/TemplateLayout.php line 210
    OC\TemplateLayout::findStylesheetFiles([“css/server”,"c … "])
  18. /var/www/html/nextcloud/lib/private/legacy/template.php line 183
    OC\TemplateLayout->__construct(“user”, “files”)
  19. /var/www/html/nextcloud/lib/public/AppFramework/Http/TemplateResponse.php line 165
    OC_Template->fetchPage({usedSpacePercen … ]})
  20. /var/www/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 123
    OCP\AppFramework\Http\TemplateResponse->render()
  21. /var/www/html/nextcloud/lib/private/AppFramework/App.php line 126
    OC\AppFramework\Http\Dispatcher->dispatch(OCA\Files\Controller\ViewController {}, “index”)
  22. /var/www/html/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php line 47
    OC\AppFramework\App::main(“OCA\Files\Controller\ViewController”, “index”, OC\AppFramework\ … {}, {_route: “files.view.index”})
  23. <>
    OC\AppFramework\Routing\RouteActionHandler->__invoke({_route: “files.view.index”})
  24. /var/www/html/nextcloud/lib/private/Route/Router.php line 297
    undefinedundefinedcall_user_func(OC\AppFramework\ … {}, {_route: “files.view.index”})
  25. /var/www/html/nextcloud/lib/base.php line 1000
    OC\Route\Router->match("/apps/files/")
  26. /var/www/html/nextcloud/index.php line 42
    OC::handleRequest()

    GET /nextcloud/index.php/apps/files/
    from xxx.xxx.xxx.xxx by xxxxxxx at 2019-11-28T08:05:01+00:00

    I wanted to include /var/log/httpd/error_log as well but I didn’t find related errors in error_log. Please tell me if I need to provide more informations.

    Again thanks for considering this topic.
    I appreciate for your helps.

    Yours sincerely,

    Ikeda