pidora icon indicating copy to clipboard operation
pidora copied to clipboard

Pidora not starting on reboot and other issues

Open taylorkline opened this issue 10 years ago • 7 comments

Hello again! Entirely possible this is my fault again, but right now Pidora isn't restarting. When I restart my RPi and go to IPADDRESS:8080, nothing is being hosted unless I run python ./pidora/hello.py manually. Maybe it's a problem with:

echo "rm $HOME/pidora/curSong.json
@python $HOME/pidora/hello.py
@midori -a \"http://localhost:8080/\" -e Fullscreen" | sudo tee -a /etc/xdg/lxsession/LXDE/autostart

Could it be a problem with the fact that I have a headless install and do not use LXDE?

Also, when I start Pidora manually with python ./pidora/hello.py and access it from my laptop's browser (Chrome), I get stuck with "Pianobar is starting up" and eventually the ssh session ends with an error:

117 "http://192.168.16.49:8080/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.11 Safari/537.36"                                                                                                    
[24/Dec/2013:04:31:12] ENGINE Error in 'start' listener <bound method Server.start of <cherrypy._cpserver.Server object at 0xde01f0>>                                                                                                                 
Traceback (most recent call last):                                                                                        
  File "/home/pi/pidora/cherrypy/process/wspbus.py", line 197, in publish                                                 
    output.append(listener(*args, **kwargs))                                                                               
  File "/home/pi/pidora/cherrypy/_cpserver.py", line 151, in start
    ServerAdapter.start(self)
  File "/home/pi/pidora/cherrypy/process/servers.py", line 174, in start
    self.wait()
  File "/home/pi/pidora/cherrypy/process/servers.py", line 214, in wait
    wait_for_occupied_port(host, port)
  File "/home/pi/pidora/cherrypy/process/servers.py", line 427, in wait_for_occupied_port
    raise IOError("Port %r not bound on %r" % (port, host))
IOError: Port 8080 not bound on '0.0.0.0'

[24/Dec/2013:04:31:12] ENGINE Shutting down due to error in start listener:
Traceback (most recent call last):
  File "/home/pi/pidora/cherrypy/process/wspbus.py", line 235, in start
    self.publish('start')
  File "/home/pi/pidora/cherrypy/process/wspbus.py", line 215, in publish
    raise exc
ChannelFailures: IOError("Port 8080 not bound on '0.0.0.0'",)

[24/Dec/2013:04:31:12] ENGINE Bus STOPPING
[24/Dec/2013:04:31:12] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) already shut down
[24/Dec/2013:04:31:12] ENGINE Stopped thread '_TimeoutMonitor'.
[24/Dec/2013:04:31:12] ENGINE Bus STOPPED
[24/Dec/2013:04:31:12] ENGINE Bus EXITING
[24/Dec/2013:04:31:12] ENGINE Bus EXITED

Thanks in advance for your help.

taylorkline avatar Dec 24 '13 04:12 taylorkline

I've seen other people have this same issue, and I simply haven't seen it yet. I'm not going to say it's unreproducible yet because I'm going to try wiping the Pi and installing from install.sh and maybe that'll produce the bug.

Can you give me an update on this? Is it still occurring?

jacroe avatar Feb 21 '14 13:02 jacroe

Yes, I was unfortunately never able to determine the cause.

taylorkline avatar Feb 21 '14 14:02 taylorkline

You wouldn't happen to know of anything else on your Pi that's already using port 8080 do you?

jacroe avatar Feb 21 '14 19:02 jacroe

It looks like port 8080 is already bound to by some other program/service. You could try using a different port number (anything over 1024) by changing it in cpy.conf and bar-update.py. And then running python hello.py. If it's a port binding issue, that would (read: should) solve it.

jacroe avatar Feb 21 '14 20:02 jacroe

I'll try that next week over spring break and report back!

On February 21, 2014 2:01:02 PM Jacob Roeland [email protected] wrote:

It looks like port 8080 is already bound to by some other program/service. You could try using a different port number (anything over 1024) by changing it in cpy.conf and bar-update.py. And then running python hello.py. If it's a port binding issue, that would (read: should) solve it.


Reply to this email directly or view it on GitHub: https://github.com/jacroe/pidora/issues/48#issuecomment-35767572

taylorkline avatar Mar 03 '14 04:03 taylorkline

Unfortunately, no luck with that:

