New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting unexpected error and KA lite does not start up - Version 0.16.5 #5132

Closed
harishbalachandran opened this Issue Jun 4, 2016 · 6 comments

Comments

Projects
None yet
3 participants
@harishbalachandran

harishbalachandran commented Jun 4, 2016

Summary

We want to start KA lite on port 9500 and we are using the following command:
sudo kalite start --port=9500

We encounter this problem very frequently, but other wise the same command works and KA lite starts up.

What is the work around and how to fix this problem and get KA lite working?

Branch or installer method

OS: Ubuntu version 14.04 LTS
Installer: "pip install ka-lite" and "sudo kalite manage setup"
Version: 0.16.5
assessment file: en.zip

Traceback or relevant snippet from server.log

nalanda@nalanda-x200ma:~$ sudo kalite start --port=9500
Running 'kalite start' as daemon (system service)

Stand by while the server loads its data...

Traceback (most recent call last):
  File "/usr/share/kalite/kalitectl.py", line 925, in <module>
    port=arguments["--port"]
  File "/usr/share/kalite/kalitectl.py", line 493, in start
    if get_pid():
  File "/usr/share/kalite/kalitectl.py", line 344, in get_pid
    conn.request("GET", PING_URL)
  File "/usr/lib/python2.7/httplib.py", line 973, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib/python2.7/httplib.py", line 1007, in _send_request
    self.endheaders(body)
  File "/usr/lib/python2.7/httplib.py", line 969, in endheaders
    self._send_output(message_body)
  File "/usr/lib/python2.7/httplib.py", line 829, in _send_output
    self.send(msg)
  File "/usr/lib/python2.7/httplib.py", line 791, in send
    self.connect()
  File "/usr/lib/python2.7/httplib.py", line 772, in connect
    self.timeout, self.source_address)
  File "/usr/lib/python2.7/socket.py", line 571, in create_connection
    raise err
socket.error: [Errno 111] Connection refused

How to reproduce

  1. Install KA lite on Ubuntu 14.04 LTS using "pip install ka-lite" command.
  2. Try to start ka lite on port 9500

Real-life consequences

This will have an huge impact since we have to deployment for 6000+ students on 15th June and if KA lite does not start up then it might cause a huge setback in classrooms.

Screenshots

screen shot 2016-06-04 at 1 12 17 pm

@harishbalachandran harishbalachandran changed the title from Getting unexpected error and KA lite does not start up. to Getting unexpected error and KA lite does not start up - Version 0.16.5 Jun 4, 2016

@quozl

This comment has been minimized.

Show comment
Hide comment
@quozl

quozl Jun 4, 2016

Contributor

That's interesting. The --port option is correct, it works for me, with no error, but my install was with apt install ka-lite-bundle from the PPA, not pip, so I do this;

sudo su - ka-lite -c '/usr/bin/kalite start --port=9500'

or

sudo su - ka-lite -c '/usr/bin/kalite stop'

(Your command sudo manage setup in user nalanda may result in kalite running as user root but with $HOME set to ~nalanda, and so it will create a .kalite subdirectory and a file kalite.pid in that directory; it might not be what you intended.)

Contributor

quozl commented Jun 4, 2016

That's interesting. The --port option is correct, it works for me, with no error, but my install was with apt install ka-lite-bundle from the PPA, not pip, so I do this;

sudo su - ka-lite -c '/usr/bin/kalite start --port=9500'

or

sudo su - ka-lite -c '/usr/bin/kalite stop'

(Your command sudo manage setup in user nalanda may result in kalite running as user root but with $HOME set to ~nalanda, and so it will create a .kalite subdirectory and a file kalite.pid in that directory; it might not be what you intended.)

@benjaoming

This comment has been minimized.

Show comment
Hide comment
@benjaoming

benjaoming Jun 4, 2016

Member

@harishbalachandran thanks for the report!

I haven't encountered this issue before, but my theory judging from the traceback is this:

When KA Lite starts, it maintains its "process ID" in a file. That way, we know which process is currently running if KA Lite is running. The file is located in .kalite/kalite.pid. If this file exists, we assume that a running server might exist and then we proceed to ping it. If this fails, we assume it's a dead/frozen/broken/non-existent process and we proceed to killing it.

