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

2 Likes

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

1 Like

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?

1 Like

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