Trying to add storage folder in OMV file server to Proxmox Ubuntu Server Nextcloud

Nextcloud version (eg, 20.0.5): 24.0.3
Operating system and version (eg, Ubuntu 20.04): Ubuntu Server 22.04
Apache or nginx version (eg, Apache 2.4.25): What came with the snap version from the ubuntu install on July 27, 2022
PHP version (eg, 7.4): What came with the snap version from the ubuntu install on July 27, 2022
Running on a Proxmox vm.

The issue you are facing: I cannot add an external disk. Nextcloud claims that SMB Client is not install…
It is installed in the Ubuntu VM via sudo apt install annd then the host of packages that are require.

Is this the first time you’ve seen this error? (Y/N): Yes

Steps to replicate it: Followed a whole bunch of rabbit hole solutions from the web and nothing is working.

  1. Installed a whole bunch of smb client related packages. Too many to list.

  2. Edited FSTAB to point to the OMV server folder
    //192.168.1.230/Media/Documents /Documents cifs username=Nextcloud,password=xxxxxxxxxxxxxx 0 0
    Made /Documents folder in the root directory. I can read and write to the files in the /Documents folder

  3. made symbolic link via ln -s /Documents /var/snap/nextcloud/common/nextcloud/data/ted/files/Documents

  4. Tried uninstalling and reinstalling the Nextcloud apps on other devices.

The output of your Nextcloud log in Admin > Logging:

