SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Github Development
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV Github Development Discussion related to SageTV Open Source Development. Use this forum for development topics about the Open Source versions of SageTV, hosted on Github.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-17-2017, 01:09 PM
Narflex's Avatar
Narflex Narflex is offline
Sage
 
Join Date: Feb 2003
Location: Redondo Beach, CA
Posts: 6,349
Question Automatic removal of bad Lucene JAR file

What do people think about doing the following:

In Sage.java when it starts up, look in the JARs folder and see if there are 2 Lucene jar files, one of them of course must be the new one we are requiring. If it finds 2 of them, then it uses the plugin update feature to indicate that it should delete the bad lucene JAR file. It then forces a SageTV restart, which will then delete the bad Lucene jar file and then let SageTV startup normally.

This will avoid people having the problem with the Lucene JAR file when they upgrade. (yeah, I should have thought of this sooner)

I have no problem writing this myself, it should be fairly easy to code.
__________________
Jeffrey Kardatzke
Google
Founder of SageTV
Reply With Quote
  #2  
Old 01-17-2017, 01:28 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by Narflex View Post
What do people think about doing the following:

In Sage.java when it starts up, look in the JARs folder and see if there are 2 Lucene jar files, one of them of course must be the new one we are requiring. If it finds 2 of them, then it uses the plugin update feature to indicate that it should delete the bad lucene JAR file. It then forces a SageTV restart, which will then delete the bad Lucene jar file and then let SageTV startup normally.

This will avoid people having the problem with the Lucene JAR file when they upgrade. (yeah, I should have thought of this sooner)

I have no problem writing this myself, it should be fairly easy to code.
Make it so I have thought about doing this myself.... but I likely won't have time, so, yeah I think it's a good idea.
Reply With Quote
  #3  
Old 01-17-2017, 01:33 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Longer term, I think that all SageTV core jars should be in a SystemJARs folder (or just called "lib"), separate from the JARs folder (used by plugins), so that we can put Sage.jar, SystemJARs, and then JARs in the classpath, in that order. That would prevent plugins from overriding System Jars (or in this case, a new System Jar that conclicts with the plugins).

But I think a good, quick first step, is to simply do the check on startup for the lucene jar as you suggested.
Reply With Quote
  #4  
Old 01-17-2017, 01:39 PM
Tiki's Avatar
Tiki Tiki is offline
Sage Icon
 
Join Date: Feb 2005
Location: Southwest Florida, USA
Posts: 2,009
Quote:
Originally Posted by Narflex View Post
What do people think about doing the following:

In Sage.java when it starts up, look in the JARs folder and see if there are 2 Lucene jar files, one of them of course must be the new one we are requiring. If it finds 2 of them, then it uses the plugin update feature to indicate that it should delete the bad lucene JAR file. It then forces a SageTV restart, which will then delete the bad Lucene jar file and then let SageTV startup normally.

This will avoid people having the problem with the Lucene JAR file when they upgrade. (yeah, I should have thought of this sooner)

I have no problem writing this myself, it should be fairly easy to code.
I think it's a good idea. One comment though... When I went through the upgrade process last week, I got caught by this issue. I knew what the problem was right away when it hung on the splash screen because I'd seen enough posts about it on the forums. After I manually deleted the old Lucene jars and restarted Sage everything worked, but I got a warning that Sage was unable to find the now missing old Lucene jar, because I still had some plugin installed that was looking for it.
__________________
Server: Ryzen 2400G with integrated graphics, ASRock X470 Taichi Motherboard, HDMI output to Vizio 1080p LCD, Win10-64Bit (Professional), 16GB RAM
Capture Devices (7 tuners): Colossus (x1), HDHR Prime (x2)
,USBUIRT (multi-zone)
Source:
Comcast/Xfinity X1 Cable
Primary Client: Server Other Clients: (1) HD200, (1) HD300
Retired Equipment: MediaMVP, PVR150 (x2), PVR150MCE,
HDHR, HVR-2250, HD-PVR
Reply With Quote
  #5  
Old 01-17-2017, 02:42 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by Tiki View Post
I think it's a good idea. One comment though... When I went through the upgrade process last week, I got caught by this issue. I knew what the problem was right away when it hung on the splash screen because I'd seen enough posts about it on the forums. After I manually deleted the old Lucene jars and restarted Sage everything worked, but I got a warning that Sage was unable to find the now missing old Lucene jar, because I still had some plugin installed that was looking for it.
After doing the upgrade, and then updating the plugins (there should have been a bunch of updates to various plugins), did the message go away? Phoenix used to have a dependency on lucene, but I removed it when this issue started happening.. but likely the lucene library plugin was still installed, so maybe that's where it's coming from.
Reply With Quote
  #6  