After this, everything should be fine, and the KA Lite daemon (server) starts.

It seems, however, that an uncaught socket.error occurs while pinging the detected instance. This is a clear mistake and I'll add catching socket.error in 0.16.6.

Thanks for reporting!

Thanks also for the suggestion @quozl however it should be noted that there isn't a significant difference between the PIP and .deb/PPA distributions, all of this is tightly sync'ed, and latest releases are the same. Major differences exist in the ka-lite-raspberry-pi debian build's behaviour, but the others are fairly aligned.

Member

benjaoming commented Jun 4, 2016

@harishbalachandran thanks for the report!

I haven't encountered this issue before, but my theory judging from the traceback is this:

When KA Lite starts, it maintains its "process ID" in a file. That way, we know which process is currently running if KA Lite is running. The file is located in .kalite/kalite.pid. If this file exists, we assume that a running server might exist and then we proceed to ping it. If this fails, we assume it's a dead/frozen/broken/non-existent process and we proceed to killing it.

After this, everything should be fine, and the KA Lite daemon (server) starts.

It seems, however, that an uncaught socket.error occurs while pinging the detected instance. This is a clear mistake and I'll add catching socket.error in 0.16.6.

Thanks for reporting!

Thanks also for the suggestion @quozl however it should be noted that there isn't a significant difference between the PIP and .deb/PPA distributions, all of this is tightly sync'ed, and latest releases are the same. Major differences exist in the ka-lite-raspberry-pi debian build's behaviour, but the others are fairly aligned.

@benjaoming

This comment has been minimized.

Show comment
Hide comment
@benjaoming

benjaoming Jun 4, 2016

Member

@harishbalachandran - if you have time, you are most welcome to try out our latest 0.16.6dev0 prerelease on PyPi:

sudo pip install ka-lite --pre

This should install a version of KA Lite on top of the Debian/Ubuntu version. You can remove it again with sudo pip uninstall ka-lite.

Member

benjaoming commented Jun 4, 2016

@harishbalachandran - if you have time, you are most welcome to try out our latest 0.16.6dev0 prerelease on PyPi:

sudo pip install ka-lite --pre

This should install a version of KA Lite on top of the Debian/Ubuntu version. You can remove it again with sudo pip uninstall ka-lite.

@benjaoming

This comment has been minimized.

Show comment
Hide comment
@benjaoming

benjaoming Jun 9, 2016

Member

@harishbalachandran did you have time to test this with the pre release I've built for you? Otherwise I shall close the issue, hoping that the above PR fixed it...

Member

benjaoming commented Jun 9, 2016

@harishbalachandran did you have time to test this with the pre release I've built for you? Otherwise I shall close the issue, hoping that the above PR fixed it...

@harishbalachandran

This comment has been minimized.

Show comment
Hide comment
@harishbalachandran

harishbalachandran Jun 10, 2016

Hey @benjaoming like I mentioned this issue does not occur in all the instance, but very few times. I did install the pre release you had given, did no face this issue. You can go ahead and add the same in 0.16.6, we will upgrade and keep you posted if we face the same problem.

harishbalachandran commented Jun 10, 2016

Hey @benjaoming like I mentioned this issue does not occur in all the instance, but very few times. I did install the pre release you had given, did no face this issue. You can go ahead and add the same in 0.16.6, we will upgrade and keep you posted if we face the same problem.

@benjaoming

This comment has been minimized.

Show comment
Hide comment
@benjaoming

benjaoming Jun 11, 2016

Member

Thanks for the feedback @harishbalachandran! My assessment is definitely that a theoretical behaviour like the one you described is now solved, so I'm going to close the issue. We'll reopen it if if happens again!

Member

benjaoming commented Jun 11, 2016

Thanks for the feedback @harishbalachandran! My assessment is definitely that a theoretical behaviour like the one you described is now solved, so I'm going to close the issue. We'll reopen it if if happens again!

@benjaoming benjaoming closed this Jun 11, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment