Problem accessing NAS drives from NC virtualbox (after crash)

NC was in virtualbox. Reinstalled Host now NC cant access NAS and/or containers wont start

Nextcloud version 7.11.0
Operating system and version Ubuntu 22.04
Apache or nginx version unknown. OS says apachectl and http command not found
PHP version (eg, 7.4): unknown. OS says php command not found

My Setup

USB drive connected to router with IP 192.168.1.1
Linux Mint on my laptop hard wired to the router.
Linux Mint IP 192.168.1.200
Nextcloud running in virtualbox
Nextcloud IP 192.168.1.118
Win 11 work PC hard wired to router.

my fstab, it’s needed:

/dev/disk/by-id/dm-uuid-LVM- Go2c6FQtJct0RcUMGt59JOVirRS9ftcQc75HYXafYAAPPZn85dfmUwPwzi00n3Eu / ext4 defaults 0 1

/dev/disk/by-uuid/0ceee2f6-3004-4acd-9529-8314584a9980 /boot ext4 defaults 0 1

/dev/disk/by-uuid/B75A-BE99 /boot/efi vfat defaults 0 1
/swap.img       none    swap    sw      0       0

#This mounts the borg backup directory
#dev/sdb1 /mnt/borg ext4 defaults 0 2       # this was the original when it was a file on the mian HD
//192.168.1.200/borg  /mnt/borg  cifs   vers=1.0,uid=www-data,gid=www-data,credentials=/mnt/.credentials2,iocharset=utf8   0       0     # this points to linux mint /mnt/sdb2

# 1. This is main. If containers wont start, disable this and enable #2, reboot. make sure containers start then disable #2 and enable #1 and reboot. Make a test file to make sure it saves to storage
#//192.168.1.1/storage  /mnt/ncdata  cifs   vers=1.0,uid=www-data,gid=www-data,credentials=/mnt/.credentials,iocharset=utf8   0       0

# 2. Only enable this if containers dont start. See instructions on #1
#//192.168.1.1/storage  /mnt/ncdata cifs rw,mfsymlinks,seal,credentials=/mnt/.credentials,uid=33,gid=0,file_mode=0770,dir_mode=0770 0 0

Background

I had Linux Mint 21.2 running with Nextcloud in Virtualbox 7.0_7.0.6 for over 1 year. Everything worked perfectly and have been able to solve problems as they came up.
My data directory is a USB drive attached to my router with IP 192.168.1.1
I had a folder from this usb drive mounted in fstab on my nextcloud guest. Again no problem.
Two days ago I upgraded Linux Mint to 21.3 through software manager. On reboot I had issues like no panel and all title bars of programs missing. Reverting back through timeshift put me back to linux mint 21.2 and I got the panel and title bars back but lost the launcher in the context menu and samba broke. I spent a day trying to resolve but couldnt.
I copied my nextcloud virtual machine folder to another drive and reinstalled a fresh copy of Linux Mint; this time I went to 21.3 but fresh.

Install went good, no issues.

I reinstalled virtualbox (first the newest version then the same version I was using) both gave same issues - containers wouldnt start in NC

I have been working on this for 2 days and I'm hurting because nothing makes any sense.

Also,
In the past, from my linux or windows machines i could go to \\192.168.1.1\storage and write to it. I noticed today I can't. That makes no sense

So 1st problem I saw:

containers wouldnt start: Apache, Nextcloud and Notify Push
I’ve had this issue before. To fix it I would change my fstab entry from
#1 //192.168.1.1/storage /mnt/ncdata cifs vers=1.0,uid=www-data,gid=www-data,credentials=/mnt/.credentials,iocharset=utf8 0 0
to
#2 //192.168.1.1/storage /mnt/ncdata cifs rw,mfsymlinks,seal,credentials=/mnt/.credentials,uid=33,gid=0,file_mode=0770,dir_mode=0770 0 0

Then reboot. The containers would start, I’d put the original mount entry back and reboot and problem fixed.
I tried that this time and

with #1 enabled

//192.168.1.1/storage  /mnt/ncdata  cifs   vers=1.0,uid=www-data,gid=www-data,credentials=/mnt/.credentials,iocharset=utf8   0       0

the drive mounted and containers wouldn't start. I noticed that all folders, sub folders and files had these permissions: root:root

Also, as root I tried 'touch test' in the mounted drive from nextcloud but kept getting errors that the file or folder doesnt exist.

They used to have www-data:www-data
I tried chown -R www-data:root /mnt/ncdata && chmod -R 750 /mnt/ncdata and in a putty session I monitored. It took about 1 hour to complete but I saw the permissions of all folder, sunfolders and files change ownership to www-data:www-data then go right back to root:root
Makes no sense

with #2 enabled

//192.168.1.1/storage  /mnt/ncdata cifs rw,mfsymlinks,seal,credentials=/mnt/.credentials,uid=33,gid=0,file_mode=0770,dir_mode=0770 0 0
the usb drive would not mount and the containers started. 
When I tried sudo mount -a I got an invalif argument error

I  know the problem is with the mount

Is this the first time you’ve seen this error? Yes

Steps to replicate it:

  1. copy your NC virtual machine to another drive (make sure the ncdata is on a NAS)
  2. fresh install of linux mint 21.3
  3. install virtualbox
  4. add your machine and launch it

The output of your Nextcloud log in Admin > Logging:
Can’t get to Admin GUI account

From container interface: Nextcloud

Waiting for database to start...
psql: error: connection to server at "nextcloud-aio-database" (172.18.0.6), port 5432 failed: FATAL:  the database system is starting up
Waiting for the database to start...

from container interface: Apache

{"level":"info","ts":1706485585.3336017,"msg":"Unsolicited response received on idle HTTP channel starting with \" JavaScript for correct operation. Please <a href=\\\"https://www.enable-javascript.com/\\\" target=\\\"_blank\\\" rel=\\\"noreferrer noopener\\\">enable JavaScript</a> and reload the page.\\t\\t</div>\\n\\t</div>\\n</noscript>\\n\\t\\t\\t\\t\\t<input type=\\\"hidden\\\" id=\\\"initial-state-core-versionHash\\\" value=\\\"IjRmNTU0OTRhIg==\\\">\\n\\t\\t\\t\\t\\t<input type=\\\"hidden\\\" id=\\\"initial-state-comments-maxAutoCompleteResults\\\" value=\\\"MTA=\\\">\\n\\t\\t\\t\\t<div class=\\\"wrapper\\\">\\n\\t\\t\\t<div class=\\\"v-align\\\">\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t<header>\\n\\t\\t\\t\\t\\t\\t<div id=\\\"header\\\">\\n\\t\\t\\t\\t\\t\\t\\t<div class=\\\"logo\\\"></div>\\n\\t\\t\\t\\t\\t\\t</div>\\n\\t\\t\\t\\t\\t</header>\\n\\t\\t\\t\\t\\t\\t\\t\\t<main>\\n\\t\\t\\t\\t\\t<h1 class=\\\"hidden-visually\\\">\\n\\t\\t\\t\\t\\t\\tNextcloud\\t\\t\\t\\t\\t</h1>\\n\\t\\t\\t\\t\\t<div class=\\\"guest-box wide\\\">\\n\\t<h2>Internal Server Error</h2>\\n\\t<p>The server was unable to complete your request.</p>\\n\\t<p>If this happens again, please send the technical details below to the server administrator.</p>\\n\\t<p>More details can be found in the server log.</p>\\n\\n\\t<h3>Technical details</h3>\\n\\t<ul>\\n\\t\\t<li>Remote Address: 192.168.1.1</li>\\n\\t\\t<li>Request ID: wdeFPPHo1bL2D9IbXY7i</li>\\n\\t\\t\\t</ul>\\n\\n\\t</div>\\n\\t\\t\\t\\t</main>\\n\\t\\t\\t</div>\\n\\t\\t</div>\\n\\t\\t\\t\\t<footer class=\\\"guest-box \\\">\\n\\t\\t\\t<p class=\\\"info\\\">\\n\\t\\t\\t\\t<a href=\\\"https://nextcloud.com\\\" target=\\\"_blank\\\" rel=\\\"noreferrer noopener\\\" class=\\\"entity-name\\\">Nextcloud</a> – a safe home for all your data\\t\\t\\t</p>\\n\\t\\t</footer>\\n\\t</body>\\n</html>\\n\"; err=<nil>"}
[Sun Jan 28 16:06:50 2024] [error] [client: 192.168.1.1] [AH01067: Failed to read FastCGI header] [Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36]
[Sun Jan 28 16:06:50 2024] [error] [(104)Connection reset by peer] [client: 192.168.1.1] [AH01075: Error dispatching request to : ] [Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36]

