![]() |
#391 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,635
Karma: 204624552
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Everything I see referencing this error ultimately mentions something about being unable to determine "user.dir". Which sounds ominously similar to the description of the epubcheck bug you reported here: https://github.com/w3c/epubcheck/issues/1181 perhaps the latest JDK has merely exposed a preexisting epubcheck problem?
Last edited by DiapDealer; 12-14-2020 at 07:38 PM. |
![]() |
![]() |
![]() |
#392 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,828
Karma: 6120478
Join Date: Nov 2009
Device: many
|
If so, the latest version of the epubcheck should workaround that. So it should only be an issue for an old version of epubcheck anymore.
I will upgrade the epubcheck plugin to the latest on my mac tomorrow and see if I can recreate the issue. |
![]() |
![]() |
Advert | |
|
![]() |
#393 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,635
Karma: 204624552
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
The fix for the issue you reported isn't in the latest epubcheck (4.2.4) though, is it? It looked to me that it was earmarked for possible inclusion in the next release (4.2.5).
|
![]() |
![]() |
![]() |
#394 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,828
Karma: 6120478
Join Date: Nov 2009
Device: many
|
I just downloaded the latest and the fix was in it and everything worked just fine with my older JDK.
Went to Oracle and downloaded the very latest JDK: java version "11.0.9" 2020-10-20 LTS Java(TM) SE Runtime Environment 18.9 (build 11.0.9+7-LTS) Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.9+7-LTS, mixed mode) Then tried the exact same epubcheck plugin again and got the same error you are showing. But that error is bogus. The fix was to change the user.dir property so that it did not default to root "/". I just added some debug print statements on epubcheck and here is the user.dir value that is properly being set (which fixed the epubcheck bug we saw earlier). -Duser.dir="/Users/kbhend/Library/Application Support/sigil-ebook/sigil/plugins/EpubCheck/" And that is a valid existing absolute path (properly quoted for spaces). It clearly is not a relative path but this is what the error message says: Caused by: java.lang.RuntimeException: default directory must be absolute Well you can not get any more absolute than that. There are no symlinks in that path either. So something seems to be broken with the very latest JDK from Oracle as that is an existing valid value for user.dir (and is much better than the previous version that set it to absolute "/" as before. Using a subprocess in python to launch a command line java program ends with the latest JDK improperly setting its user.dir value to "/" which broke epubcheck. Not sure how to fix this except to downgrade to and earlier version of the Java JDK on macOS. |
![]() |
![]() |
![]() |
#395 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,635
Karma: 204624552
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Did you check to see if it all works as it should outside of Sigil? That's the part that seems odd to me. From a terminal, everything seems to work with the latest JDK.
|
![]() |
![]() |
Advert | |
|
![]() |
#396 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,828
Karma: 6120478
Join Date: Nov 2009
Device: many
|
Yes because it is not being launched by a Python subprocess and sets user.dir properly to match.
This fix is due to the bug in epubcheck that I posted about but the fix for it was to properly set user.dir. But this seems to break in newer java's |
![]() |
![]() |
![]() |
#397 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,635
Karma: 204624552
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Ahhh, I see. Hopefully a workaround for the plugin will present itself. Wondering if setting the cwd in python to match user.dir would have any effect.
|
![]() |
![]() |
![]() |
#398 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,828
Karma: 6120478
Join Date: Nov 2009
Device: many
|
I have just run lots of tests. The problem is any and all values of user.dir passed in now cause that exception. Even if I had code it to an existing user.dir of "/tmp".
This new jdk is broken since it will not allow any user.dir value to be set. |
![]() |
![]() |
![]() |
#399 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,828
Karma: 6120478
Join Date: Nov 2009
Device: many
|
Please try this command line in the terminal and let me know if you are seeing the same thing:
/usr/bin/java -Duser.dir="/tmp" -Dfile.encoding=UTF8 -jar path_to_epubcheck_jar path_to_epub Does it throw the runtime exception? |
![]() |
![]() |
![]() |
#400 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,828
Karma: 6120478
Join Date: Nov 2009
Device: many
|
I tried it on my machine and no exception but the exact same line run in the python subprocess barfs but only for the newest jdk. All older jdks work fine.
|
![]() |
![]() |
![]() |
#401 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,828
Karma: 6120478
Join Date: Nov 2009
Device: many
|
Would you believe it was caused by the " character surrounding the user.dir path?
So to fix this we can just remove the " characters and use -Duser.dir=/tmp hardcoded and it should all just work even with the new jdk |
![]() |
![]() |
![]() |
#402 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,635
Karma: 204624552
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
I'm glad you solved it while I was fighting with my VM to get it to execute commands in a terminal with directories that had spaces in their names. None of the usual Linux/Windows methods of surrounding the paths with quotes would work!
![]() But at least I learned something new about Macs. ![]() |
![]() |
![]() |
![]() |
#403 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,828
Karma: 6120478
Join Date: Nov 2009
Device: many
|
So for the latest JDK to work there must be no " or ' after the -Duser.dir= or it will barf.
So to get this to work we need to change the plugin.py to the following after the if isosx test: Code:
#---------------------------------------------------------------------- # define epubcheck command line parameters #---------------------------------------------------------------------- epc_path = os.path.join(plugin_path, 'epubcheck.jar') if is32bit: args = [java_path, '-Dfile.encoding=UTF8', '-Xss1024k', '-jar', epc_path, epub_path, '--version'] else: if isosx: user_dir_value = '-Duser.dir=' + os.path.join(bk._w.plugin_dir, bk._w.plugin_name, 'temp.epub') + "/" args = [java_path, user_dir_value, '-Dfile.encoding=UTF8', '-jar', epc_path, epub_path, '--version'] else: args = [java_path, '-Dfile.encoding=UTF8', '-jar', epc_path, epub_path, '--version'] This is strange as under a real shell running in Terminal.app, using quotes around the for the --Duser.dir value works just fine. So this is some interaction between the shell, and python3.8 subprocess and the very latest jdk's. But we can just as easily change: user_dir_value = '-Duser.dir=' + os.path.join(bk._w.plugin_dir, bk._w.plugin_name, 'temp.epub') + "/" to: user_dir_value = '-Duser.dir=/tmp' And that is enough to work around the epubcheck bug. I wonder if this is bash to zsh change related? Last edited by KevinH; 12-15-2020 at 12:11 AM. |
![]() |
![]() |
![]() |
#404 |
Member
![]() Posts: 11
Karma: 10
Join Date: Feb 2017
Device: Android Tablet
|
I have been using EPUBCheck with both Calibre and Sigil. When installing the plugin on Calbre I had no problem, worked immediately. Not so with Sigil.
I received the following error: Code:
Status: failed Running EPUBCheck v4.2.4... please wait. Traceback (most recent call last): File "C:\Program Files\Sigil\plugin_launchers\python\launcher.py", line 142, in launch self.exitcode = target_script.run(container) File "C:\Users\user\AppData\Local\sigil-ebook\sigil\plugins\EpubCheck\plugin.py", line 484, in run result = jar_wrapper(*args) File "C:\Users\user\AppData\Local\sigil-ebook\sigil\plugins\EpubCheck\plugin.py", line 44, in jar_wrapper process = Popen(args, stdout=PIPE, stderr=PIPE, shell=False) File "subprocess.py", line 854, in __init__ File "subprocess.py", line 1307, in _execute_child FileNotFoundError: [WinError 2] The system cannot find the file specified Error: [WinError 2] The system cannot find the file specified I also ran: java -jar epubcheck.jar ebook.epub, again the check completed and results were displayed. I went back to Sigil and attempted to run the plugin again. I get the same error every time. I can run EPUBCheck through the terminal and Calibre with no problems. Just not with Sigil seems. I would really like to get this working with Sigil. |
![]() |
![]() |
![]() |
#405 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,735
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
Please delete EpubCheck.json file in ... AppData\Local\sigil-ebook\sigil\plugins_prefs\EpubCheck and re-install the plugin. Last edited by Doitsu; 12-15-2020 at 06:02 AM. |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Plugin] PunctuationSmarten Sigil plugin | DiapDealer | Plugins | 143 | 07-30-2025 06:58 AM |
[Plugin] KindleImport Sigil plugin | DiapDealer | Plugins | 187 | 07-04-2022 10:11 AM |
Sigil Plugin Index | Thasaidon | Plugins | 0 | 10-04-2014 07:41 AM |
FC and Sigil 0.5.3 ePUBcheck failure | Hitch | Sigil | 32 | 04-17-2012 02:56 AM |
Web-based epubcheck upgraded to epubcheck 1.0.5 | kjk | ePub | 4 | 02-09-2010 09:53 PM |