Warning	core	Trusted domain error. "142.93.184.222" tried to access using "69.9.119.219" as host.		2022-07-28T13:28:05-0600
Warning	core	Trusted domain error. "35.195.93.98" tried to access using "69.9.119.219" as host.		2022-07-28T12:34:47-0600
Info	updater	\OC\Updater::resetLogLevel: Reset log level to Warning(2)		2022-07-28T12:04:55-0600
Info	updater	\OC\Updater::maintenanceDisabled: Turned off maintenance mode		2022-07-28T12:04:55-0600
Info	updater	\OC\Updater::updateEnd: Update successful		2022-07-28T12:04:55-0600
Info	updater	\OC\Updater::finishedCheckCodeIntegrity: Finished code integrity check		2022-07-28T12:04:55-0600
Info	updater	\OC\Updater::startCheckCodeIntegrity: Starting code integrity check...		2022-07-28T12:04:44-0600
Info	updater	\OC\Repair::step: Repair step: Add background job to set the lookup server share state for users		2022-07-28T12:04:44-0600
Info	no app in context	Deprecated event type for \OC\Repair::step: Symfony\Component\EventDispatcher\GenericEvent is used		2022-07-28T12:04:44-0600
Info	updater	\OC\Repair::step: Repair step: Repair DAV shares		2022-07-28T12:04:44-0600
Info	no app in context	Deprecated event type for \OC\Repair::step: Symfony\Component\EventDispatcher\GenericEvent is used		2022-07-28T12:04:44-0600
Info	updater	\OC\Repair::step: Repair step: Queue a one-time job to check for user uploaded certificates		2022-07-28T12:04:44-0600
Info	no app in context	Deprecated event type for \OC\Repair::step: Symfony\Component\EventDispatcher\GenericEvent is used		2022-07-28T12:04:44-0600
Info	updater	\OC\Repair::step: Repair step: Add job to cleanup the bruteforce entries		2022-07-28T12:04:44-0600
Info	no app in context	Deprecated event type for \OC\Repair::step: Symfony\Component\EventDispatcher\GenericEvent is used		2022-07-28T12:04:44-0600
Info	updater	\OC\Repair::step: Repair step: Remove old dashboard app config data		2022-07-28T12:04:44-0600
Info	no app in context	Deprecated event type for \OC\Repair::step: Symfony\Component\EventDispatcher\GenericEvent is used		2022-07-28T12:04:44-0600
Info	updater	\OC\Repair::step: Repair step: Check encryption key format		2022-07-28T12:04:44-0600
Info	no app in context	Deprecated event type for \OC\Repair::step: Symfony\Component\EventDispatcher\GenericEvent is used		2022-07-28T12:04:44-0600
Info	updater	\OC\Repair::step: Repair step: Keep legacy encryption enabled		2022-07-28T12:04:44-0600
Info	no app in context	Deprecated event type for \OC\Repair::step: Symfony\Component\EventDispatcher\GenericEvent is used		2022-07-28T12:04:44-0600
Info	updater	\OC\Repair::step: Repair step: Reset generated avatar flag		2022-07-28T12:04:44-0600
Info	no app in context	Deprecated event type for \OC\Repair::step: Symfony\Component\EventDispatcher\GenericEvent is used		2022-07-28T12:04:44-0600
Info	updater	\OC\Repair::step: Repair step: Clear access cache of projects		2022-07-28T12:04:44-0600
Info	no app in context	Deprecated event type for \OC\Repair::step: Symfony\Component\EventDispatcher\GenericEvent is used		2022-07-28T12:04:44-0600
Info	updater	\OC\Repair::info: Repair info: No need to remove link shares.		2022-07-28T12:04:44-0600
Info	no app in context	Deprecated event type for \OC\Repair::info: Symfony\Component\EventDispatcher\GenericEvent is used		2022-07-28T12:04:44-0600
Info	updater	\OC\Repair::step: Repair step: Remove potentially over exposing share links		2022-07-28T12:04:44-0600
Info	no app in context	Deprecated event type for \OC\Repair::step: Symfony\Component\EventDispatcher\GenericEvent is used		2022-07-28T12:04:44-0600
Info	updater	\OC\Repair::step: Repair step: Add background job to cleanup login flow v2 tokens		2022-07-28T12:04:44-0600
Info	no app in context	Deprecated event type for \OC\Repair::step: Symfony\Component\EventDispatcher\GenericEvent is used		2022-07-28T12:04:44-0600
Info	updater	\OC\Repair::step: Repair step: Cleanup invalid photocache files for carddav		2022-07-28T12:04:44-0600
Info	no app in context	Deprecated event type for \OC\Repair::step: Symfony\Component\EventDispatcher\GenericEvent is used		2022-07-28T12:04:44-0600
Info	updater	\OC\Repair::step: Repair step: Queue a one-time job to cleanup old backups of the updater		2022-07-28T12:04:44-0600
Info	no app in context	Deprecated event type for \OC\Repair::step: Symfony\Component\EventDispatcher\GenericEvent is used		2022-07-28T12:04:44-0600
Info	updater	\OC\Repair::step: Repair step: Add preview background cleanup job		2022-07-28T12:04:44-0600
Info	no app in context	Deprecated event type for \OC\Repair::step: Symfony\Component\EventDispatcher\GenericEvent is used		2022-07-28T12:04:44-0600
Info	updater	\OC\Repair::step: Repair step: Clear every generated avatar on major updates		2022-07-28T12:04:44-0600
Info	no app in context	Deprecated event type for \OC\Repair::step: Symfony\Component\EventDispatcher\GenericEvent is used		2022-07-28T12:04:44-0600
Info	updater	\OC\Repair::info: Repair info: JS cache cleared		2022-07-28T12:04:44-0600
Info	no app in context	Deprecated event type for \OC\Repair::info: Symfony\Component\EventDispatcher\GenericEvent is used		2022-07-28T12:04:44-0600
Info	updater	\OC\Repair::info: Repair info: SCSS cache cleared		2022-07-28T12:04:43-0600
Info	no app in context	Deprecated event type for \OC\Repair::info: Symfony\Component\EventDispatcher\GenericEvent is used		2022-07-28T12:04:43-0600
Debug	scss_cacher	SCSSCacher::resetCache Locking removed		2022-07-28T12:04:43-0600
Debug	scss_cacher	SCSSCacher::resetCache css cache cleared!		2022-07-28T12:04:43-0600
Debug	scss_cacher	SCSSCacher::resetCache Lock acquired		2022-07-28T12:04:43-0600
Debug	scss_cacher	SCSSCacher::resetCache		2022-07-28T12:04:43-0600
Info	updater	\OC\Repair::info: Repair info: Image cache cleared		2022-07-28T12:04:43-0600
Info	no app in context	Deprecated event type for \OC\Repair::info: Symfony\Component\EventDispatcher\GenericEvent is used		2022-07-28T12:04:43-0600
Info	updater	\OC\Repair::step: Repair step: Clear frontend caches		2022-07-28T12:04:43-0600

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'apps_paths' =>
  array (
    0 =>
    array (
      'path' => '/snap/nextcloud/current/htdocs/apps',
      'url' => '/apps',
      'writable' => false,
    ),
    1 =>
    array (
      'path' => '/var/snap/nextcloud/current/nextcloud/extra-apps',
      'url' => '/extra-apps',
      'writable' => true,
    ),
  ),
  'supportedDatabases' =>
  array (
    0 => 'mysql',
 ),
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => '/tmp/sockets/redis.sock',
    'port' => 0,
  ),
  'log_type' => 'file',
  'logfile' => '/var/snap/nextcloud/current/logs/nextcloud.log',
  'logfilemode' => 416,
  'passwordsalt' => 'x+QabPv8C6Vi4eoAPBwj8Wq3h96OO8',
  'secret' => 'BmZGsuueUxQzTZTXGf5gjuM0ipwHjp74AYCzUmfN+DRDhsGz',
  'trusted_domains' =>
  array (
    0 => 'localhost',
    1 => 'xxxxxxxx.xxx.com',
    2 => '192.168.1.*',
  ),
  'datadirectory' => '/var/snap/nextcloud/common/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '24.0.3.2',
  'overwrite.cli.url' => 'http://localhost',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost:/tmp/sockets/mysql.sock',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => '0yLNvw-GsaiH8vRszdb_Avt8pViNDCnNzgwpbUN-bBpQkAew-wSHrRWqLg5k>
  'installed' => true,
  'instanceid' => 'oc8azpuv3r6t',
  'maintenance' => false,
  'loglevel' => 2,
);





