SageTV Community  

Go Back   SageTV Community > SageTV Products > SageTV Software
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV Software Discussion related to the SageTV application produced by SageTV. Questions, issues, problems, suggestions, etc. relating to the SageTV software application should be posted here. (Check the descriptions of the other forums; all hardware related questions go in the Hardware Support forum, etc. And, post in the customizations forum instead if any customizations are active.)

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 08-02-2022, 07:26 PM
Thomas Wischgol's Avatar
Thomas Wischgol Thomas Wischgol is offline
Sage Aficionado
 
Join Date: Sep 2005
Posts: 276
Client cannot connect after sleep

I am seeing this issue for a little while now that my clients cannot connect to the server after waking up from sleep. The server is still active and working in that it is still recording. But clients cannot connect. I cannot even start SageTV client application on the server as that will not connect either. I looked at the log files and it is getting an out-of-bounds exception. I am not sure where this is coming from. I attached the log file with the relevant sections. I hope someone recognizes something there.

As soon as I restart the SageTV service, the clients can connect again and it usually works for a few days or weeks. But this issue does come back at some point again.
Attached Files
File Type: txt sagetv_0-issueclientconnection.txt (6.2 KB, 35 views)
Reply With Quote
  #2  
Old 08-05-2022, 06:14 AM
Thomas Wischgol's Avatar
Thomas Wischgol Thomas Wischgol is offline
Sage Aficionado
 
Join Date: Sep 2005
Posts: 276
This seems to happen pretty much all the time now which makes it really annoying. I did some more digging around and attached the log file from the client. In there it says that the network connection was reset followed by a null pointer exception. This repeats indefinitely until I reset the server. Restarting just the client is not sufficient. But I am not sure what is causing this. So any insight would be greatly appreciated.
Attached Files
File Type: txt sagetvclient_0_connectioissue.txt (212.2 KB, 38 views)
Reply With Quote
  #3  
Old 08-07-2022, 05:39 AM
Thomas Wischgol's Avatar
Thomas Wischgol Thomas Wischgol is offline
Sage Aficionado
 
Join Date: Sep 2005
Posts: 276
I updated to java version 1.8.0_341 on the server just to see if that makes a difference. But I am still seeing the same issue. This issue used to be more intermittent but even before updating java, I am now seeing this almost every time I am waking up the SageTV client
Reply With Quote
  #4  
Old 08-07-2022, 06:00 AM
Thomas Wischgol's Avatar
Thomas Wischgol Thomas Wischgol is offline
Sage Aficionado
 
Join Date: Sep 2005
Posts: 276
I was digging around some more this morning and looking at the source code. I noticed that the amount of data it is trying to send is rather large: more than 2^31. When the client is successful in connecting, that number is smaller. While I was looking around, the server happened to optimize something in the Wizzard class. After that was done, the client was able to connect again and the data it was trying to send was smaller again. So it seems to be some sort of buffer overrun. I see in the source code in line 8750 of Wizard.java file that this line is commented out:

dbout.setOptimizeReadFully(true);

I am not sure what it does yet but would that force the wizard to reduce the database size that it tries to send to the client?
Reply With Quote
  #5  
Old 08-07-2022, 06:23 AM
Thomas Wischgol's Avatar
Thomas Wischgol Thomas Wischgol is offline
Sage Aficionado
 
Join Date: Sep 2005
Posts: 276
Just another quick update from looking more at the source code. So these are the most relevant lines in Wizard.java lines 8753-8754:

int currRead = Math.min(netBuf.length, (int)dbLeft);
dbout.readFully(netBuf, 0, currRead);

According to the log file, dbLeft will be greater than 2^31 when this fails. If it is smaller, everything works fine. So my assumption is that dbLeft turns into something off when converted to data type int since 2^31 is larger than what could be represented with an int. Maybe it turns negative but for sure something that the next call cannot handle as that is where the exception occurs. Doing the comparison the Math.min method that can handle the data type long by converting netBuf.length to long may fix this. So something like this:

int currRead = Math.min((long)netBuf.length, dbLeft);

I would expect this to fix the problem but I have never compiled SageTV to get the Windows 32-bit binary I need. Maybe someone who is already set up for compiling SageTV could give it a try? I would be more than happy to run it over here to see if it works.
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
Suspect that Sage Client is preventing sleep? btrcp2000 SageTV Software 3 02-05-2014 09:13 PM
Why won't my SageTV client let the PC go to sleep? AtariJeff SageTV Software 8 06-11-2012 11:04 AM
can a mac client connect to a Hunter69 SageTV Mac Edition 2 01-05-2010 09:45 AM
Sleep\Standby Probem with Sage Client SWKerr SageTV Software 3 12-24-2009 01:33 PM
Sage not letting client sleep lovingHDTV SageTV Software 0 09-13-2004 07:39 AM


All times are GMT -6. The time now is 11:55 AM.


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