SageTV Community  

Go Back   SageTV Community > SageTV Products > SageTV Linux > SageTV for unRAID/Docker
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV for unRAID/Docker Discussion related to SageTV for unRAID/Docker. Questions, issues, problems, suggestions, etc. relating to SageTV for unRAID/Docker should be posted here.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-06-2018, 10:59 AM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
Can some folks please try something with the web UI

The web UI includes the functionality to Power Off extenders by clicking [Power Off] from the following line in the web page:

On Sage Extender at: Kitchen: [XML] [WebRemote] [Power Off] [Reboot]

When I do this from the web UI on my unRAID server I get an error like the following:
Code:
Failed to send command to MVP:
java.lang.Exception: Failed to find RC status in output!
But this works fine from my Windows server to the same extender. This is weird because what is failing is parsing off a return code from a telnet script - RC stands for Return Code.

Can others please try to run this command on unRAID servers and post whether it works or not? Thanks.
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA
Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA
Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server
Reply With Quote
  #2  
Old 01-06-2018, 02:58 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by wayner View Post
The web UI includes the functionality to Power Off extenders by clicking [Power Off] from the following line in the web page:

On Sage Extender at: Kitchen: [XML] [WebRemote] [Power Off] [Reboot]

When I do this from the web UI on my unRAID server I get an error like the following:
Code:
Failed to send command to MVP:
java.lang.Exception: Failed to find RC status in output!
But this works fine from my Windows server to the same extender. This is weird because what is failing is parsing off a return code from a telnet script - RC stands for Return Code.

Can others please try to run this command on unRAID servers and post whether it works or not? Thanks.
This might be too techy... but if you connect a shell to your running sagetv docker instance, can you telnet from there to the extender? The docker containers might not know about the "network" on which the extender is running since, docker creates it's own network.
Reply With Quote
  #3  
Old 01-06-2018, 03:13 PM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
I did that and telnet is not installed in the docker.

But the thing is that from the web UI the telnet command actually does execute correctly as the extender will power off or power on so the telnet client is initiating and sending the "killall miniclient" command (or killall waitpoer), it is just the parsing of the output that has problems.

I am guessing that the web UI is using the "org.apache.commons.net.telnet.TelnetClient" library. I say that because that is what Slugger used in his GlobalHelpers and ExtenderClient extensions to the API.

But I am guessing that you are correct that it is something that a docker instance doesn't have which is causing the problem.

Sean - you don't use extenders anymore do you?

Here is the code from that ExtenderClient that (I think) is the same that is in the web UI. As far as I can tell the problem is with RC_WRAPPER and how it interprets the return code.
Code:
class ExtenderClient {
	static private final String RC_WRAPPER = '#@'
	static private final String USER = 'root'
    static private final Pattern RC_REGEX = Pattern.compile("${Pattern.quote(RC_WRAPPER)}\\d+${Pattern.quote(RC_WRAPPER)}")
	
	private TelnetClient clnt
	private InputStream input
	private OutputStream output
	/**
	 * Host/IP of extender device
	 */
	final String host
	
	/**
	 * Constructor
	 * @param host The hostname/IP address of the extender device to connect to
	 * @throws IOException in case of any failure connecting to the device
	 */
	ExtenderClient(String host) throws IOException {
		this.host = host
		
		clnt = new TelnetClient()
		clnt.connect(this.host)
		input = clnt.getInputStream()
		output = clnt.getOutputStream()
		readFromServer()
		writeToServer(USER)
	}
	
	/**
	 * <p>Execute a command on the device</p>
	 * @param cmd The command line to be executed on the device; multiple commands are supported; backgrounding processes is NOT supported
	 * @return The return code of the command line execution
	 * @throws IOException In case of any network error communicating with the device or if the return code cannot be determined from the output
	 */
	int executeCommand(String cmd) throws IOException {
		readFromServer()
		def fullCmd = "$cmd; echo \"${RC_WRAPPER}\$?${RC_WRAPPER}\""
		writeToServer(fullCmd)
		def data = readFromServer()
		for(def line : data.split('\r\n'))
			if(line ==~ RC_REGEX)
				return line.substring(RC_WRAPPER.length(), line.length() - RC_WRAPPER.length()).toInteger()
		throw new IOException('Failed to find RC status in output!')
	}
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA
Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA
Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server
Reply With Quote
  #4  
Old 01-08-2018, 02:21 PM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
Bump

Can some other folks running unRAID and Extenders please give this a try? Thanks.
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA
Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA
Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server
Reply With Quote
  #5  
Old 01-09-2018, 06:44 PM
KarylFStein KarylFStein is offline
Sage Fanatic
 
Join Date: Apr 2006
Location: Westland, Michigan, USA
Posts: 999
Quote:
Originally Posted by wayner View Post
Bump

Can some other folks running unRAID and Extenders please give this a try? Thanks.
It does the same thing here. Although the extender does turn off.
__________________
Home Network: https://karylstein.com/technology.html
Reply With Quote
  #6  
Old 01-09-2018, 07:27 PM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
Thanks Karyl - so it does like like this is a bug that only affects unRAID users. The command is properly sent by the telnet script but the parsing off the response causes the Java I/O error.

So it appears that there may be something unique to the SageTV web server running in a docker, or at least in Linux, that is causing this problem.

Is it possible that the problem is an incompatibility with the Regex Pattern Class? Maybe you can't use the Pattern.compile command in a docker?
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA
Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA
Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server

Last edited by wayner; 01-09-2018 at 10:19 PM.
Reply With Quote
  #7  
Old 01-10-2018, 07:16 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
This is just java... and so there is no difference in running it in docker vs not in docker. Now that being said, in the cases where it is working, are you using the same Java version? Docker also manages the network differently, and Docker uses linux container, and I've seen many times when scripting telnet, it can be different depending on the "host" machine. (ie, some hosts will set a TERM environment variable, and depending on the value of TERM it can affect how the telnet server respsonds.
Reply With Quote
  #8  
Old 01-10-2018, 08:23 AM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
In my tests I was running Sage 9 on Java 8 to the same extender. Using the web UI on a Windows server to turn off the extender didn't give an error message.

Doing the exact same task on the web UI for my unRAID server on the exact same extender does give an error message. But the task actually does complete - the extender turns off so the "killall miniclient" command does execute.

The only thing that changed is the OS for my SageTV server - it is also possible that the SageTV versions are slightly different as my Windows SageTV server is probably running a slightly older version - I am assuming that my docker gets upgraded to the latest version (if there is one) when the docker restarts every Monday morning after the /appdata/ partition of my unRAID server is backed up.

If is also possible that the Java may be a different point release. Does the Java version in the docker get updated or is it fixed on the Java version used when the docker was created?

edit - just to clarify - Java 8 is on both servers as well.
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA
Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA
Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server
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
Issues for Folks Running 480i Diego Garcia SageTV Media Extender 9 10-08-2010 02:09 PM
What other Themes are folks using for Sage? sdsean SageTV Customizations 8 09-22-2009 07:51 PM
For you Apple Folks.. The MacBook Wheel SprDtyF350 The SageTV Community 1 01-19-2009 11:03 PM
Intersting article for folks looking to buy a video card for use with Sage mikesm Hardware Support 2 10-26-2007 03:31 PM
Any SageClient folks have device driver issues? IVB SageTV Software 2 12-18-2003 10:38 AM


All times are GMT -6. The time now is 05:21 PM.


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