The output of your Apache/nginx/system log in /var/log/____:

No idea how to find these log files. Not apparent in the snap install of nextcloud on a proxmox VM

PASTE HERE


Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

Any help would be appreciated. This should be way easier than this.

Hello,

I am not a Linux Expert but I think default installation of NextCloud in Ubuntu happens via snap. I may be wrong so please do check that if its snap or not.

In case it’s snap installations, then system link won’t work.

  1. First you have to mount the external storage (anywhere in your File System) in Ubuntu
  2. Then allow snap to access external storage sudo snap connect nextcloud:removable-media
  3. Now edit the config file to change the data directory to your mounted drive path.
  4. Move the existing data out of the default directory sudo mv /var/snap/nextcloud/common/nextcloud/data /your/mount/path
  5. Restart NextCloud or the entire system

By the way, sometimes you may need to readjust the permissions of the new directory after moving → so sudo chown -R root:root /your/mount/dir and then for the permission, sudo chmod 0770 /your/mount/path

Reboot again.

Refer here for details → nextcloud-snap/nextcloud-snap: :cloud::package: Nextcloud packaged as a snap (github.com)

Thanks.

You are right. I installed it with Snap.

1 Like

Rebuilt my proxmox vm. Installed Nextcloud as snap from Ubuntu install menu. Did what you suggested on new instance of Nextcloud. I was able to access the browser interface once to add Admin user. Then I went to edit the config.php, moved the data directory to the proper folder. Now I get Your data directory is invalid. Ensure there is a file called “.ocdata” in the root of the data directory. Cannot create “data” directory. This can usually be fixed by giving the web server write access to the root directory. See https://docs.nextcloud.com/server/24/go.php?to=admin-dir_permissions

What to do now???

Hello,

Did you run the needed snap commands to connect snap nextcloud to the external storage?

sudo snap connect nextcloud:removable-media

Without that command, editing config file for data directory change won’t work.

Thanks.