Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 12-14-2020, 07:36 PM   #391
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
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.
DiapDealer is offline   Reply With Quote
Old 12-14-2020, 09:31 PM   #392
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
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.
KevinH is offline   Reply With Quote
Advert
Old 12-14-2020, 09:51 PM   #393
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
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).
DiapDealer is offline   Reply With Quote
Old 12-14-2020, 10:26 PM   #394
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
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.
KevinH is offline   Reply With Quote
Old 12-14-2020, 10:37 PM   #395
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
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.
DiapDealer is offline   Reply With Quote
Advert
Old 12-14-2020, 10:44 PM   #396
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
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
KevinH is offline   Reply With Quote
Old 12-14-2020, 10:52 PM   #397
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
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.
DiapDealer is offline   Reply With Quote
Old 12-14-2020, 11:01 PM   #398
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
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.
KevinH is offline   Reply With Quote
Old 12-14-2020, 11:05 PM   #399
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
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?
KevinH is offline   Reply With Quote
Old 12-14-2020, 11:12 PM   #400
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
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.
KevinH is offline   Reply With Quote
Old 12-14-2020, 11:56 PM   #401
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
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
KevinH is offline   Reply With Quote
Old 12-15-2020, 12:02 AM   #402
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
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.
DiapDealer is offline   Reply With Quote
Old 12-15-2020, 12:07 AM   #403
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
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']
I have no idea if this version without the quotes will work on older JDK's.

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.
KevinH is offline   Reply With Quote
Old 12-15-2020, 03:35 AM   #404
jennie2486
Member
jennie2486 began at the beginning.
 
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
So, I ran: java -jar epubcheck.jar, and it completes the check successfully.

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.
jennie2486 is offline   Reply With Quote
Old 12-15-2020, 05:59 AM   #405
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,735
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by jennie2486 View Post
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.
What are your Windows and Sigil versions?

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.
Doitsu is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 02:50 AM.


MobileRead.com is a privately owned, operated and funded community.