entertainer-backend exits without indexing

Bug #244081 reported by Makario Lewis
2
Affects Status Importance Assigned to Milestone
Entertainer Media Center
Fix Released
High
Matt Layman

Bug Description

Whenever starting entertainer-backend, I get the following message:

Error occured. Please see /home/makario/.config/entertainer/entertainer.log for more information. This is probably not a fatal error. Just wait one minute and try again.
Execution aborted!

After checking the log, I found that the "ConnectionServer initialization failed!"

When I comment out sys.exit(1) on line 115 of backend_server.py, it works fine.

(Sorry, I'm not really good at bug reporting...)

Related branches

Revision history for this message
Joshua Scotton (joshuascotton) wrote :

please run the backend with the foreground argument like this:

./entertainer-backend.py --foreground

and report any errors

Thanks

Revision history for this message
Makario Lewis (makk753) wrote :

The only output I get is this:

Error occured. Please see /home/makario/.config/entertainer/entertainer.log for more information. This is probably not a fatal error. Just wait one minute and try again.
Execution aborted!

I'm attaching the entertainer.log to see if that helps.

Revision history for this message
Matt Layman (mblayman) wrote :

Makario, if you're feeling like a really adventurous bug reporter, you can help us get the traceback (that is, the list of code functions that happened right before you error), by commenting out some lines of code which will prevent them from running. We would need you to do this because your error does not seem to be repeatable by other users. Please report the traceback here and we'll be able to further analyze the problem.

You'll need to edit either src/backend/backend_server.py or entertainerlib/backend/backend_server.py (the location is dependent on whether you got the source from the .1 release or from the most recent development code). In that file, find the initialize_connection_server function, and comment out (add a python comment character # all the lines in that function except for the five lines inside the try block. If your problem is repeatable, when you run the backend, you should get a more informative error message. The code should look like this:

    def initialize_connection_server(self):
# """Initialize connection server."""
# try:
            self._port = self.configuration.get_port()
            self.connection_server = ConnectionServer(self._port,
                                                      self.message_bus)
            # Start listening incoming connections
            self.connection_server.start()
# except:
# self.logger.error("ConnectionServer initialization failed!")
# message = 'Error occured. Please see '
# message += self.config_path + 'entertainer.log'
# message += ' for more information. This is probably not a fatal'
# message += ' error. Just wait one minute and try again.'
# print message
# print "Execution aborted!"
# sys.exit(1)

Revision history for this message
Matt Layman (mblayman) wrote :

Hmmm.... launchpad did some funny formatting to the code here. You don't need to change any spacing to the lines (actually, you're probably safer if you don't for when you want to change the code back to its original format). Just add the pound character to each of the lines that I've listed.

Revision history for this message
Makario Lewis (makk753) wrote :

Here's the Traceback:

Traceback (most recent call last):
  File "./entertainer-backend", line 63, in <module>
    backend = BackendServer()
  File "/home/makario/entertainer/entertainerlib/backend/backend_server.py", line 82, in __init__
    self.initialize_connection_server()
  File "/home/makario/entertainer/entertainerlib/backend/backend_server.py", line 104, in initialize_connection_server
    self.message_bus)
  File "/home/makario/entertainer/entertainerlib/backend/core/connection_server.py", line 36, in __init__
    self.server_socket.bind(('localhost', port))
  File "<string>", line 1, in bind
socket.error: (98, 'Address already in use')

(Thanks for your help.)

Revision history for this message
Matt Layman (mblayman) wrote :

Makario, what distribution are you using? According to the traceback, the port number that Entertainer is trying to connect to is already taken by something else that your computer is running.

I don't think that we have a mechanism for changing port numbers in the preferences dialog, but you could go to /home/makario/.config/entertainer/preferences.conf and try changing the backend_port number to something different.

I don't have much experience with ports so I'm not sure of the best way to debug your problem. But I'm pretty certain that the blocking is definitely your problem.

Hopefully this information is useful to you.

Revision history for this message
Matt Layman (mblayman) wrote :

We should catch this exception and tell the users to select a different port in the log if they can't bind to the default port.

Changed in entertainer:
assignee: nobody → laymansterms
importance: Undecided → Low
status: New → In Progress
Revision history for this message
Matt Layman (mblayman) wrote :

I guess since this is a fatal error that prevents entertainer from running and users can't see the true problem unless they comment out lines of code, it probably is more important than I just marked it. Sorry for the inbox spamming.

Changed in entertainer:
importance: Low → High
Revision history for this message
Makario Lewis (makk753) wrote :

All right, I understand. I'm using Ubuntu 8.04, by the way, but I'll try to figure out what program is using the port.

Thanks for your help.

Paul Hummer (rockstar)
Changed in entertainer:
status: In Progress → Fix Committed
Paul Hummer (rockstar)
Changed in entertainer:
milestone: none → entertainer-0.2
Revision history for this message
Chris Rivers (silentchris) wrote :

I'm also getting this error trying to run entertainer on Ubuntu 8.04 64-bit.

Running a sudo netstat -p shows no processes using the default port listed in the preferences conf file (45054). I tried changing that port to 45077 and still received the error. Perhaps this particular bind isn't using that port?

Revision history for this message
Matt Layman (mblayman) wrote :

Chris, I may know what your problem is. By default in 0.1, Entertainer required that the backend be started separately. However, the current trunk does not require that the backend be started separately. So your problem may be that you are using the trunk, started the backend, then tried to start the frontend. If that is the case, then the frontend is trying to start the backend a second time, but the port is already in use by the backend process. Is this what is happening to you?

Paul Hummer (rockstar)
Changed in entertainer:
status: Fix Committed → Fix Released
Revision history for this message
Davide Carini (dade-car) wrote :

This is what happened to me too. Starting just the frontend solved the problem, thanks!

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.