[16/Mar/2014:01:16:41] ENGINE Listening for SIGHUP.
[16/Mar/2014:01:16:41] ENGINE Listening for SIGTERM.
[16/Mar/2014:01:16:41] ENGINE Listening for SIGUSR1.
[16/Mar/2014:01:16:41] ENGINE Bus STARTING
[16/Mar/2014:01:16:41] ENGINE Started monitor thread '_TimeoutMonitor'.
192.168.1.124 - - [16/Mar/2014:01:16:55] "GET / HTTP/1.1" 200 1459 "" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.149 Safari/537.36"
192.168.1.124 - - [16/Mar/2014:01:16:55] "GET /css/styles.css HTTP/1.1" 200 667 "http://192.168.1.147:8111/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.149 Safari/537.36"
192.168.1.124 - - [16/Mar/2014:01:16:55] "GET /imgs/love.png HTTP/1.1" 200 1037 "http://192.168.1.147:8111/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.149 Safari/537.36"
192.168.1.124 - - [16/Mar/2014:01:16:55] "GET /js/pidora.js HTTP/1.1" 200 6316 "http://192.168.1.147:8111/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.149 Safari/537.36"
192.168.1.124 - - [16/Mar/2014:01:16:55] "GET /imgs/pandora.png HTTP/1.1" 200 82708 "http://192.168.1.147:8111/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.149 Safari/537.36"
192.168.1.124 - - [16/Mar/2014:01:16:55] "GET /imgs/favicon.ico HTTP/1.1" 200 15086 "" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.149 Safari/537.36"
192.168.1.124 - - [16/Mar/2014:01:16:58] "GET /api?json=%7B%22method%22%3A%22GetSongInfo%22%2C%22id%22%3A1%7D HTTP/1.1" 200 117 "http://192.168.1.147:8111/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.149 Safari/537.36"
.
.
.
192.168.1.124 - - [16/Mar/2014:01:18:20] "GET /api?json=%7B%22method%22%3A%22GetSongInfo%22%2C%22id%22%3A1%7D HTTP/1.1" 200 117 "http://192.168.1.147:8111/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.149 Safari/537.36"
[16/Mar/2014:01:18:22] ENGINE Error in 'start' listener <bound method Server.start of <cherrypy._cpserver.Server object at 0x14152f0>>
Traceback (most recent call last):
  File "/home/pi/pidora/cherrypy/process/wspbus.py", line 197, in publish
    output.append(listener(*args, **kwargs))
  File "/home/pi/pidora/cherrypy/_cpserver.py", line 151, in start
    ServerAdapter.start(self)
  File "/home/pi/pidora/cherrypy/process/servers.py", line 174, in start
    self.wait()
  File "/home/pi/pidora/cherrypy/process/servers.py", line 214, in wait
    wait_for_occupied_port(host, port)
  File "/home/pi/pidora/cherrypy/process/servers.py", line 427, in wait_for_occupied_port
    raise IOError("Port %r not bound on %r" % (port, host))
IOError: Port 8111 not bound on '0.0.0.0'

[16/Mar/2014:01:18:22] ENGINE Shutting down due to error in start listener:
Traceback (most recent call last):
  File "/home/pi/pidora/cherrypy/process/wspbus.py", line 235, in start
    self.publish('start')
  File "/home/pi/pidora/cherrypy/process/wspbus.py", line 215, in publish
    raise exc
ChannelFailures: IOError("Port 8111 not bound on '0.0.0.0'",)

[16/Mar/2014:01:18:22] ENGINE Bus STOPPING
[16/Mar/2014:01:18:22] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8111)) already shut down
[16/Mar/2014:01:18:22] ENGINE Stopped thread '_TimeoutMonitor'.
[16/Mar/2014:01:18:22] ENGINE Bus STOPPED
[16/Mar/2014:01:18:22] ENGINE Bus EXITING
[16/Mar/2014:01:18:22] ENGINE Bus EXITED

taylorkline avatar Mar 16 '14 01:03 taylorkline

I had a similar issue where it wouldn't start at startup because the network stack wasn't fully initialized; I wrote a little start-pidora script that was:

#!/bin/bash
export PATH=${PATH}:/usr/local/bin
while ! ping -c 1 8.8.8.8 >/dev/null 2>&1 ; do
  sleep 1
done
cd /home/pi/pidora
python hello.py >/tmp/pidora.log 2>&1 

Which fixed it for me. YMMV.

pjz avatar May 23 '14 19:05 pjz