Full reinstall of Nextcloud

Now there is a new problem. I can no longer create documents in the NC and I can no longer see the previous documents in the view under the item Files.
When creating a new document I get the error message

New file cannot be created from template.

Is there a way to completely uninstall NC and Onlyoffice and then reinstall them without having to rebuild the whole server?

Maybe it’s just the file you replaced, let’s try to copy it back first:

cp mimetypelist.js /usr/share/nextcloud/core/js/

Reinstall:

WARNING! Nextcloud/Onlyoffice config/data will be lost.

Onlyoffice full removal:

supervisorctl stop ds:
su - postgres -c "psql -c 'drop database onlyoffice;'"
su - postgres -c "psql -c 'drop role onlyoffice;'"
yum -y remove onlyoffice-documentserver nethserver-onlyoffice
rm -rf /etc/onlyoffice
rm -rf /etc/yum.repos.d/onlyoffice*
rm -rf /var/lib/nethserver/secrets/onlyoffice*
rm -rf /var/lib/onlyoffice
config delete fw_onlyoffice

The full NC reinstall is explained here.

1 Like

So, I reinstalled Nextcloud. How do I now get the integration into LDAP from the Nethserver? And what is this message that SQL Lite is used?


I think something went wrong, maybe the database wasn’t removed?

EDIT:

You may try to reconfigure Nextcloud by

signal-event nethserver-nextcloud-update

Do you see errors in /var/log/messages?

EDIT:

I think I found it. The uninstall order is wrong in the docs, I need to change that…
The socket to connect to remove the DB isn’t there anymore because Nextcloud was uninstalled before:

[root@testserver2 ~]# /opt/rh/rh-mariadb105/root/bin/mysql --socket="/var/run/rh-mariadb105-mariadb/nextcloud-mysql.sock" -e "drop database nextcloud;" ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/rh-mariadb105-mariadb/nextcloud-mysql.sock' (2)

Please remove the database first, should be possible now with installed NC:

/opt/rh/rh-mariadb105/root/bin/mysql --socket="/var/run/rh-mariadb105-mariadb/nextcloud-mysql.sock" -e "drop database nextcloud;"

and then follow the rest of the uninstall steps again or just recreate the DB:

signal-event nethserver-nextcloud-update

4 Likes

mrmarkuz, thank you.

Nextcloud is up again And it looks like everything is working again. I will start to install Onlyoffice now.

1 Like

Hi mrmarkuz,

i need your help again. Onlyoffice wont work correct and produce many errors lik this in the NC Log. It is impossible to get a connection to Onlyoffice Server

Error onlyoffice OCP\Http\Client\LocalServerException: Host violates local access rules
/usr/share/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php - line 136:

OC\Http\Client\LocalAddressChecker->ThrowIfLocalIp(“192.168.134.1”)

/usr/share/nextcloud/3rdparty/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php - line 64:

OC\Http\Client\DnsPinMiddleware->OC\Http\Client{closure}("*** sensiti … *")

/usr/share/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php - line 31:

GuzzleHttp\PrepareBodyMiddleware->__invoke("*** sensiti … ", "** sensiti … *")

/usr/share/nextcloud/3rdparty/guzzlehttp/guzzle/src/RedirectMiddleware.php - line 71:

GuzzleHttp\Middleware::GuzzleHttp{closure}("*** sensiti … *")

/usr/share/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php - line 63:

GuzzleHttp\RedirectMiddleware->__invoke("*** sensiti … ", "** sensiti … *")

/usr/share/nextcloud/3rdparty/guzzlehttp/guzzle/src/HandlerStack.php - line 75:

GuzzleHttp\Middleware::GuzzleHttp{closure}("*** sensiti … *")

/usr/share/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php - line 331:

GuzzleHttp\HandlerStack->__invoke("*** sensiti … ", "** sensiti … *")

/usr/share/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php - line 168:

GuzzleHttp\Client->transfer("*** sensiti … ", "** sensiti … *")

/usr/share/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php - line 187:

GuzzleHttp\Client->requestAsync(“post”, GuzzleHttp\Psr7\Uri {}, { 0: "And 6 … e})

/usr/share/nextcloud/lib/private/Http/Client/Client.php - line 294:

GuzzleHttp\Client->request(“post”, “https://tea … x”, { 0: "And 2 … "})

/usr/share/nextcloud/apps/onlyoffice/lib/documentservice.php - line 362:

OC\Http\Client\Client->post(“https://tea … x”, { timeout: " … e})

/usr/share/nextcloud/apps/onlyoffice/lib/documentservice.php - line 171:

OCA\Onlyoffice\DocumentService->Request(“https://tea … x”, “post”, { timeout: " … e})

/usr/share/nextcloud/apps/onlyoffice/lib/documentservice.php - line 90:

OCA\Onlyoffice\DocumentService->SendRequestToConvertService(“https://clo … Y”, “pdf”, “jpeg”, “3034655534”, false)

/usr/share/nextcloud/apps/onlyoffice/lib/preview.php - line 269:

OCA\Onlyoffice\DocumentService->GetConvertedUri(“https://clo … Y”, “pdf”, “jpeg”, “3034655534”)

/usr/share/nextcloud/lib/private/Preview/ProviderV1Adapter.php - line 53:

OCA\Onlyoffice\Preview->getThumbnail(“Heimliche-A … f”, 4096, 4096, false, OC\Files\View {})

/usr/share/nextcloud/lib/private/Preview/GeneratorHelper.php - line 62:

OC\Preview\ProviderV1Adapter->getThumbnail(OC\Files\Node\File {}, 4096, 4096)

/usr/share/nextcloud/lib/private/Preview/Generator.php - line 245:

OC\Preview\GeneratorHelper->getThumbnail(OC\Preview\ProviderV1Adapter {}, OC\Files\Node\File {}, 4096, 4096)

/usr/share/nextcloud/lib/private/Preview/Generator.php - line 140:

OC\Preview\Generator->getMaxPreview(OC\Files\Sim … {}, OC\Files\Node\File {}, “application/pdf”, “”)

/usr/share/nextcloud/lib/private/Preview/Generator.php - line 109:

OC\Preview\Generator->generatePreviews(OC\Files\Node\File {}, [ { width: 2 … }], “application/pdf”)

/usr/share/nextcloud/lib/private/PreviewManager.php - line 189:

OC\Preview\Generator->getPreview(OC\Files\Node\File {}, 250, 250, true, “fill”, null)

/usr/share/nextcloud/core/Controller/PreviewController.php - line 169:

OC\PreviewManager->getPreview(OC\Files\Node\File {}, 250, 250, true, “fill”)

/usr/share/nextcloud/core/Controller/PreviewController.php - line 142:

OC\Core\Controller\PreviewController->fetchPreview(OC\Files\Node\File {}, 250, 250, false, false, “fill”)

/usr/share/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 217:

OC\Core\Controller\PreviewController->getPreviewByFileId(8631, 250, 250, false, false, “fill”)

/usr/share/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 126:

OC\AppFramework\Http\Dispatcher->executeController(OC\Core\Cont … {}, “getPreviewByFileId”)

/usr/share/nextcloud/lib/private/AppFramework/App.php - line 156:

OC\AppFramework\Http\Dispatcher->dispatch(OC\Core\Cont … {}, “getPreviewByFileId”)

/usr/share/nextcloud/lib/private/Route/Router.php - line 302:

OC\AppFramework\App::main(“OC\Core\C … r”, “getPreviewByFileId”, OC\AppFramew … {}, { _route: "c … "})

/usr/share/nextcloud/lib/base.php - line 1006:

OC\Route\Router->match("/core/preview")

/usr/share/nextcloud/index.php - line 36:

OC::handleRequest()

This error is already documented in the wiki under violates local access rules error.
I think it reappeared because of the reinstall of Nextcloud.

Just add

'allow_local_remote_servers' => true,

to /usr/share/nextcloud/config/config.php and it should work again.

I found this solution in the wiki.Where is the right place in the config.php?

<?php $CONFIG = array ( 'passwordsalt' => '12345', 'secret' => '12345', 'datadirectory' => '/var/lib/nethserver/nextcloud/', 'dbtype' => 'mysql', 'version' => '22.2.3.0', 'overwrite.cli.url' => 'http://localhost', 'dbname' => 'nextcloud', 'dbhost' => 'localhost:/run/rh-mariadb105-mariadb/nextcloud-mysql.sock', 'dbport' => '', 'dbtableprefix' => 'oc_', 'mysql.utf8mb4' => true, 'dbuser' => 'nextcloud', 'dbpassword' => '6789', 'installed' => true, 'instanceid' => 'ocr6iisor2uk', 'ldapProviderFactory' => 'OCA\\User_LDAP\\LDAPProviderFactory', 'memcache.local' => '\\OC\\Memcache\\APCu', 'logfile' => '/var/lib/nethserver/nextcloud/nextcloud.log', 'mail_smtpmode' => 'smtp', 'mail_smtpsecure' => '', 'mail_smtpauthtype' => 'LOGIN', 'mail_from_address' => 'no-reply', 'mail_domain' => 'xxx.com', 'mail_smtphost' => 'localhost', 'mail_smtpport' => '25', 'trusted_domains' => array ( 0 => 'localhost', 1 => 'xxx.com', 2 => '192.168.134.1', 3 => 'xxx.yyy.com', ), 'onlyoffice' => array ( 'verify_peer_off' => TRUE) ‘allow_local_remote_servers’ => true, );

Is it already there?

You can put it somewhere in between like:

...
  'instanceid' => 'ocr6iisor2uk',
  'allow_local_remote_servers' => true,
  'ldapProviderFactory' => 'OCA\\User_LDAP\\LDAPProviderFactory',
...
1 Like

Many thanks. Now it works.

1 Like