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

Cannot install dependencies #3359

Closed
tomslux opened this issue Jul 12, 2024 · 17 comments
Closed

Cannot install dependencies #3359

tomslux opened this issue Jul 12, 2024 · 17 comments
Labels
bug Something isn't working

Comments

@tomslux
Copy link

tomslux commented Jul 12, 2024

Describe the bug
Tried to install the binaries, but it fails on Java. I tried even with the occ command but it doesent work.
Lates Nextcloud Version, all Updates done.

ERROR MESSAGE
vwnvsyeycztb@sx***68 [~]$ php -f /home/vwnvsyeycztb/public_html/WEBSITE/occ libresign:configure:check


Status Resource Message Tip


error java Java not installed Run occ libresign:install --java
error jsignpdf Necessary Java to run PDFtk Run occ libresign:install --java
error jsignpdf Necessary Java to run JSignPdf Run occ libresign:install --java
success openssl-configure Root certificate setup is working fine.


vwnvsyeycztb@sxb1plmcpnl497868 []$ php -f /home/vwnvsyeycztb/public_html/WEBSITE/occ libresign:install --java
cat: '/etc/*-release': No such file or directory
An unhandled exception has been thrown:
TypeError: preg_match(): Argument #2 ($subject) must be of type string, null given in /home/vwnvsyeycztb/public_html/WEBSITE/apps/libresign/lib/Service/Install/InstallService.php:442
Stack trace:
#0 /home/vwnvsyeycztb/public_html/WEBSITE/apps/libresign/lib/Service/Install/InstallService.php(442): preg_match()
#1 /home/vwnvsyeycztb/public_html/WEBSITE/apps/libresign/lib/Service/Install/InstallService.php(404): OCA\Libresign\Service\Install\InstallService->getLinuxDistributionToDownloadJava()
#2 /home/vwnvsyeycztb/public_html/WEBSITE/apps/libresign/lib/Command/Install.php(109): OCA\Libresign\Service\Install\InstallService->installJava()
#3 /home/vwnvsyeycztb/public_html/WEBSITE/3rdparty/symfony/console/Command/Command.php(298): OCA\Libresign\Command\Install->execute()
#4 /home/vwnvsyeycztb/public_html/WEBSITE/core/Command/Base.php(177): Symfony\Component\Console\Command\Command->run()
#5 /home/vwnvsyeycztb/public_html/WEBSITE/3rdparty/symfony/console/Application.php(1040): OC\Core\Command\Base->run()
#6 /home/vwnvsyeycztb/public_html/WEBSITE/3rdparty/symfony/console/Application.php(301): Symfony\Component\Console\Application->doRunCommand()
#7 /home/vwnvsyeycztb/public_html/WEBSITE/3rdparty/symfony/console/Application.php(171): Symfony\Component\Console\Application->doRun()
#8 /home/vwnvsyeycztb/public_html/WEBSITE/lib/private/Console/Application.php(213): Symfony\Component\Console\Application->run()
#9 /home/vwnvsyeycztb/public_html/WEBSITE/console.php(102): OC\Console\Application->run()
#10 /home/vwnvsyeycztb/public_html/WEBSITE/occ(11): require_once('/home/vwnvsyeyc...')
#11 {main}vwnvsyeycztb@sxb1plmcpnl497868 [
]$

Expected behavior
Installing all the binaries and working ;)

@tomslux tomslux added the bug Something isn't working label Jul 12, 2024
@vitormattos
Copy link
Member

I identified a problem at build process and created a new release.

Could you test with the newest release?

@tomslux
Copy link
Author

tomslux commented Jul 12, 2024 via email

@vitormattos
Copy link
Member

I think that your case is related with this command:

cat /etc/*-release

Can you run this command and put the output here?

@tomslux
Copy link
Author

tomslux commented Jul 12, 2024 via email

@vitormattos
Copy link
Member

I used this to identify if is Alpine Linux or not. I didn't found another best way when I made this. But your case is the first that got problem with this.

We need to identify another way to check if is alpine or not.

@vitormattos
Copy link
Member

$distribution = shell_exec('cat /etc/*-release');
preg_match('/^ID=(?<version>.*)$/m', $distribution, $matches);
if (isset($matches['version']) && strtolower($matches['version']) === 'alpine') {
return 'alpine-linux';
}
return 'linux';

@tomslux
Copy link
Author

tomslux commented Jul 13, 2024 via email

@vitormattos
Copy link
Member

@tomslux at /proc/version don't return any info that we can identify if is Alpine or not.

I executed this command inside a container with Alpine:

ce0ae65487ee:/app# cat /proc/version
Linux version 6.1.0-22-amd64 (debian-kernel@lists.debian.org) (gcc-12 (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 SMP PREEMPT_DYNAMIC Debian 6.1.94-1 (2024-06-21)
ce0ae65487ee:/app# cat /etc/*-release
3.19.1
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.19.1
PRETTY_NAME="Alpine Linux v3.19"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://gitlab.alpinelinux.org/alpine/aports/-/issues"

And at my case returned Debian at /proc/version but is Alpine. Maybe because the host of Docker is running Debian.

@vitormattos
Copy link
Member

Maybe we will need to use a try catch approach and use different ways to identify if is Alpine Linux.

@vitormattos
Copy link
Member

I think that this can solve without issues:

php -r "var_dump(shell_exec('type apk'));"

@vitormattos
Copy link
Member

A problem could be if the command apk was blocked to be executed by PHP.

@vitormattos
Copy link
Member

I created this package that I think is what we need:

https://packagist.org/packages/libresign/whatosami

@vitormattos
Copy link
Member

Would be nice if you can clone this package, run composer install and after this run composer test:unit to check if all tests will pass

@vitormattos
Copy link
Member

Was solved by:

Will come in the next release.

@tomslux
Copy link
Author

tomslux commented Jul 25, 2024 via email

@tomslux
Copy link
Author

tomslux commented Jul 25, 2024 via email

@vitormattos
Copy link
Member

Could you check again at the newest release of LibreSign?

I made a lot of improvements.

Closing this issue as solved.

If this issue persists, don't hesitate to open a new issue making reference to this.

Note

If you like this app, don't hesitate to help us

Ways to help this project:

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
Status: 4. to release
Development

No branches or pull requests

2 participants