Open swissguest opened 5 years ago
I am just reading through the snapcraft.yaml docs. If there is only one choice (of Strict, Classic, Devmode) per published snap, would it be an option to publish two snaps, e.g.: pdftk-classic pdftk-confined ?
Unusable on LinuxMint 19.1 due to these file access issues.
Did you verify that this works with files outside your home (or media) dir?
@swissguest I tried this, too. Negative. I got (almost) crazy.
Only the trick as described above helped finally.
BTW: I would prefer to compile pdftk by myself, not using snap, did this many times before, but this time on my new machine (LinuxMint 19.1) I failed.
BTW: I would prefer to compile pdftk by myself, not using snap, did this many times before, but this time on my new machine (LinuxMint 19.1) I failed.
The issue is not to compile pdftk, but compiling gcj. This is the missing dependency, and its development had been discontinued. That's why some people have started a pure-java porting effort.
Uh, yes, it looked so.
I have now verified the suggestion, and this does fix the issue on my Ubuntu 18.04 desktop:
sudo ln -s /snap/pdftk/current/usr/bin/pdftk /usr/bin/pdftk
On the sever side, I cannot verify, since we had already moved forward with the installation of an older pdftk deb package (hackish, but worked for us).
Should I close this issue? Or does somebody still require the pdftk snap to install in --classic mode (for other reason)?
My comment was off-topic here -- it was related to the closed file issues!
I could not activate "snap pdftk" with --classic.
I have now verified the suggestion, and this does fix the issue on my Ubuntu 18.04 desktop:
sudo ln -s /snap/pdftk/current/usr/bin/pdftk /usr/bin/pdftk
On the sever side, I cannot verify, since we had already moved forward with the installation of an older pdftk deb package (hackish, but worked for us).
Thanks!
At my side
sudo ln -s /snap/pdftk/current/usr/bin/pdftk /usr/bin/pdftk
sudo rm /snap/bin/pdftk
sudo ln -s /usr/bin/pdftk /snap/bin/pdftk
@hacmieu : thanks, your solution worked for me! :-)
the above does not fix it for me, it has been a long time since the last suggestion but I am stuck as such
$ pdftk eStatement_Acc_6479_20240430.pdf 12345 ouput eStatement_Acc_647920240430.pdf Error: Unexpected Exception in open_reader() Unhandled Java Exception in main(): java.lang.NullPointerException at gnu.gcj.runtime.NameFinder.lookup(libgcj.so.16) at java.lang.Throwable.getStackTrace(libgcj.so.16) at java.lang.Throwable.stackTraceString(libgcj.so.16) at java.lang.Throwable.printStackTrace(libgcj.so.16) at java.lang.Throwable.printStackTrace(libgcj.so.16)
After googling numerous issues regarding "pdftk no longer available on Ubuntu 18.04", and having learned about the snapd confinement policies, I decided that it would be best for our server setup (where we cannot provide the files in /home/ or /media/) to install the pdftk snap with the --classic option.
However, the --classic confinement option fails on our server:
Is this an option that you would need to support with your snap? Or is there any other reason I am seeing this error? I am also aware of user gspettel, commented on Oct 11, 2018 on issue #3, suggesting exactly the same procedure, this makes me wonder if something broke just recently?
Please note that a "sudo snap install pdftk" without the --classic option works just fine. However, the runtime would then fail to access our files due to the known confinement restrictions, as already discussed elsewhere.