Tag Archives: nextcloud

Nextcloud AIO mount to local directory reboot persistence

I recently reconfigured my nextcloud AIO docker instance to get files from a local bind mount instead of a network share. I needed to mount the files with the www-data user (id 33) so nextcloud would properly read and write to them. The procedure of making a fuse mount with force-user and force-group as outlined in the readme did the trick.

However, it did not survive a reboot. The directory I want to expose to the nextcloud container is a ZFS dataset. There is some sort of race condition where the fuse filesystem sometimes binds to the empty mount directory before the dataset is mounted. To fix this, I needed to make the mount process its own systemd unit file, instead of an fstab entry. This is how I got it to work:

cat /etc/systemd/system/nextcloud-mount.service 
[Unit]
Description=bindfs mirror /mnt/storage -> /mnt/nextcloud_storage
RequiresMountsFor=/mnt/storage
After=local-fs.target remote-fs.target

[Service]
Type=forking
ExecStart=/usr/bin/bindfs -u 33 -g 33 /mnt/storage /mnt/nextcloud_storage
ExecStop=/bin/umount -l /mnt/nextcloud_storage
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

After writing that file, doing systemctl daemon-reload and systemctl enable nextcloud-mount my problem was solved! The bind mount only happens after all local and remote filesystems are mounted.

Nextcloud External Files SMB not working – Empty Response from Server

I beat my head against the wall for hours trying to figure out why external storage wasn’t working with my Nextcloud instance after I migrated it over to CentOS 7. All I kept getting was a very unhelpful

There was an error with message: Empty response from the server.

I installed all the libraries multiple times. I tried different versions of smbclient and php-smbclient but the error kept happening! Eventually I decided to check the samba logs of my samba server. Sure enough:

 create_connection_session_info failed: NT_STATUS_ACCESS_DENIED

The username and password I was using was correct. I read on some forum (sorry, no link) to put something in the Workgroup field. Voila! As soon as I populated the workgroup field in Nextcloud for my SMB shares, they all worked!