from container interface: Notify Push

[2024-01-26 15:48:16.035680 +00:00] ERROR [notify_push] src/main.rs:78: Self test failed: Error while communicating with nextcloud instance
[2024-01-26 15:48:59.516718 +00:00] WARN [notify_push::connection] src/connection.rs:223: websocket error: IO error: Broken pipe (os error 32)

from container interface: channel logs

{"level":"info","ts":1706486853.304556,"msg":"using provided configuration","config_file":"/Caddyfile","config_adapter":""}

[Mon Jan 29 00:07:33.495749 2024] [mpm_event:notice] [pid 111:tid 139773581396808] AH00489: Apache/2.4.58 (Unix) OpenSSL/3.1.4 configured – resuming normal operations
[Mon Jan 29 00:07:33.495830 2024] [core:notice] [pid 111:tid 139773581396808] AH00094: Command line: ‘httpd -D FOREGROUND’
[29-Jan-2024 00:07:33] NOTICE: fpm is running, pid 124
[29-Jan-2024 00:07:33] NOTICE: ready to handle connections
NOTICE: PHP message: 404 Not Found
Type: Slim\Exception\HttpNotFoundException

4
Message: Not found.
File: /var/www/docker-aio/php/vendor/slim/slim/Slim/Middleware/RoutingMiddleware.php
Line: 76
Trace: #0 /var/www/docker-aio/php/vendor/slim/slim/Slim/Routing/RouteRunner.php(56): Slim\Middleware\RoutingMiddleware->performRouting(Object(GuzzleHttp\Psr7\ServerRequest))
#1 /var/www/docker-aio/php/vendor/slim/csrf/src/Guard.php(476): Slim\Routing\RouteRunner->handle(Object(GuzzleHttp\Psr7\ServerRequest))
#2 /var/www/docker-aio/php/vendor/slim/slim/Slim/MiddlewareDispatcher.php(168): Slim\Csrf\Guard->process(Object(GuzzleHttp\Psr7\ServerRequest), Object(Slim\Routing\RouteRunner))
#3 /var/www/docker-aio/php/vendor/slim/twig-view/src/TwigMiddleware.php(115): Psr\Http\Server\RequestHandlerInterface@anonymous->handle(Object(GuzzleHttp\Psr7\ServerRequest))
#4 /var/www/docker-aio/php/vendor/slim/slim/Slim/MiddlewareDispatcher.php(121): Slim\Views\TwigMiddleware->process(Object(GuzzleHttp\Psr7\ServerRequest), Object(Psr\Http\Server\RequestHandlerInterface@anonymous))
#5 /var/www/docker-aio/php/src/Middleware/AuthMiddleware.php(38): Psr\Http\Server\RequestHandlerInterface@anonymous->handle(Object(GuzzleHttp\Psr7\ServerRequest))
#6 /var/www/docker-aio/php/vendor/slim/slim/Slim/MiddlewareDispatcher.php(269): AIO\Middleware\AuthMiddleware->__invoke(Object(GuzzleHttp\Psr7\ServerRequest), Object(Psr\Http\Server\RequestHandlerInterface@anonymous))
#7 /var/www/docker-aio/php/vendor/slim/slim/Slim/Middleware/ErrorMiddleware.php(76): Psr\Http\Server\RequestHandlerInterface@anonymous->handle(Object(GuzzleHttp\Psr7\ServerRequest))
#8 /var/www/docker-aio/php/vendor/slim/slim/Slim/MiddlewareDispatcher.php(121): Slim\Middleware\ErrorMiddleware->process(Object(GuzzleHttp\Psr7\ServerRequest), Object(Psr\Http\Server\RequestHandlerInterface@anonymous))
#9 /var/www/docker-aio/php/vendor/slim/slim/Slim/MiddlewareDispatcher.php(65): Psr\Http\Server\RequestHandlerInterface@anonymous->handle(Object(GuzzleHttp\Psr7\ServerRequest))
#10 /var/www/docker-aio/php/vendor/slim/slim/Slim/App.php(199): Slim\MiddlewareDispatcher->handle(Object(GuzzleHttp\Psr7\ServerRequest))
#11 /var/www/docker-aio/php/vendor/slim/slim/Slim/App.php(183): Slim\App->handle(Object(GuzzleHttp\Psr7\ServerRequest))
#12 /var/www/docker-aio/php/public/index.php(185): Slim\App->run()
#13 {main}
Tips: To display error details in HTTP response set "displayErrorDetails" to true in the ErrorHandler constructor.

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

sorry, dont know the path to nextcloud

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

in /var/log I see many files and folders but nothing that says apache or nginx

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.

Sorry, /var/www does not exist


That's about all i can give you


I hope someone can help shed some light on this because at this point I haven't a clue what to do. Nothing makes sense to me at this point

Thanks in advance

Mike

I fear this is your problem then…

I can’t believe it. In my IT experience I find that 99% of all problems have simple solutions. I didn’t take a closer look at that drive until after posting because “I know” that I haven’t touched it.
Before I knew you replied, I plugged that drive and a drive that is still working properly into my work computer to compare the security and found that somehow it had changed. After changing those permissions and testing writing ability I started NC up again with the proper mounting and everything came up quickly.

Sorry to waste your time but happy you replied (just incase I didn’t check the drive) your reply would have pointed me in that direction.

1 Like

To Continue, I have a new problem.
After I got NC up and running, I wanted to verify Borg backup functioned normally
I successfully stoped the containers and made a new backup. Next I tried to restore that backup and that’s when my new problem started.
The borg restore failed with this error:
Restoring ‘20240125_030148-nextcloud-aio’…
fuse: mount failed: Permission denied
Could not mount the backup!

I have been researching since last night but there is very little to go one.
Figuring this problem is related to the above, I thought the issue might be with the borg backup location which is on sdb which is my 2nd internal drive of my newly installed Linux Mint.

I verified in NC that the fstab credentials file is still there and has the username for mike and of course the password.

I looked at the permissions of the borg folder on linux mint and it was set to www-data.
I have tried changing the permissions to root and to mike giving everyone comeplete access - same error
I did find . -printf “%M %-20u %-20g %p\n” in the borg folder to check the permissions of every file. They were all mike:moke except for 5 which was set to nobosy. I manually changed those to mike:mike - same error

When putty’d into NC I am able to access the borg mount, create a file and see it while looking at the sdb borg folder from linux. And I can delete it from they putty connection, so access is there.

I even asked ChaGPT but instead of telling me what to check, it wanted me to chown and chmod but didnt tell me chich user to change it to. I didn’t change anything.

Any thoughts on this? What user accoutn is the borg backup using?
Since the fstab says www-data:www-data I can assume that’s correct. IF that is correct, then I think the borg restore should have worked when the borg folder permissions on my linux mint locally set to www-data should have worked.

This is unfortunately a bug currently bit fixed in the current beta release: Borg backup restore doesnt work anymore · Issue #4124 · nextcloud/all-in-one · GitHub

ok so you are saying I cannot do borg backups anymore for the time being.
I find it insteresting that it worked perfectly before I went to Linux Mint 21.3 with all other things being equal.
Maybe I was just lucky

not an accurate statement. MY backups have been working perfectly but it has bee awhile since I had to restore something

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.