Author Topic: "Error in Bind" with FPP on BBB  (Read 652 times)

Offline deonb

  • Newbie
  • *
  • Join Date: Dec 2015
  • Location:
  • Posts: 34
  • Kudos: 0
"Error in Bind" with FPP on BBB
« on: December 09, 2016, 09:07:38 PM »
Every now and again (twice a night or so) my FPP gets into a state where it refuses to play anything more, and any attempt to issue "Start" to it from me results in:





2016-12-09 20:00:29 (10373) log.c:221:=========================================
2016-12-09 20:00:29 (10380) channeloutput/E131.c:141:Initializing E1.31 output
2016-12-09 20:00:29 (10380) channeloutput/E131.c:101:Error in bind:errno=98
2016-12-09 20:00:29 (10380) command.c:72:Initializing Command Module




This persists until I reboot the BBB.


Any idea what causes this? Is there something simpler than a reboot to fix it? (Even command line would be fine).

Offline Materdaddy

  • Moderator
  • *****
  • Join Date: Jul 2013
  • Location: Oceanside, CA
  • Posts: 2,050
  • Kudos: 10
    • Christmas On Quiet Hills
Re: "Error in Bind" with FPP on BBB
« Reply #1 on: December 09, 2016, 09:43:58 PM »
What version are you running?  Are there any other logs above the bind failure?

errno 98 is EADDRINUSE meaning the socket is already being used.

Are you using scripts or events to start sequences, or just the scheduler?  It seems something is either hanging, or crashing and leaving the socket in a bad state.  Depending on what state and what is going on, it should self recover after the default timeout period for the TIME_WAIT state of 2 minutes unless it really is in a different state.

Next time this happens, try running "sudo netstat -natup | grep 58301" to see what state the socket is in and if there is a PID associated with the port.

Offline deonb

  • Newbie
  • *
  • Join Date: Dec 2015
  • Location:
  • Posts: 34
  • Kudos: 0
Re: "Error in Bind" with FPP on BBB
« Reply #2 on: December 10, 2016, 02:21:38 AM »
What version are you running?  Are there any other logs above the bind failure?

errno 98 is EADDRINUSE meaning the socket is already being used.

Are you using scripts or events to start sequences, or just the scheduler?  It seems something is either hanging, or crashing and leaving the socket in a bad state.  Depending on what state and what is going on, it should self recover after the default timeout period for the TIME_WAIT state of 2 minutes unless it really is in a different state.

Next time this happens, try running "sudo netstat -natup | grep 58301" to see what state the socket is in and if there is a PID associated with the port.


It's:  v1.8-63-gabcfb17


This is the full log that repeats over and over every time I try to start it:

2016-12-09 20:00:10 (10216) log.c:218:=========================================
2016-12-09 20:00:10 (10216) log.c:219:FPP 1.8-48-g9dc45a2
2016-12-09 20:00:10 (10216) log.c:220:Branch: v1.8
2016-12-09 20:00:10 (10216) log.c:221:=========================================
2016-12-09 20:00:11 (10223) channeloutput/E131.c:141:Initializing E1.31 output
2016-12-09 20:00:11 (10223) channeloutput/E131.c:101:Error in bind:errno=98
2016-12-09 20:00:11 (10223) command.c:72:Initializing Command Module
2016-12-09 20:00:11 (10223) Scheduler.cpp:439:Loading Schedule from /home/fpp/media/schedule
2016-12-09 20:00:11 (10223) Scheduler.cpp:516:Current Schedule: (Status: '+' = Enabled, '-' = Disabled, '!' = Outside Date Range, '*' = Repeat)
2016-12-09 20:00:11 (10223) Scheduler.cpp:517:St  Start & End Dates       Days         Start & End Times   Playlist
2016-12-09 20:00:11 (10223) Scheduler.cpp:518:--- ----------------------- ------------ ------------------- ---------------------------------------------
2016-12-09 20:00:11 (10223) Scheduler.cpp:536:+ * 2014-01-01 - 2099-12-31 Everyday     16:00:00 - 22:30:00 Show_2016
2016-12-09 20:00:11 (10223) Scheduler.cpp:536:+ * 2014-01-01 - 2099-12-31 Everyday     22:30:00 - 24:00:00 Overnight
2016-12-09 20:00:11 (10223) Scheduler.cpp:536:+ * 2014-01-01 - 2099-12-31 Everyday     00:00:00 - 07:00:00 Overnight
2016-12-09 20:00:11 (10223) Scheduler.cpp:122:Should be playing now - schedule index = 0 weekly index= 5


