1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Live TV Stopped Due To TCP/IP Error

Discussion in 'Television (MyTV frontend and TV-Server)' started by CyberSimian, October 9, 2014.

  1. CyberSimian
    • Team MediaPortal

    CyberSimian Test Group

    Joined:
    June 10, 2013
    Messages:
    1,008
    Likes Received:
    183
    Gender:
    Male
    Location:
    Southampton
    Ratings:
    +442 / 3
    Home Country:
    United Kingdom United Kingdom
    Show System Specs
    I am using MP 1.9.0 pre, with "aMPed" skin, on 32-bit Vista, with client and server on the same system.

    Last night I was watching live TV when the screen froze. Several seconds later an error message was displayed, saying that a TCP/IP error had occurred. I tried restarting live TV, but it failed with the same error. There were three recordings being made, but I could not determine whether they were still active, or whether TV Server had stopped. So I decided to reboot. After reboot, the recordings restarted, and live TV was available again.

    This morning I looked at the error logs, including the Windows Event Logs. For the first time ever, the Windows Event Log actually gave a useful explanation. I tried to cut-and-paste the explanation, but cut-and-paste does not work on the event-log panels, so I took a screen shot (see attachment). I hope that the text is legible.



    The explanation in the event log says that MP or TV Server was disconnecting and then reconnecting so rapidly that the system used up all available ports and no more were available (so the TCP/IP connection to the SQL server could not be established). Apparently, TCP/IP does not allow a port to be re-used unless a minimum amount of time has elapsed.

    So, do I need to increase the number of ports available on my system? If so, how do I do that?

    Or is the problem that my system is doing far too many disconnects/reconnects, possibly due to some incorrect setting for MP or TV Server? If so, which setting?

    I have included relevant logs in the zip file. Thank you.

    -- from CyberSimian in the UK
     

    Attached Files:

  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. mm1352000
    • Team MediaPortal

    mm1352000 Development Group

    Joined:
    September 1, 2008
    Messages:
    21,304
    Likes Received:
    4,644
    Ratings:
    +8,052 / 15
    Home Country:
    New Zealand New Zealand
    Rather than cherry-picking what you post and assuming that it will be what we need, please would you [always] use the watchdog tool to grab full log files. In this case please use option 3 to export your existing logs:
    http://wiki.team-mediaportal.com/1_MEDIAPORTAL_1/16_Support/3_Forums/2_Log_Files

    The watchdog tool will include all MediaPortal logs and settings, all TV Server logs [if TV Server is installed on the same PC], general system information, and Windows application and system event logs. Having access to all that information helps us to help you.
     
  4. CyberSimian
    • Team MediaPortal

    CyberSimian Test Group

    Joined:
    June 10, 2013
    Messages:
    1,008
    Likes Received:
    183
    Gender:
    Male
    Location:
    Southampton
    Ratings:
    +442 / 3
    Home Country:
    United Kingdom United Kingdom
    Show System Specs
    Done! :)

    -- from CyberSimian in the UK
     
    • Thank You! Thank You! x 1
  5. mm1352000
    • Team MediaPortal

    mm1352000 Development Group

    Joined:
    September 1, 2008
    Messages:
    21,304
    Likes Received:
    4,644
    Ratings:
    +8,052 / 15
    Home Country:
    New Zealand New Zealand
    Thanks :)

    I have a different interpretation of that event log message:
    My understanding is that this error is not application-specific. In other words:
    1. Any application (or combination of applications) that were running at the time could cause this.
    2. All applications that try to establish TCP connections after the limit is hit would be affected.
    The above is why there is no mention of MP or TV Server in the message.

    Now, it just so happens that TV Server was writing EPG data to the MySQL database at that time (which requires a TCP connection) and MP's TV feature requires a connection to TV Server (another TCP connection). That explains why MP and TV Server were affected. They possibly even tipped the system over the limit with a particular request... but crucially, I don't see any evidence that MP or TV Server would have been opening and closing connections at a high rate.

    A cursory google search yields:
    http://www.dslreports.com/forum/r28809232-Windows-TCP-IP-Error-with-Event-ID-4227

    The first reply looks very helpful.

    [edit: Another interesting read...
    http://forums.overclockers.co.uk/showthread.php?t=18339095
    ]

    Did you also try to restart the TV service instead of restarting the PC, and if so what happened?
     
  6. CyberSimian
    • Team MediaPortal

    CyberSimian Test Group

    Joined:
    June 10, 2013
    Messages:
    1,008
    Likes Received:
    183
    Gender:
    Male
    Location:
    Southampton
    Ratings:
    +442 / 3
    Home Country:
    United Kingdom United Kingdom
    Show System Specs
    Thank you for taking the time to look at this.

    I read both of the above references, but unfortunately I have not yet experienced the "lightbulb" moment. :( None of the possible causes seem to relate to my case.

    I checked the current port settings for TCP and UDP ports, and both are the expected 49152 and 16384. The NETSTAT command this morning did not show an excessive number of ports in use (but, of course, I have rebooted since the problem occurred). The system is a dedicated HTPC, and it is not used for gaming, or browsing the web, or streaming content from the web. I have just checked, and the only applications that I have installed (apart from those that are part of MediaPortal) are: AutoHotkey, Nvidia Control Panel, Open Object REXX, Recuva, VideoReDo.

    I have not tried the registry updates suggested in the references, as I don't think that increasing the number of ports, and/or decreasing the wait time before re-use, is the right solution (it addresses the symptom and not the cause). I have created a BAT file containing the NETSTAT command, and will run that the next time that this problem occurs.

    One question: when the TCP error occurred, I could not decide whether TV Server had stopped recording (so I rebooted). If this problem occurs again when TV Server is recording, will TV Server continue recording successfully, or will it abort recording? (If TV Server continues recording, I would defer the reboot until the recordings finish.)

    When an inexplicable error occurs, I usually prefer to reboot, in order to restart with a "clean slate". If the problem had been (say) a corrupted value in a TV Server control block, restarting TV Server would not necessarily fix it (depending on what the restart does). Do you think that restarting TV Server would be worth trying if the problem occurs again? Presumably that would interrupt any recordings that were being made?

    -- from CyberSimian in the UK
     
  7. mm1352000
    • Team MediaPortal

    mm1352000 Development Group

    Joined:
    September 1, 2008
    Messages:
    21,304
    Likes Received:
    4,644
    Ratings:
    +8,052 / 15
    Home Country:
    New Zealand New Zealand
    I didn't mean them to be interpreted as a full explanation of cause and/or solution. Rather, the point of reading them is that you'd understand the general cause, that the problem is not necessarily related to MP or TV Server, and how to get more information about the base cause if/when it occurs next time.

    I agree.

    Excellent. I'll be very interested to see the results. :)

    I cannot be 100% sure. After all, I've never seen this problem before (...which is another reason why I have my doubts that this problem is in any way related to MP or TV Server). If I had to guess I'd say TV Server would probably continue current recordings... but possibly not start new recordings or stop the current recordings at the scheduled time. Without access to the database the scheduler can't check the stop time for current recordings or start time for new schedules. Live TV would be toast as you saw.

    For a TV Server problem that will mostly either be overkill or ineffectual.
    Overkill because a TV service restart resets internal state in exactly the same way as a PC restart... except faster.
    Ineffectual because if the issue is related to persistent state (eg. database content) then neither a TV service restart or PC restart will have any effect. Only intervening directly with [for example] the database would solve such a problem.

    Of course rebooting can help with environmental (eg. hardware, Windows etc.) and unusual TV Server issues... but I think my point still stands: restarting the TV service will be faster and perhaps just as effective as rebooting while potentially preserving vital information about the cause of the issue, and if restarting the TV service doesn't help you have the ability to reboot at any time.

    PC reboot and TV service restart have exactly the same effect on TV Server, so for that reason I disagree. As above: if a restart of the TV service doesn't fix a problem then:
    • if the problem is with TV Server, it is very unlikely to be solved by a PC restart
    • if the problem is environmental (ie. hardware, Windows etc.), a restart may be necessary... but attempting a TV service restart first can give you information about the problem

    As above: yes, absolutely.

    Yes it would. Same as restarting the PC... except faster.
     
    • Thank You! Thank You! x 1
Loading...

Users Viewing Thread (Users: 0, Guests: 0)

  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Like Us On Facebook

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!