Comments (8)
This is the point at code that throw this error:
libresign/lib/Service/Install/ConfigureCheckService.php
Lines 136 to 162 in e2cc403
You can try to mount the exec command with the path of downloaded files to check what's returned by --version.
Sounds that the return is empty or is an error in your case.
from libresign.
I'm having this same issue, but am seeing a correct output from that command:
curtispf@server:~$ sudo -u www-data java -jar /var/www/cloud/data/appdata_PATH/libresign/pdftk.jar --version
pdftk port to java 3.3.3 a Handy Tool for Manipulating PDF Documents
Copyright (c) 2017-2018 Marc Vinyals - https://gitlab.com/pdftk-java/pdftk
Copyright (c) 2003-2013 Steward and Lee, LLC.
pdftk includes a modified version of the iText library.
Copyright (c) 1999-2009 Bruno Lowagie, Paulo Soares, et al.
This is free software; see the source code for copying conditions. There is
NO warranty, not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
from libresign.
The way to identify the version of pdftk that I implemented is this regex that is applied at first row:
/pdftk port to java (?<version>.*) a Handy Tool/
The first row is:
pdftk port to java 3.3.3 a Handy Tool for Manipulating PDF Documents
And the expected value for now is 3.3.3
The message PDFtk binary is invalid
only is displayed when the return of --version is not a text or if the regex not match with the first row.
I think that will be necessary put more debugs/log points to identify what happening.
from libresign.
I put points of log to be possible follow the code execution. If possible, would be good if you apply this changes adding the log rows at your ConfigureCheckService.php
.
To check the log output, you can use a tail with grep:
tail -f data/nextcloud.log |grep libresign
I will need the output of tail to be possible check what's happening.
diff --git a/lib/Service/Install/ConfigureCheckService.php b/lib/Service/Install/ConfigureCheckService.php
index ccc79b20c..c73ca4dc5 100644
--- a/lib/Service/Install/ConfigureCheckService.php
+++ b/lib/Service/Install/ConfigureCheckService.php
@@ -131,13 +131,21 @@ class ConfigureCheckService {
*/
public function checkPdftk(): array {
$pdftkPath = $this->appConfig->getAppValue('pdftk_path');
+ \OC::$server->getLogger()->debug('Path of PDFTK', ['app' => 'libresign', 'pdftk_path' => $pdftkPath]);
if ($pdftkPath) {
+ \OC::$server->getLogger()->debug('PDFTK exists', ['app' => 'libresign']);
if (file_exists($pdftkPath)) {
$javaPath = $this->appConfig->getAppValue('java_path');
\exec($javaPath . ' -jar ' . $pdftkPath . " --version 2>&1", $version);
+ \OC::$server->getLogger()->debug('executed command', ['app' => 'libresign', 'command' => $javaPath . ' -jar ' . $pdftkPath . " --version 2>&1"]);
+ \OC::$server->getLogger()->debug('output of version', ['app' => 'libresign', 'version' => $version]);
+ \OC::$server->getLogger()->debug('Exists first row', ['app' => 'libresign', 'exists' => isset($version[0]) ? 'yes': 'no']);
if (isset($version[0])) {
+ \OC::$server->getLogger()->debug('First row', ['app' => 'libresign', 'version' => $version[0]]);
preg_match('/pdftk port to java (?<version>.*) a Handy Tool/', $version[0], $matches);
+ \OC::$server->getLogger()->debug('Return of regex', ['app' => 'libresign', 'version' => $matches]);
if (isset($matches['version'])) {
+ \OC::$server->getLogger()->debug('Version identified', ['app' => 'libresign', 'version' => $matches['version']]);
if ($matches['version'] === InstallService::PDFTK_VERSION) {
$return[] = (new ConfigureCheckHelper())
->setSuccessMessage('PDFtk version: ' . InstallService::PDFTK_VERSION)
from libresign.
@vitormattos I'm getting the same issue, here's the debug logs with those statements added:
{"reqId":"XXXXXXXX","level":0,"time":"2024-05-30T19:46:33+00:00","remoteAddr":"XX.XX.XX.XX","user":"raymo","app":"libresign","method":"GET","url":"/nextcloud/ocs/v2.php/apps/libresign/api/v1/admin/configure-check","message":"Path of PDFTK","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36","version":"29.0.1.1","data":{"app":"libresign","pdftk_path":"/data/data/appdata_ocuvueakr11p/libresign/pdftk.jar"}}
{"reqId":"XXXXXXXX","level":0,"time":"2024-05-30T19:46:33+00:00","remoteAddr":"XX.XX.XX.XX","user":"raymo","app":"libresign","method":"GET","url":"/nextcloud/ocs/v2.php/apps/libresign/api/v1/admin/configure-check","message":"PDFTK exists","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36","version":"29.0.1.1","data":{"app":"libresign"}}
{"reqId":"XXXXXXXX","level":0,"time":"2024-05-30T19:46:33+00:00","remoteAddr":"XX.XX.XX.XX","user":"raymo","app":"libresign","method":"GET","url":"/nextcloud/ocs/v2.php/apps/libresign/api/v1/admin/configure-check","message":"executed command","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36","version":"29.0.1.1","data":{"app":"libresign","command":" -jar /data/data/appdata_ocuvueakr11p/libresign/pdftk.jar --version 2>&1"}}
{"reqId":"XXXXXXXX","level":0,"time":"2024-05-30T19:46:33+00:00","remoteAddr":"XX.XX.XX.XX","user":"raymo","app":"libresign","method":"GET","url":"/nextcloud/ocs/v2.php/apps/libresign/api/v1/admin/configure-check","message":"output of version","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36","version":"29.0.1.1","data":{"app":"libresign","version":"[\"sh: 1: -jar: not found\"]"}}
{"reqId":"XXXXXXXX","level":0,"time":"2024-05-30T19:46:33+00:00","remoteAddr":"XX.XX.XX.XX","user":"raymo","app":"libresign","method":"GET","url":"/nextcloud/ocs/v2.php/apps/libresign/api/v1/admin/configure-check","message":"Exists first row","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36","version":"29.0.1.1","data":{"app":"libresign","exists":"yes"}}
{"reqId":"XXXXXXXX","level":0,"time":"2024-05-30T19:46:33+00:00","remoteAddr":"XX.XX.XX.XX","user":"raymo","app":"libresign","method":"GET","url":"/nextcloud/ocs/v2.php/apps/libresign/api/v1/admin/configure-check","message":"First row","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36","version":"29.0.1.1","data":{"app":"libresign","version":"sh: 1: -jar: not found"}}
{"reqId":"XXXXXXXX","level":0,"time":"2024-05-30T19:46:33+00:00","remoteAddr":"XX.XX.XX.XX","user":"raymo","app":"libresign","method":"GET","url":"/nextcloud/ocs/v2.php/apps/libresign/api/v1/admin/configure-check","message":"Return of regex","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36","version":"29.0.1.1","data":{"app":"libresign","version":"[]"}}
from libresign.
Seems like javaPath is empty, and indeed if I add this:
$javaPath = $this->appConfig->getAppValue('java_path');
+ \OC::$server->getLogger()->debug('java path', ['app' => 'libresign', 'javaPath' => $javaPath]);
I get
{"reqId":"XXXXXXXX","level":0,"time":"2024-05-30T19:53:14+00:00","remoteAddr":"XX.XX.XX.XX","user":"raymo","app":"libresign","method":"GET","url":"/nextcloud/ocs/v2.php/apps/libresign/api/v1/admin/configure-check","message":"java path","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36","version":"29.0.1.1","data":{"app":"libresign","javaPath":""}}
from libresign.
I can fix it by installing java instead of using OS java, (occ libresign:install --java
).
I see in @stepcellwolf's screenshot that he also didn't run that. Perhaps the java check should set java_path
if OS java is detected, or OS java shouldn't be allowed at all?
from libresign.
if OS java is detected, or OS java shouldn't be allowed at all?
Will be complex to check if have Java installed at OS to use this and also could have side effects using a java version that isn't the same that is used by LibreSign.
from libresign.
Related Issues (20)
- Configuration for Nextcloud Groups, does not persist HOT 4
- Internal error when signing HOT 12
- filter the listing of files at API side by status
- Fix pagination HOT 16
- Customize border or qr code at footer HOT 7
- Libresign:Install scripts doesn't seem to work properly. HOT 3
- chmod(): Operation not permitted at lib/Service/Install/InstallService.php#599 HOT 16
- SignFileService::forceSaveFileOfDifferentUser(): Argument #2 ($content) must be of type string, bool given HOT 1
- Integrate with app Intros
- Unable to install java/jsignpdf/pdftk from command line on Nextcloud v28.0.2 HOT 1
- Install scripts doesn't seem to work properly --> continuation from #3292 HOT 2
- Nextcloud AIO 29.0.3 and LibreSign 9.1.3 can't get past 'Invalid hash of binaries files.' error HOT 6
- Could not create folder "/appdata_oc4nx8lg6f3y/libresign/ HOT 2
- Incompatibility with groupfolders app when limiting LibreSign to groups HOT 3
- Cannot install dependencies HOT 17
- Signature Pic isn't shown. HOT 4
- Libre Sign password recover HOT 3
- Browsing a folder with numeric name leads to error HOT 2
- browsing cloud files never loads HOT 3
- Some improvements at devcontainer setup flow HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libresign.