Just running scheduler - no events.


I will try the netstat. Thanks!

Offline deonb

  • Newbie
  • *
  • Join Date: Dec 2015
  • Location:
  • Posts: 34
  • Kudos: 0
Re: "Error in Bind" with FPP on BBB
« Reply #3 on: December 10, 2016, 02:21:49 AM »
<deleted>

Offline deonb

  • Newbie
  • *
  • Join Date: Dec 2015
  • Location:
  • Posts: 34
  • Kudos: 0
Re: "Error in Bind" with FPP on BBB
« Reply #4 on: December 10, 2016, 02:22:09 AM »
<deleted>

Offline deonb

  • Newbie
  • *
  • Join Date: Dec 2015
  • Location:
  • Posts: 34
  • Kudos: 0
Re: "Error in Bind" with FPP on BBB
« Reply #5 on: December 11, 2016, 06:39:20 PM »
Next time this happens, try running "sudo netstat -natup | grep 58301" to see what state the socket is in and if there is a PID associated with the port.


So the reply to that is:

udp        0      0 10.0.0.25:58301         0.0.0.0:*                           14808/mpg321     


I just hit this when I tried adding another song to the playlist and restarted the BBB in order to pick it up.
« Last Edit: December 11, 2016, 07:09:58 PM by deonb »

Offline Materdaddy

  • Moderator
  • *****
  • Join Date: Jul 2013
  • Location: Oceanside, CA
  • Posts: 2,050
  • Kudos: 10
    • Christmas On Quiet Hills
Re: "Error in Bind" with FPP on BBB
« Reply #6 on: December 12, 2016, 10:20:11 PM »
That's very strange.  mpg321 doesn't open/bind to ports (unless playing a network stream).  We must have some sort of bug where the mpg321 fork/exec doesn't close all file descriptors or something.  This is the type of thing Chris usually fixes before I take the time to look into some of our multi-threaded code, but I've added this to my list of things to investigate.  Do you have logs you could send with examples of this?

Offline deonb

  • Newbie
  • *
  • Join Date: Dec 2015
  • Location:
  • Posts: 34
  • Kudos: 0
Re: "Error in Bind" with FPP on BBB
« Reply #7 on: December 12, 2016, 10:46:14 PM »
That's very strange.  mpg321 doesn't open/bind to ports (unless playing a network stream).  We must have some sort of bug where the mpg321 fork/exec doesn't close all file descriptors or something.  This is the type of thing Chris usually fixes before I take the time to look into some of our multi-threaded code, but I've added this to my list of things to investigate.  Do you have logs you could send with examples of this?


Sure. I placed them on:
https://www.dropbox.com/sh/sy2pbleqk58cj2s/AAAsBxWv-fh5DCD0Xkb7G_3la?dl=0


Offline CaptainMurdoch

  • Administrator
  • *****
  • Join Date: Sep 2013
  • Location: Washington
  • Posts: 9,020
  • Kudos: 178
Re: "Error in Bind" with FPP on BBB
« Reply #8 on: December 12, 2016, 11:38:05 PM »
I thought there was code to close all open files after the fork, but now that I double checked the code, I can't find it.  So it sounds like mpg123 hanging could cause this issue.
-
Chris

Offline CaptainMurdoch

  • Administrator
  • *****
  • Join Date: Sep 2013
  • Location: Washington
  • Posts: 9,020
  • Kudos: 178
Re: "Error in Bind" with FPP on BBB
« Reply #9 on: December 23, 2016, 07:53:01 PM »
Just FYI, I was hit by this tonight.  I had to kill a stray mpg123 process on my BBB master before I could restart fppd.

I'm going to take a look at patching master-v1.x tonight for later inclusion in v1.9 if I don't run into any issues in the next day or so.

 

Back to top