Old 01-17-2017, 03:08 PM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,851
As I was the first person bitten by this bug, I agree it should be fixed

I like Sean's idea of a System JARs folder. That seems to make more sense than putting lucene (and maybe others in the future) into the "plugin" JARs folder.
__________________

Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders.
Reply With Quote
  #7  
Old 01-17-2017, 03:30 PM
Fuzzy's Avatar
Fuzzy Fuzzy is offline
SageTVaholic
 
Join Date: Sep 2005
Location: Jurupa Valley, CA
Posts: 9,957
Quote:
Originally Posted by Narflex View Post
What do people think about doing the following:

In Sage.java when it starts up, look in the JARs folder and see if there are 2 Lucene jar files, one of them of course must be the new one we are requiring. If it finds 2 of them, then it uses the plugin update feature to indicate that it should delete the bad lucene JAR file. It then forces a SageTV restart, which will then delete the bad Lucene jar file and then let SageTV startup normally.

This will avoid people having the problem with the Lucene JAR file when they upgrade. (yeah, I should have thought of this sooner)

I have no problem writing this myself, it should be fairly easy to code.
I had thought about this before, but was unsure if it would even get to the point of getting the JVM up and running SageTV.java before the classpath issue causes a problem (I don't know enough about java to know this). I had assumed we'd need to do a check for this in the launcher, before building the classpath and passing it to java, which would be much clunkier.
__________________
Buy Fuzzy a beer! (Fuzzy likes beer)

unRAID Server: i7-6700, 32GB RAM, Dual 128GB SSD cache and 13TB pool, with SageTVv9, openDCT, Logitech Media Server and Plex Media Server each in Dockers.
Sources: HRHR Prime with Charter CableCard. HDHR-US for OTA.
Primary Client: HD-300 through XBoxOne in Living Room, Samsung HLT-6189S
Other Clients: Mi Box in Master Bedroom, HD-200 in kids room
Reply With Quote
  #8  
Old 01-17-2017, 03:48 PM
Tiki's Avatar
Tiki Tiki is offline
Sage Icon
 
Join Date: Feb 2005
Location: Southwest Florida, USA
Posts: 2,009
Quote:
Originally Posted by stuckless View Post
After doing the upgrade, and then updating the plugins (there should have been a bunch of updates to various plugins), did the message go away? Phoenix used to have a dependency on lucene, but I removed it when this issue started happening.. but likely the lucene library plugin was still installed, so maybe that's where it's coming from.
Actually, I think there was only one update message, which surprised me, but then I don't have all that many plugins installed.

Once I saw the error about the missing Lucene.jar, I went to the installed plugins section and looked for ones that had notices about updates (there were 3 or 4). However, when I tried to update, I ran into the problem where it could not locate commons.io on sourceforge. This would cause the update to fail and the plugin I was attempting to update would then disappear from the installed plugins list. I know this happened with 2 or 3 plugins (one was the CMT plugin and I think another was Phoenix Fanart for default STV - both of these depend on Phoenix core).

I remembered seeing forum posts that there was a Java issue related to accessing some plugin locations (I think it was that some of the plug repositories had gone to HTTPS and you needed at least Java 8 to work access these locations). So, I upgraded from Java 1.7 to 1.8 and then tried to re-install my plugins - this time they worked fine.

This was all last week, before you moved some of the libraries to a new host. So, hopefully, the commons.io problem is fixed now. Though I do wonder why failed plugin updates would cause the plugins to be removed from the installed plugins list (as far as I could tell, they weren't actually removed).
__________________
Server: Ryzen 2400G with integrated graphics, ASRock X470 Taichi Motherboard, HDMI output to Vizio 1080p LCD, Win10-64Bit (Professional), 16GB RAM
Capture Devices (7 tuners): Colossus (x1), HDHR Prime (x2)
,USBUIRT (multi-zone)
Source:
Comcast/Xfinity X1 Cable
Primary Client: Server Other Clients: (1) HD200, (1) HD300
Retired Equipment: MediaMVP, PVR150 (x2), PVR150MCE,
HDHR, HVR-2250, HD-PVR
Reply With Quote
  #9  
Old 01-17-2017, 05:23 PM
EnterNoEscape's Avatar
EnterNoEscape EnterNoEscape is offline
SageTVaholic
 
Join Date: Jun 2010
Location: Harrisburg, PA
Posts: 2,657
Quote:
Originally Posted by Tiki View Post
I remembered seeing forum posts that there was a Java issue related to accessing some plugin locations (I think it was that some of the plug repositories had gone to HTTPS and you needed at least Java 8 to work access these locations). So, I upgraded from Java 1.7 to 1.8 and then tried to re-install my plugins - this time they worked fine.
1.7 will work with HTTPS. I verified all of this prior to enabling it's usage in v9. It's more likely the plugins are being built against 1.8.
__________________
SageTV v9 Server: ASRock Z97 Extreme4, Intel i7-4790K @ 4.4Ghz, 32GB RAM, 6x 3TB 7200rpm HD, 2x 5TB 7200rpm HD, 2x 6TB 7200rpm HD, 4x 256GB SSD, 4x 500GB SSD, unRAID Pro 6.7.2 (Dual Parity + SSD Cache).
Capture: 1x Ceton InfiniTV 4 (ClearQAM), 2x Ceton InfiniTV 6, 1x BM1000-HDMI, 1x BM3500-HDMI.

Clients: 1x HD300 (Living Room), 1x HD200 (Master Bedroom).
Software: OpenDCT :: WMC Live TV Tuner :: Schedules Direct EPG
Reply With Quote
  #10  
Old 01-17-2017, 05:31 PM
AlphaCrew AlphaCrew is offline
Sage Aficionado
 
Join Date: May 2010
Location: Whosevile
Posts: 303
As I'm starting to move toward V9, reading through all the great work everyone has done, I wondered why V9 didn't automatically remove it.

So yeah, I think it's a great idea.
Reply With Quote
  #11  
Old 01-17-2017, 06:54 PM
Thomas Wischgol's Avatar
Thomas Wischgol Thomas Wischgol is offline
Sage Aficionado
 
Join Date: Sep 2005
Posts: 276
Quote:
Originally Posted by stuckless View Post
After doing the upgrade, and then updating the plugins (there should have been a bunch of updates to various plugins), did the message go away? Phoenix used to have a dependency on lucene, but I removed it when this issue started happening.. but likely the lucene library plugin was still installed, so maybe that's where it's coming from.
I ran into the exact same issue when upgrading to v9 a week ago. After deleting the old lucene jar it complained in the log file and would not start up at all. In order to delete the plugin, I rolled back to v7 and then updated the "Complementary Metadata Tools". This then allowed me to delete the old lucene plugin. After that I reinstalled v9 over it and everything went fine from there (except that I could not install v9 clients on XP so I had to upgrade all clients to Windows 7 first).
Reply With Quote
  #12  
Old 01-17-2017, 10:56 PM
JREkiwi's Avatar
JREkiwi JREkiwi is offline
Sage Icon
 
Join Date: Jan 2005
Location: Auckland, New Zealand
Posts: 2,132
Quote:
Originally Posted by Thomas Wischgol View Post
I ran into the exact same issue when upgrading to v9 a week ago. After deleting the old lucene jar it complained in the log file and would not start up at all. In order to delete the plugin, I rolled back to v7 and then updated the "Complementary Metadata Tools". This then allowed me to delete the old lucene plugin. After that I reinstalled v9 over it and everything went fine from there (except that I could not install v9 clients on XP so I had to upgrade all clients to Windows 7 first).
That would have fixed it because the newer version of CMT has the later versions of Phoenix as a pre-req.

John
Reply With Quote
  #13  
Old 01-18-2017, 01:27 PM
Narflex's Avatar
Narflex Narflex is offline
Sage
 
Join Date: Feb 2003
Location: Redondo Beach, CA
Posts: 6,349
After some thought...I think there's an even better way to do this. Ideally, we won't remove the bad lucene JAR file so plugins do not complain. From some reading, it does appear that the JVM will search the classpath in the order it is specified on the command line. So if we just put the included lucene JAR file as the first entry in the classpath (after Sage.jar), then it will always use that one instead of the one that may come from a plugin. I also wrote a test and it was working this way (at least with OpenJDK on Linux). But logically, I see no reason it would behave any other way than searching the classpath in the order specified.

This would then just require changing the startsagecore script on Linux and launcher.cpp on Windows so that it forcibly puts the included lucene JAR file as the first entry.

Anybody see any problems with that approach?
__________________
Jeffrey Kardatzke
Google
Founder of SageTV
Reply With Quote
  #14  
Old 01-18-2017, 01:41 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by Narflex View Post
After some thought...I think there's an even better way to do this. Ideally, we won't remove the bad lucene JAR file so plugins do not complain. From some reading, it does appear that the JVM will search the classpath in the order it is specified on the command line. So if we just put the included lucene JAR file as the first entry in the classpath (after Sage.jar), then it will always use that one instead of the one that may come from a plugin. I also wrote a test and it was working this way (at least with OpenJDK on Linux). But logically, I see no reason it would behave any other way than searching the classpath in the order specified.

This would then just require changing the startsagecore script on Linux and launcher.cpp on Windows so that it forcibly puts the included lucene JAR file as the first entry.

Anybody see any problems with that approach?
That will work. Java does search the classpath in order, which is why I said it would a nice future enhancement to separate the jars and put the sage system ones in a separate folder. But yeah, we could add lucene (and the other sagetv core jars) explicitly to the start of the classpath. Also if we do this change, I'd like to see "." removed from the classpath... I'm not sure why it gets added, but, it caused me some grief some months ago

I assume you are still volunteering to do this
Reply With Quote
  #15  
Old 01-18-2017, 01:50 PM
Narflex's Avatar
Narflex Narflex is offline
Sage
 
Join Date: Feb 2003
Location: Redondo Beach, CA
Posts: 6,349
Quote:
Originally Posted by stuckless View Post
That will work. Java does search the classpath in order, which is why I said it would a nice future enhancement to separate the jars and put the sage system ones in a separate folder. But yeah, we could add lucene (and the other sagetv core jars) explicitly to the start of the classpath. Also if we do this change, I'd like to see "." removed from the classpath... I'm not sure why it gets added, but, it caused me some grief some months ago

I assume you are still volunteering to do this
Yup, I'll get it done right now.
__________________
Jeffrey Kardatzke
Google
Founder of SageTV
Reply With Quote
  #16  
Old 01-18-2017, 02:12 PM
Narflex's Avatar
Narflex Narflex is offline
Sage
 
Join Date: Feb 2003
Location: Redondo Beach, CA
Posts: 6,349
OK, commit is in...hopefully it'll compile fine on Windows since I couldn't verify that...lol.
__________________
Jeffrey Kardatzke
Google
Founder of SageTV
Reply With Quote
  #17  
Old 01-18-2017, 03:44 PM
sflamm sflamm is offline
Sage Icon
 
Join Date: Mar 2009
Posts: 1,653
The only issue with that is if any of the old plugins rely on methods in the old Lucene interface that are no longer present in the new version... otherwise it is fine.

Probably the methods are deprecated and not removed..

I believe the best answer is to:

1. create a System Jar
2. issue the classpath on the command line to include the System Jar after SageTV
3. update all the plugins to use the proper version of Lucene
Reply With Quote
  #18  
Old 01-18-2017, 07:23 PM
jusjoken jusjoken is offline
SageTVaholic
 
Join Date: Dec 2005
Location: Strathmore, AB
Posts: 2,727
Quote:
Originally Posted by Narflex View Post
OK, commit is in...hopefully it'll compile fine on Windows since I couldn't verify that...lol.
if nobody does it first i will try a windows build and installer release this weekend.

k
__________________
If you wish to see what I am up to and support my efforts visit my Patreon page
Reply With Quote
  #19  
Old 01-19-2017, 12:16 PM
Narflex's Avatar
Narflex Narflex is offline
Sage
 
Join Date: Feb 2003
Location: Redondo Beach, CA
Posts: 6,349
Quote:
Originally Posted by jusjoken View Post
if nobody does it first i will try a windows build and installer release this weekend.

k
Thanks, please do!
__________________
Jeffrey Kardatzke
Google
Founder of SageTV
Reply With Quote
  #20  
Old 01-19-2017, 01:09 PM
jusjoken jusjoken is offline
SageTVaholic
 
Join Date: Dec 2005
Location: Strathmore, AB
Posts: 2,727
Quote:
Originally Posted by Narflex View Post
Thanks, please do!
Done.

I created a test on a V7 install that had the older lucene jar and installed the last 9.0.12.506 version and it failed...as expected.

I built a new installer for 9.0.13.536 and that install went smooth and V9 ran fine with the old and new lucene jars in place

I am in the midst of uploading the new Windows Installer versions and will be done later today.

I know stuckless is busy so not sure when the Linux one will be released.

k
__________________
If you wish to see what I am up to and support my efforts visit my Patreon page
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
lucene core clarification bmac.to SageTV Github Development 3 02-22-2016 11:53 AM
What is the state of the art in automatic commercial removal? pi314 SageTV Customizations 2 08-22-2008 05:29 AM
Automatic DivX Encoding and Automatic Commercial Removal? TurboRX-7 SageTV Customizations 3 07-28-2005 09:00 PM
Automatic File Transfer - Not Sage Specific DynamoBen Hardware Support 6 03-17-2005 12:32 PM
Req: Automatic backup copies of Sage.properties file? laurenglenn SageTV Beta Test Software 3 04-23-2003 02:02 PM


All times are GMT -6. The time now is 12:48 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.