NCP docker setup with different data directory

Hi,

I’ve been reading for hours and hours on forums… but i still cant fix it.

I set up /etc/fstab
UUID="6d0ab6c5-cef1-4fc4-9fdb-261cfdc99ce1" /media/ncp ext4 rw,users 0 0

output of lsblk
sdb 8:16 0 596.2G 0 disk └─sdb1 8:17 0 596.2G 0 part /media/ncp
Cleaned docker, nextcloudpi works if i have everything in the normal location, but as soon as i remove the container, delete it and want to create a new container with the following command:

docker run -d -p 4443:4443 -p 443:443 -p 80:80 -v /media/ncp/data:/data --name nextcloudpi ownyourbits/nextcloudpi-armhf xxx.ddns.net

I get this error code:
/run-parts.sh: line 42: /etc/services-enabled.d/000ncp: Permission denied /run-parts.sh: line 47: /etc/services-enabled.d/010lamp: Permission denied /run-parts.sh: line 47: /etc/services-enabled.d/020nextcloud: Permission denied Init done

ls -lha /media/ncp

total 12K
drwxr-xr-x 3 pi root 4.0K Dec 31 10:07 .
drwxr-xr-x 3 root root 4.0K Dec 31 07:11 …
drwxr-xr-x 7 pi pi 4.0K Dec 31 10:10 data

Help me please :slight_smile:

I’d try giving ownership to www-data

sudo chown www-data:www-data /media/ncp/data

As for security reasons, docker has no rights to do that outside the container

Tried it changing to www-data but still the same error :frowning:

Post output of/Check if mounted properly with

df -h

/dev/sdb1 586G 73M 556G 1% /media/ncp

Try removing existing containers and start docker with sudo or is user already added to docker group?

Its the only container that is running, and i did ad pi to docker group…

Check if any remain with

docker ps -a

If any, remove them, before starting new one

no luck… :frowning: what should be the default permission be for these files?

OK Changed /etc/fstab removed rw and users

but now i get this error:

Making /etc/apache2 persistent …
Starting PHP-fpm
Starting Apache
Starting mariaDB
2019-12-31 9:55:45 0 [Note] mysqld (mysqld 10.3.15-MariaDB-1) starting as process 94 …
2019-12-31 9:55:45 0 [Warning] Can’t create test file /data/database/b3054a8ed8c5.lower-test
mysqld: Can’t change dir to ‘/data/database/’ (Errcode: 2 “No such file or directory”)
2019-12-31 9:55:45 0 [ERROR] Aborting

mysqld: Can’t change dir to ‘/data/database/’ (Errcode: 2 “No such file or directory”)

Same issue for me on Docker (debian 10 desktop)

looking to use another internal drive formated BTRFS as ncdata .
It’s working on normal location but as soon as i remove the container, delete it and want to create a new container with the following command:

docker run -d -p 4443:4443 -p 443:443 -p 80:80 -v /media/ncp/data:/data --name nextcloudpi ownyourbits/nextcloudpi-x86 192.168.0.x

error code:
/run-parts.sh: line 47: /etc/services-enabled.d/010lamp: Permission denied /run-parts.sh: line 47: /etc/services-enabled.d/020nextcloud: Permission

tried :
sudo chown www-data:www-data /media/ncp/data
user already added to docker group
No luck

I have a similar issue for my raspberrypi 3 (with running OMV + Portainer).

Pulled the image as suggested with:
docker run -d -p 4443:4443 -p 443:443 -p 80:80 -v /srv/dev-disk-by-label-external/media/nextcloud:/data --name nextcloudpi ownyourbits/nextcloudpi-armhf %IP

www-data owns that dir but still shows “Permission denied”:

/run-parts.sh: line 6: /etc/services-enabled.d/020nextcloud: Permission denied
/run-parts.sh: line 6: /etc/services-enabled.d/010lamp: Permission denied
/run-parts.sh: line 6: /etc/services-enabled.d/000ncp: Permission denied
/run-parts.sh: line 42: /etc/services-enabled.d/000ncp: Permission denied
/run-parts.sh: line 47: /etc/services-enabled.d/010lamp: Permission denied
/run-parts.sh: line 47: /etc/services-enabled.d/020nextcloud: Permission denied

I am totally confused as the docker-image worked fine, when configured with the standard path.

I had the same permission problems. I solved it by adding exec option to fstab:

UUID= YourDrive’sUUID /media/ncp ext4 rw,users,exec 0 0

1 Like

HI,
I had the same issue before, changing fstab file has solved the issue to.
UUID=yourDisk /mnt/path FSTYPE defaults,auto,users,rw,nofail 0 0

Thanks

I installed it accordingly in OMV5 and it worked like a charm. When changing back to OMV4, out of stability reasons, I have the following error and can’t solve it:

/run-parts.sh: line 47: /etc/services-enabled.d/010lamp: Permission denied
/run-parts.sh: line 47: /etc/services-enabled.d/020nextcloud: Permission denied
Init done
/run-parts.sh: line 6: /etc/services-enabled.d/020nextcloud: Permission denied
/run-parts.sh: line 6: /etc/services-enabled.d/010lamp: Permission denied
/run-parts.sh: line 6: /etc/services-enabled.d/000ncp: Permission denied

I have removed the noexec in the config and I also gave an additional line into fstab:
UUID= UUID /media/ncp ext4 rw,users,exec 0 0
No success. Do you have any idea?

I have the same problem here. It happens when trying to use an external harddrive and its not problem wih permission.

I have the same problem on Raspbian 4.19.118-v7l+

I have the following error:

/run-parts.sh: line 47: /etc/services-enabled.d/010lamp: Permission denied
/run-parts.sh: line 47: /etc/services-enabled.d/020nextcloud: Permission denied

I’ve used this guide: https://docs.nextcloudpi.com/en/how-to-get-started-with-ncp-docker/

I maked the same project on march following the same guide and it was successfull.

Anybody knows what’s the problem?

Thanks in advance.
I

Hello,

I have the same problem like @liziyo with the latest docker image for armhf in openmediavault 5. I have used the instructions from the docs site, but it continues to tell “permission denied”.
exactly:
/run-parts.sh: line 47: /etc/services-enabled.d/010lamp: Permission denied
/run-parts.sh: line 47: /etc/services-enabled.d/020nextcloud: Permission denied

I also tried to mount the USB drive directly via OMV which writes the following entry in fstab:

# >>> [openmediavault]
/dev/disk/by-label/data /srv/dev-disk-by-label-data ext4 defaults,nofail,user_xattr,noexec,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0,acl 0 2
# <<< [openmediavault]

Changing noexec to exec and adding “rw,users” did not work either.

Anybody any idea how to solve this permission problem?

Thanks in advance!

Hey there

After a couple of trial and errors I finally managed to successfully install NCP via docker in my OMV5. My problem was simply the mounting…After so many changes in fstab the mountpoint was simply not really set with the correct options.

So what I did:

  1. unmounting the device in OMV
  2. check with command lsblk if the unmount was done correctly (in my case it was not)
  3. use command umount /MOUNTPOINT to unmount correctly
  4. check lsblk again
  5. edit ftstab like this: UUID=YOUR_UUID /media/USB1 ext4 defaults 0 0 (/media/USB1 is depending on folder structure)
  6. create the folder structure you like for ncdata
  7. run the docker command

for example:
sudo docker run -d -p 4443:4443 -p 443:443 -p 80:80 -v /media/USB1/nextcloud/ncp/ncdata:/data --name nextcloudpi --network=“MYNETWORK” --ip=“MYIP” ownyourbits/nextcloudpi-armhf:latest DOMAIN

The first time I did this without defining the network I ran into the “calendar not installed” issue which led to a never ending initialization…so I changed the run command to configure the container with the correct network settings and it finally works!

I hope this will help you…linux sucks if you are not that experienced (like me…) :wink:

1 Like

Good to here you got it working, thanks for sharing.
Quit some people struggle with Linux when starting out.
It really rocks once you get past its first rather steep learning curve. Well worth the efforts and very rewarding imho :wink:

2 Likes