Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installing inside docker in a raspberry pi with files in external ext4 hdd #1685

Closed
miqmago opened this issue Apr 30, 2023 · 7 comments
Closed
Labels
bug Something isn't working

Comments

@miqmago
Copy link

miqmago commented Apr 30, 2023

Describe the bug
I'm getting bash: ./java: Permission denied

To Reproduce
I've installed all the libraries:

# from outside docker
sudo git clone https://github.com/codemasher/php-ext-xz.git
sudo chown www-data:www-data php-ext-xz/ -R

# from inside docker
docker exec -it -u 0 nextcloud_app bash
apt-get update
apt-get install git liblzma-dev -y
cd ..
mv html/php-ext-xz/ .
cd php-ext-xz
phpize
./configure
make
make install
echo "extension=xz.so" >> /usr/local/etc/php/conf.d/nextcloud.ini
exit

docker exec -u www-data nextcloud_app php /var/www/html/occ libresign:install --all
docker exec -u www-data nextcloud_app bash -c /var/www/html/data/appdata_xxxxxxxxx/libresign/java/jdk-17.0.5+8-jre/bin/java

Always getting

bash: line 1: /var/www/html/data/appdata_xxxxxxxxx/libresign/java/jdk-17.0.5+8-jre/bin/java: Permission denied

Expected behavior
Java should be executable

Screenshots
Captura de pantalla 2023-04-30 a les 23 23 26

Environment information (please complete the following information):

  • OS: Docker (Linux 6.1.21-v8+ aarch64 - Raspberry Pi 4 Model B Rev 1.4 (4 cores))
  • Browser n/a
  • LibreSign Version 7.1.1 - 2023-04-12
  • Nextcloud Server Version 26.0.1
  • Logs n/a
@miqmago miqmago added the bug Something isn't working label Apr 30, 2023
@MaitreCake
Copy link

MaitreCake commented May 1, 2023

Hi,
php-ext xz is mentionned / raspberry is ARM :

Sounds like something that may be related with this thread
????

Regards,

@miqmago
Copy link
Author

miqmago commented May 1, 2023

But the problem has to do with java... I've tried to execute the binnary also outside docker and the problem is the same: Permission denied.

@MaitreCake
Copy link

Not a specialist but I would check the ownership of the data folder of NC.

@miqmago
Copy link
Author

miqmago commented May 1, 2023

I've tried to change permissions too, but the result is the same. Permissions are:

root@raspberrypi:/home/pi/nextcloud/mnt/data/appdata_xxxxxxxxx/libresign/java/jdk-17.0.5+8-jre/bin# ls -la
total 368
drwxr-xr-x 2 www-data www-data  4096 Apr 30 23:05 .
drwxr-xr-x 6 www-data www-data  4096 Apr 30 23:05 ..
-rwxr-xr-x 1 www-data www-data 70704 Oct 19  2022 java
-rwxr-xr-x 1 www-data www-data 70720 Oct 19  2022 jfr
-rwxr-xr-x 1 www-data www-data 70744 Oct 19  2022 jrunscript
-rwxr-xr-x 1 www-data www-data 70720 Oct 19  2022 keytool
-rwxr-xr-x 1 www-data www-data 70728 Oct 19  2022 rmiregistry

And seen from inside docker container:

pi@raspberrypi:~/nextcloud/mnt $ docker exec -it -u www-data nextcloud_app bash
www-data@0b861451b364:~/html/data/appdata_xxxxxxxxx/libresign/java/jdk-17.0.5+8-jre/bin$ ls -la
total 368
drwxr-xr-x 2 www-data www-data  4096 Apr 30 21:05 .
drwxr-xr-x 6 www-data www-data  4096 Apr 30 21:05 ..
-rwxr-xr-x 1 www-data www-data 70704 Oct 19  2022 java
-rwxr-xr-x 1 www-data www-data 70720 Oct 19  2022 jfr
-rwxr-xr-x 1 www-data www-data 70744 Oct 19  2022 jrunscript
-rwxr-xr-x 1 www-data www-data 70720 Oct 19  2022 keytool
-rwxr-xr-x 1 www-data www-data 70728 Oct 19  2022 rmiregistry

@miqmago
Copy link
Author

miqmago commented May 1, 2023

[SOLVED] but any explanation would be really appreciated!

This is quite weird... My installation of nextcloud has an external hard drive mounted on /home/pi/nextcloud/mnt, so all files of nextcloud are saved on an external 4TB hdd.

In my docker-compose.yml I've defined a volume like this:

    volumes:
      - ./mnt:/var/www/html

Seems that docker cannot execute java saved on hdd so I've entered inside docker and moved java to /usr/local/lib.
Then I've created a symnlink on libresign folder and now it works fine:

docker exec -it -u0 nextcloud_app bash
cd appdata_xxxxxxxxx/libresign/java
mv jdk-17.0.5+8-jre /usr/local/lib
ln -s /usr/local/lib/jdk-17.0.5+8-jre jdk-17.0.5+8-jre

@miqmago miqmago closed this as completed May 1, 2023
@miqmago miqmago changed the title Installing inside docker in a raspberry pi Installing inside docker in a raspberry pi with files in external ext4 hdd May 1, 2023
@MaitreCake
Copy link

Thanks, at least it let know that LibreSign can work on a Raspberry (on Docker)

@feefladder
Copy link

feefladder commented Jul 3, 2023

@miqmago I also had problems with files not being executable on my newly mounted hdd. Did you set the exec flag in /etc/fstab? This is also included in defaults for mount options. For me:

UUID=de02e835-197c-42c6-b929-b8d93438aad2 /media/fee/hdd  auto    defaults      0       2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants