simphax / eyetv-iptv-server

EyeTV->IPTV server for Kodi
15 stars 8 forks source link

Freeze loop #2

Open TheWojtek opened 8 years ago

TheWojtek commented 8 years ago
8/18/16 8:03:55.221 PM com.apple.xpc.launchd[1]: (eyetv-iptv-server[3722]) Service exited with abnormal code: 1
8/18/16 8:03:55.221 PM com.apple.xpc.launchd[1]: (eyetv-iptv-server) Service only ran for 3 seconds. Pushing respawn out by 7 seconds.

That's all I got from 1.1

simphax commented 8 years ago

Could you edit the file /Library/LaunchAgents/eyetv-iptv-server.plist and replace

  <key>StandardErrorPath</key>
  <string>/dev/null</string>
  <key>StandardOutPath</key>
  <string>/dev/null</string>

with the following (replace <your username> with your Mac OS username)?:

  <key>StandardErrorPath</key>
  <string>/Users/<your username>/Desktop/eyetv-iptv-server.log</string>
  <key>StandardOutPath</key>
  <string>/Users/<your username>/Desktop/eyetv-iptv-server.log</string>

Then run this in the Terminal

launchctl unload /Library/LaunchAgents/eyetv-iptv-server.plist
launchctl load /Library/LaunchAgents/eyetv-iptv-server.plist

And return with the contents of /Users/<your username>/Desktop/eyetv-iptv-server.log

TheWojtek commented 8 years ago

Sure, here you are:

EyeTV IPTV server v1.0.1 Arguments: { _: [] } Extracting VLC.app to /var/folders/cg/85crdrh11rxcrw1s5ppbk33w0000gn/T/ Server started on port 9898 events.js:85 throw er; // Unhandled 'error' event ^ Error: listen EADDRINUSE at exports._errnoException (util.js:746:11) at Server._listen2 (net.js:1156:14) at listen (net.js:1182:10) at Server.listen (net.js:1267:5) at startServer (nexe.js:501:10) at Extract.<anonymous> (nexe.js:83:5) at Extract.emit (events.js:129:20) at DirWriter.<anonymous> (nexe.js:7856:8) at DirWriter.emit (events.js:129:20) at end (nexe.js:1278:14) EyeTV IPTV server v1.0.1 Arguments: { _: [] } Extracting VLC.app to /var/folders/cg/85crdrh11rxcrw1s5ppbk33w0000gn/T/ Server started on port 9898 events.js:85 throw er; // Unhandled 'error' event ^ Error: listen EADDRINUSE at exports._errnoException (util.js:746:11) at Server._listen2 (net.js:1156:14) at listen (net.js:1182:10) at Server.listen (net.js:1267:5) at startServer (nexe.js:501:10) at Extract.<anonymous> (nexe.js:83:5) at Extract.emit (events.js:129:20) at DirWriter.<anonymous> (nexe.js:7856:8) at DirWriter.emit (events.js:129:20) at end (nexe.js:1278:14) EyeTV IPTV server v1.0.1 Arguments: { _: [] } Extracting VLC.app to /var/folders/cg/85crdrh11rxcrw1s5ppbk33w0000gn/T/ Server started on port 9898 events.js:85 throw er; // Unhandled 'error' event ^ Error: listen EADDRINUSE at exports._errnoException (util.js:746:11) at Server._listen2 (net.js:1156:14) at listen (net.js:1182:10) at Server.listen (net.js:1267:5) at startServer (nexe.js:501:10) at Extract.<anonymous> (nexe.js:83:5) at Extract.emit (events.js:129:20) at DirWriter.<anonymous> (nexe.js:7856:8) at DirWriter.emit (events.js:129:20) at end (nexe.js:1278:14) EyeTV IPTV server v1.0.1 Arguments: { _: [] } Extracting VLC.app to /var/folders/cg/85crdrh11rxcrw1s5ppbk33w0000gn/T/ Server started on port 9898 events.js:85 throw er; // Unhandled 'error' event ^ Error: listen EADDRINUSE at exports._errnoException (util.js:746:11) at Server._listen2 (net.js:1156:14) at listen (net.js:1182:10) at Server.listen (net.js:1267:5) at startServer (nexe.js:501:10) at Extract.<anonymous> (nexe.js:83:5) at Extract.emit (events.js:129:20) at DirWriter.<anonymous> (nexe.js:7856:8) at DirWriter.emit (events.js:129:20) at end (nexe.js:1278:14) EyeTV IPTV server v1.0.1 Arguments: { _: [] } Extracting VLC.app to /var/folders/cg/85crdrh11rxcrw1s5ppbk33w0000gn/T/ Server started on port 9898 events.js:85 throw er; // Unhandled 'error' event ^ Error: listen EADDRINUSE at exports._errnoException (util.js:746:11) at Server._listen2 (net.js:1156:14) at listen (net.js:1182:10) at Server.listen (net.js:1267:5) at startServer (nexe.js:501:10) at Extract.<anonymous> (nexe.js:83:5) at Extract.emit (events.js:129:20) at DirWriter.<anonymous> (nexe.js:7856:8) at DirWriter.emit (events.js:129:20) at end (nexe.js:1278:14) EyeTV IPTV server v1.0.1 Arguments: { _: [] } Extracting VLC.app to /var/folders/cg/85crdrh11rxcrw1s5ppbk33w0000gn/T/ Server started on port 9898 events.js:85 throw er; // Unhandled 'error' event ^ Error: listen EADDRINUSE at exports._errnoException (util.js:746:11) at Server._listen2 (net.js:1156:14) at listen (net.js:1182:10) at Server.listen (net.js:1267:5) at startServer (nexe.js:501:10) at Extract.<anonymous> (nexe.js:83:5) at Extract.emit (events.js:129:20) at DirWriter.<anonymous> (nexe.js:7856:8) at DirWriter.emit (events.js:129:20) at end (nexe.js:1278:14) EyeTV IPTV server v1.0.1 Arguments: { _: [] } Extracting VLC.app to /var/folders/cg/85crdrh11rxcrw1s5ppbk33w0000gn/T/ Server started on port 9898 events.js:85 throw er; // Unhandled 'error' event ^ Error: listen EADDRINUSE at exports._errnoException (util.js:746:11) at Server._listen2 (net.js:1156:14) at listen (net.js:1182:10) at Server.listen (net.js:1267:5) at startServer (nexe.js:501:10) at Extract.<anonymous> (nexe.js:83:5) at Extract.emit (events.js:129:20) at DirWriter.<anonymous> (nexe.js:7856:8) at DirWriter.emit (events.js:129:20) at end (nexe.js:1278:14)

It would probably go on like this forever, I think I noticed three or four relaunches of the server in Console.app (OS X 10.11.6, I have Server.app installed if this makes any difference).

simphax commented 8 years ago

Ok it seems like port 9898 or 9897 is already in use. Either there's an orphan eyetv-iptv-server or VLC running (probably frozen) or you have another application that uses one of these ports. First try rebooting the computer. If it does not help you can change the ports that eyetv-iptv-server uses by editing the same file but replacing this:

<array>
    <string>/usr/local/bin/eyetv-iptv-server</string>
</array>

with this:

<array>
    <string>/usr/local/bin/eyetv-iptv-server</string>
    <string>--port</string>
    <string>7878</string>
    <string>--vlc-port</string>
    <string>7877</string>
</array>

And running

launchctl unload /Library/LaunchAgents/eyetv-iptv-server.plist
launchctl load /Library/LaunchAgents/eyetv-iptv-server.plist
TheWojtek commented 8 years ago

Now that gets interesting. First of all, the logs:

EyeTV IPTV server v1.0.1
Arguments:  { _: [], port: 7878, 'vlc-port': 7877 }
Extracting VLC.app to /var/folders/cg/85crdrh11rxcrw1s5ppbk33w0000gn/T/
Server started on port 7878
EyeTV:8692
Could not connect to EyeTV Service

So it starts properly now (and LSOF be of evidence:)

miniserver:~ wojtek$ lsof -n -iTCP:7878 | grep LISTEN
eyetv-ipt 14018 wojtek   11u  IPv6 0xf13303dccca11867      0t0  TCP *:7878 (LISTEN)

