libresign icon indicating copy to clipboard operation
libresign copied to clipboard

Setup with Nextcloud AIO

Open bigbeka opened this issue 2 years ago • 64 comments

Issue: Error - Java not installed message; Advice: Run occ libresign:install --java

To reproduce:

  • Download and enable LibreSign from list of Nextcloud apps
  • Click on 'Downloads Binaries'
  • Wait for the list of items to show up and some of them errored out

Screenshots Screenshot 2023-02-05 at 22 52 31

Environment information (please complete the following information):

  • OS: Proxmox > LXC > Docker > Nextcloud official container
  • Browser Safari
  • LibreSign Version 6.2.5
  • Nextcloud Server Version 25.0.3

Searching here or elsewhere did not reveal that someone else had similar issue.

bigbeka avatar Feb 05 '23 22:02 bigbeka

I tried on two versions - Ubuntu latest + apache + nextcloud and mac M1 native docker + nextcloud. There is a similar error, more precisely - on 6.2.5 Java installation error, and on 6.2.3 cfssl installation and configuration error. Also tried to manually install all dependencies via php occ libresign:install --all. Installation doesn't throw errors, but dependency validation fails.

It seems to me that developers may return the http api url manual installation mode to be able to install packages in a separate container / vm. Or add the ability to provide installation of dependencies from an offline bundle package

Prodject avatar Feb 13 '23 07:02 Prodject

@Prodject Thanks for the followup message and further reproducing. Hoping to get this sorted soon.

bigbeka avatar Feb 13 '23 10:02 bigbeka

Hoping to get this sorted soon

I tried to roll back to version 4.2.1 - I got a successful result of downloading dependencies. I also tried to update the version to 6.2.5 - the dependencies were preserved, but there was a bug that the current signature could not be changed. In v.4.2.1 there was also a bug with a signature overlay conflict in pdf, I could not fix it either, and it was saved in 6.2.5.

Prodject avatar Feb 13 '23 16:02 Prodject

Could you try in the latest release (6.2.6)? Note that this release is compatible with Nextcloud 25 only. We do not support previous versions anymore, as we haven't sufficient funding at the moment.

lhsazevedo avatar Feb 15 '23 03:02 lhsazevedo

@lhsazevedo updated LibreSign to 6.2.6 with Nextcloud being 25.0.3, tried to 'Download binaries', still shows the same errors. I have also tried to remove LibreSign completely and 'Download and Enable' from within the UI, no luck there either. Any other troubleshooting I can be doing? Nextcloud docker logs does't shown any errors while 'Download binaries' process.

bigbeka avatar Feb 15 '23 10:02 bigbeka

Could you try in the latest release (6.2.6)? Note that this release is compatible with Nextcloud 25 only. We do not support previous versions anymore, as we haven't sufficient funding at the moment.

I have now tried a clean installation of docker v.4.16.2 + nextcloud latest (docker pull nextcloud:latest) + LibreSign 6.2.6. After clicking the "Download" button, the installation lasts only a few seconds and the button becomes active again (at the same time, only one dependency is installed). In version 6.2.5 there was an identical error (loading only a few seconds) nxt

Prodject avatar Feb 15 '23 17:02 Prodject

Thanks for reporting @bigbeka and @Prodject. I'll setup environments similar to yours and try to reproduce the issue to further investigate this problem.

lhsazevedo avatar Feb 17 '23 16:02 lhsazevedo

@lhsazevedo many thanks. I will run a fresh install on a fresh VM, and try to run LibreSign's download binaries as well and see if that works out.

bigbeka avatar Feb 17 '23 20:02 bigbeka

Okay, so this is interesting. Fresh VM > Fresh Docker & Compose > Fresh Nextcloud install. And it worked, I can’t get the imagick working to generate the previews when assigning signature positions on the actual pdfs.

@lhsazevedo what would you suggest the next troubleshooting should be? How do I get LibreSign working on my production?

I have disabled most of the apps on my Nextcloud instance to test if there are any conflicts (no luck here).

Screenshot from test setup:

bigbeka avatar Feb 19 '23 13:02 bigbeka

I'm glad you made it. Now looks like you are missing the optional ghostscript dependency, that is only need for adding visible signatures.

Since you are using the Nextcloud AIO container, you'll need to add it to the NEXTCLOUD_ADDITIONAL_APKS environment variable and rebuild the image. Read more about it: How to add OS packages permanently to the Nextcloud container?. Make sure to also specify the default imagemagick, as the doc warns.

@Prodject I've just released a new version (6.2.7) which fixes a bug in the "download binaries" that was preventing the progress bars from showing which might fix your issue. Could you try again with this new version, in a clean installation?

lhsazevedo avatar Feb 21 '23 08:02 lhsazevedo

@lhsazevedo Would you look at that! Many thanks for the update, LibreSign 6.2.7 did the trick with my production as well (I just had to update LibreSign in Nextcloud GUI), all success apart from imagick, which I believe I will need to rebuild NextCloud AIO with Nextcloud_additional_APKS as you mentioned. Thank you for the link and your work on this!

Screenshot 2023-02-21 at 09 25 02

@lhsazevedo Off-topic question: Is there a way to ask for signatures without requiring for an account? This features would really get it close to DocuSign (Clinex of signature validations).

bigbeka avatar Feb 21 '23 08:02 bigbeka

Great! Happy to help. Let us know if you got it fully working.

At the moment, a Nextcloud account is required for signing the document, but we are aware that removing this requirement would fit LibreSign to lots of use cases out there. This will require some significant rework in the app though, we are planning this in #1406.

@Prodject I'm closing this for now, but don't hesitate to ping us if it still fails in a clean install.

lhsazevedo avatar Feb 22 '23 06:02 lhsazevedo

@lhsazevedo We might need to reopen this, as original issue came back, right after I tried to add "imagick" to -e NEXTCLOUD_ADDITIONAL_APKS and I re-pulled the latest Nextcloud Docker image in this process.

I can confirm that the same issue came up when I re-pulled the latest image for the fresh/test instance.

This is on my production instance: Screenshot 2023-02-22 at 22 15 05

Could you suggest how to go about this now?

bigbeka avatar Feb 22 '23 21:02 bigbeka

Thanks for reporting again. Sure. I suggest you to running the following commands:

# Uninstall all LibreSign binaries (Java, cfssl etc)
php occ libresign:uninstall --all

# Update Nextcloud filesystem nodes for libresign app data
php occ files:scan-app-data libresign

Then proceed to the settings page and try downloading the binaries again. I've found that sometimes I need to click "download binaries" button for a second time when the first one fails.

If that doesn't work, you could also repeat the commands above but this time download the binaries using the CLI:

# Uninstall LibreSign binary dependencies (Java, cfssl etc)
php occ libresign:uninstall --all

# Update Nextcloud filesystem nodes for libresign app data
php occ files:scan-app-data libresign

# Install LibreSign binary dependencies
php occ libresign:install --all

Either way, please report the results here to help us track this down.

lhsazevedo avatar Feb 22 '23 21:02 lhsazevedo

Many thanks @lhsazevedo , you are the best!

So I managed to get the dependencies installed with 3 CLI commands:

php occ libresign:uninstall --all php occ files:scan-app-data libresign php occ libresign:install --all

GUI 'Downloads binaries' did not help.

Running the second command gave me an error, which is not related to LibreSign, it is actually being tracked here.

I have also tried to recreate the Nextcloud container, dependencies seem to be working and are not showing any errors.

For the life of me, I can't get imagick working, as you suggested, I have added -e NEXTCLOUD_ADDITIONAL_APKS="imagick imagemagick".

  • Would you have any suggestions on this?
Screenshot 2023-02-23 at 02 39 46

bigbeka avatar Feb 23 '23 01:02 bigbeka

Reading through the internet, I came across this, which might be interesting: https://github.com/nextcloud/server/issues/13099#issue

Would you guys consider switching from imagick to something else as suggested in the above discussion?

bigbeka avatar Feb 23 '23 02:02 bigbeka

Thank you all for working on this, I have been following and trying the suggested resolutions. I keep getting this error in the GUI. It seems like a slight version mismatch in JRE:

Invalid java version. Found: sh: /mnt/ncdata/appdata_ocmmonyuk9bz/libresign/java/jdk-17.0.5+8-jre/bin/java: not found expected: openjdk version "17.0.5" 2022-10-18

Do you know if there is a mechanism to specify the correct version of java for the install? I am on the latest AIO deployment of Nextcloud on an Ubuntu VPS.

No problem, I'm learning a lot while trying to understand what is happening!

Oh, that should be -e NEXTCLOUD_ADDITIONAL_APKS="imagemagick ghostscript", where:

  • imagemagick is the sole default value of NEXTCLOUD_ADDITIONAL_APKS, we are just keeping it:

    By default added is imagemagick. If you want to keep that, you need to specify it. (source)

  • ghostscript is the dependency that was missing here

That should fix it.

Thanks for sharing the concerns around imagick vulnerabilities. The app uses it only for rendering pages when adding visible signatures, it would be necessary to estimate the work required to switch to a safer alternative like the new Imaginary service mentioned in the thread you sent. Would you mind creating an issue for this?


Hi @BicycleMarketResearchLLC, I guess the cause of your problem is not related to this one. Could you open a new issue for it?

lhsazevedo avatar Feb 23 '23 04:02 lhsazevedo

@bigbeka We improved error logging for the setup process in v6.2.9 (Nextcloud 25) and v7.0.0 (Nextcloud 26).

Maybe we can get more details about your issue. Try downloading binaries again and, if it fails, please share the last entries from data/nextcloud.log.

lhsazevedo avatar Mar 23 '23 00:03 lhsazevedo

Hi @lhsazevedo Thank you very much! I have now upgraded my NC25 to NC26.0.0

I had deleted LibreSign before doing this, so I downloaded LibreSign 7.0.0 and tried to download binaries and here are the errors that it output. Does it tell anything useful?

Screenshot 2023-03-23 at 13 40 15

bigbeka avatar Mar 23 '23 12:03 bigbeka

@lhsazevedo After trying (with no luck) the new version, I tried manually running CLI commands you shared above, and they worked as expected, but the imagemagick is still not working. 🤷‍♂️ I have added - NEXTCLOUD_ADDITIONAL_APKS="imagemagick ghostscript" in the Nextcloud's docker-compose environment script.

Any other thoughts on this?

Screenshot 2023-03-23 at 14 16 36

Oh, that should be -e NEXTCLOUD_ADDITIONAL_APKS="imagemagick ghostscript", where:

  • imagemagick is the sole default value of NEXTCLOUD_ADDITIONAL_APKS, we are just keeping it:

    By default added is imagemagick. If you want to keep that, you need to specify it. (source)

  • ghostscript is the dependency that was missing here

That should fix it.

bigbeka avatar Mar 23 '23 13:03 bigbeka

Ghostscript and ImageMagick is mandatory. You need to have both at server machine.

vitormattos avatar Mar 24 '23 09:03 vitormattos

Any other thoughts on this?

Either you do not have ghostscript installed or LibreSign wasn't able to detect it, the former is most likely. You can check by opening a shell in your Nextcloud container and typing gs --version.

lhsazevedo avatar Mar 24 '23 13:03 lhsazevedo

@lhsazevedo Thank you, as always, you were right, gs is not installed despite the fact that I have the -e NEXTCLOUD_ADDITIONAL_APKS="imagemagick ghostscript" added to my docker-compose.yml.

Your suggestions on this error would be greatly appreciated. I will do some googling.

bigbeka avatar Mar 25 '23 08:03 bigbeka

Hi @lhsazevedo Thank you very much! I have now upgraded my NC25 to NC26.0.0

I had deleted LibreSign before doing this, so I downloaded LibreSign 7.0.0 and tried to download binaries and here are the errors that it output. Does it tell anything useful?

Screenshot 2023-03-23 at 13 40 15

@lhsazevedo It would be great to resolve this, as I am back in square 1 with 'Download Binaries'. As soon as I re-pull the image and docker-compose up I get the following state:

Screenshot 2023-03-25 at 09 50 13

bigbeka avatar Mar 25 '23 08:03 bigbeka

Oops, I missed your comment about the error log. I'll take a look into it later this weekend. Thank you for your patience.

lhsazevedo avatar Mar 25 '23 11:03 lhsazevedo

Not at all, thank YOU for your help! Have a great weekend.On 25 Mar 2023, at 12:24, Lucas Azevedo @.***> wrote: Oops, I missed your comment about the error log. I'll take a look into it later this weekend. Thank you for your patience.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

bigbeka avatar Mar 25 '23 16:03 bigbeka

@lhsazevedo Any news on this? Is there anything I could troubleshoot?

bigbeka avatar Apr 11 '23 18:04 bigbeka

"Java not installed"

Cause:

Download of incompatible flavor of OpenJDK: linux - instead of alpine, which is the base for AIO NextCloud.

Suggestion(s):

Add fallback to OS environment java as it will be sufficiently expectable for Operator/Administrator.

Remove download(s) of external binaries:

  • Security issue - patching of 'embedded' java is completely reliant on Developer/Maintainer(s) of the app;
  • Single point of failure - completely dependent on existence and availability of GitHub.

"imagick/ghostscript "

Cause:

Narrow test for executable pass with single well-known name - ConfigureCheckService.php

Suggestion(s):

  • Extend heuristics for more well-known names/alias(es) and/or query distribution package manager for info;
  • Provide setting for manageable configuration.

Nocross avatar May 06 '23 14:05 Nocross

Hi, what about using -e NEXTCLOUD_ADDITIONAL_APKS="imagemagick openjdk17-jre ghostscript"

szaimen avatar May 08 '23 23:05 szaimen