When I open up the browser and point to http://miniserver.home:7878/playlist.m3u8 I get the following response in the browser window:

#EXTM3U

Nothing more, nothing less. Now to investigating the issue with EyeTV on port 8692. Let's see...

miniserver:~ wojtek$ sudo lsof -n -iTCP:8692 | grep LISTEN
miniserver:~ wojtek$ 

Nothing! And again nothing with -iUDP:8692 I thought EyeTV opens 2170 to stream video? When I try to run EyeTV manually, I get: screen shot 2016-08-18 at 11 10 50 pm Which means it's running as intended (launched by _xcsbuildd user) and I am really, really puzzled.

simphax commented 8 years ago

Aha, the log is a bit misleading. 8692 is the PID of the EyeTV application. EyeTV should be launched with your user and you should be able to open it even while eyetv-iptv-server is running. I think what happens is that eyetv-iptv-server (and EyeTV) is launched both for _xcsbuildd and your user on boot, which explains the reason for your first problem. We should make the launch agent only run for one user only. Run the following in terminal: Shutdown the service

launchctl unload /Library/LaunchAgents/eyetv-iptv-server.plist

Move the service to your user folder

mv /Library/LaunchAgents/eyetv-iptv-server.plist ~/Library/LaunchAgents/eyetv-iptv-server.plist

Load it.

launchctl load ~/Library/LaunchAgents/eyetv-iptv-server.plist

Reboot

I should probably change this in the installer :)

TheWojtek commented 8 years ago

OK, I cleaned it up as you said and seems I am getting somewhere. Thank you! Now off to Kodi to configure the front-end... After couple of tries seems Kodi (iptv simpleclient) does not download the m3u8 playlist. The logs (after restarting the service) are as follows:

EyeTV IPTV server v1.0.1
Arguments:  { _: [], port: 7878, 'vlc-port': 7877 }
Extracting VLC.app to /var/folders/cg/85crdrh11rxcrw1s5ppbk33w0000gn/T/
Server started on port 7878
EyeTV:9428

Could not connect to EyeTV Service

EyeTV is started (icon in the dock). There's around 3 minutes between EyeTV PID and "Could not connect..." I\m using EyeTV 3.6.9 (build 7416), the current one.

simphax commented 8 years ago

Make sure iPhone access is on. Either using the settings panel in EyeTV or run this command with your user

defaults write com.elgato.eyetv isWifiAccessEnabledLocal -bool true
TheWojtek commented 8 years ago

My EyeTV just does not allow enabling this radio button. No matter how hard I click, the button stays inactive (same thing when it comes to "Share my EyeTV Archive" button). LSOF does not show anything running on port 2170. I checked with the same EyeTV version on my other two Macs. Same thing...

simphax commented 8 years ago

Ok this seems to be a problem with EyeTV on El Capitan. I managed to reproduce the same issue with a fresh reinstall of EyeTV on my machine.

The problem is that the "EyeConnect" service does not start. It has probably something to do with the new "System Integrity Protection". This file was missing for me:

/Library/LaunchDaemons/com.elgato.EyeConnect.plist

To fix the issue you can run the following commands in Terminal:

mkdir "/Library/Application Support/EyeConnect"
cp -r /Applications/EyeTV.app/Contents/Resources/EyeConnect.app "/Library/Application Support/EyeConnect"
sudo cp -f "/Library/Application Support/EyeConnect/EyeConnect.app/Contents/Resources/com.elgato.EyeConnect.plist" /Library/LaunchDaemons/com.elgato.EyeConnect.plist
sudo chown root:wheel /Library/LaunchDaemons/com.elgato.EyeConnect.plist
sudo chmod 600 /Library/LaunchDaemons/com.elgato.EyeConnect.plist
sudo launchctl load /Library/LaunchDaemons/com.elgato.EyeConnect.plist

Hopefully EyeTV will update their application for El Capitan.

TheWojtek commented 8 years ago

Copying the solution now... Yupp, I did a session with EyeTV Reporter and was surprised that it showed all red. Apparently it's (mostly) green now, so I will start over...

...and it works!!! Thank you!