CSSE1001 / MyPyTutor

Interactive tutorial application for Python3.
Other
7 stars 12 forks source link

Connection Error on close when trying to sync #125

Closed mijohen closed 9 years ago

mijohen commented 9 years ago

Exception in Tkinter callback Traceback (most recent call last): File "C:\Python34\lib\urllib\request.py", line 1182, in do_open h.request(req.get_method(), req.selector, req.data, headers) File "C:\Python34\lib\http\client.py", line 1088, in request self._send_request(method, url, body, headers) File "C:\Python34\lib\http\client.py", line 1126, in _send_request self.endheaders(body) File "C:\Python34\lib\http\client.py", line 1084, in endheaders self._send_output(message_body) File "C:\Python34\lib\http\client.py", line 922, in _send_output self.send(msg) File "C:\Python34\lib\http\client.py", line 857, in send self.connect() File "C:\Python34\lib\http\client.py", line 834, in connect self.timeout, self.source_address) File "C:\Python34\lib\socket.py", line 512, in create_connection raise err File "C:\Python34\lib\socket.py", line 503, in create_connection sock.connect(sa) TimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time or established connection failed because connected host has failed to respond

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\Michael\Documents\mpt\tutorlib\online\session.py", line 171, in _open return self._opener.open(url, data) File "C:\Python34\lib\urllib\request.py", line 463, in open response = self._open(req, data) File "C:\Python34\lib\urllib\request.py", line 481, in _open '_open', req) File "C:\Python34\lib\urllib\request.py", line 441, in _call_chain result = func(*args) File "C:\Python34\lib\urllib\request.py", line 1210, in http_open return self.do_open(http.client.HTTPConnection, req) File "C:\Python34\lib\urllib\request.py", line 1184, in do_open raise URLError(err) urllib.error.URLError: <urlopen error [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time or established connection failed because connected host has failed to respond>

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "C:\Python34\lib\tkinterinit.py", line 1533, in call return self.func(*args) File "C:\Users\Michael\Documents\mpt\tutorlib\gui\app\app.py", line 379, in close self.logout() File "C:\Users\Michael\Documents\mpt\tutorlib\gui\app\app.py", line 597, in logout self.web_api.logout() File "C:\Users\Michael\Documents\mpt\tutorlib\interface\web_api.py", line 140, in logout self.session_manager.logout() File "C:\Users\Michael\Documents\mpt\tutorlib\online\session.py", line 165, in logout self._open(LOGOUT_URL) File "C:\Users\Michael\Documents\mpt\tutorlib\online\session.py", line 178, in _open ) from e tutorlib.online.exceptions.RequestError: Connection Error. Check your network connection and try again.

mijohen commented 9 years ago

@sapi is the server fine? MyPyTutor keeps failing to sync when I go to close.

mijohen commented 9 years ago

I get this error when I try and close the main window while its busy syncing.

Exception in Tkinter callback Traceback (most recent call last): File "C:\Python34\lib\tkinterinit.py", line 1533, in call return self.func(_args) File "C:\Users\Michael\Documents\mpt\tutorlib\gui\app\app.py", line 374, in c ose if self.editor.close() == tkmessagebox.YES: File "C:\Users\Michael\Documents\mpt\tutorlib\gui\editor\editor_window.py", l ne 149, in close self._close() File "C:\Python34\lib\idlelib\EditorWindow.py", line 1035, in _close if self.io.filename: AttributeError: 'NoneType' object has no attribute 'filename' Exception in Tkinter callback Traceback (most recent call last): File "C:\Python34\lib\tkinterinit.py", line 1533, in call return self.func(_args) File "C:\Users\Michael\Documents\mpt\tutorlib\gui\app\app.py", line 374, in c ose if self.editor.close() == tkmessagebox.YES: File "C:\Users\Michael\Documents\mpt\tutorlib\gui\editor\editor_window.py", l ne 149, in close self._close() File "C:\Python34\lib\idlelib\EditorWindow.py", line 1035, in _close if self.io.filename: AttributeError: 'NoneType' object has no attribute 'filename' Exception ignored in: <bound method Interpreter.del of <tutorlib.interface. nterpreter.Interpreter object at 0x00000000036BF160>> Traceback (most recent call last): File "C:\Users\Michael\Documents\mpt\tutorlib\interface\interpreter.py", line 39, in del PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\Users\Michael\AppData\Local\Temp\tmp1n 8mira'

sapi commented 9 years ago

It just seems to get slow sometimes. I would hope that a small number of requests (50 or so) don't DDOS it, though it could be worth toning that down.

That plus a shorter timeout. There's probably some way to set a global one?

On Thursday, February 26, 2015, Michael Henderson notifications@github.com wrote:

I get this error when I try and close the main window while its busy syncing.

Exception in Tkinter callback Traceback (most recent call last): File "C:\Python34\lib\tkinterinit.py", line 1533, in call return self.func(

_args) File "C:\Users\Michael\Documents\mpt\tutorlib\gui\app\app.py", line 374, in c ose if self.editor.close() == tkmessagebox.YES: File "C:\Users\Michael\Documents\mpt\tutorlib\gui\editor\editor_window.py", l ne 149, in close self.close() File "C:\Python34\lib\idlelib\EditorWindow.py", line 1035, in close if self.io.filename: AttributeError: 'NoneType' object has no attribute 'filename' Exception in Tkinter callback Traceback (most recent call last): File "C:\Python34\lib\tkinter__init.py", line 1533, in call return self.func(_args) File "C:\Users\Michael\Documents\mpt\tutorlib\gui\app\app.py", line 374, in c ose if self.editor.close() == tkmessagebox.YES: File "C:\Users\Michael\Documents\mpt\tutorlib\gui\editor\editor_window.py", l ne 149, in close self.

_close() File "C:\Python34\lib\idlelib\EditorWindow.py", line 1035, in close if self.io.filename: AttributeError: 'NoneType' object has no attribute 'filename' Exception ignored in: <bound method Interpreter._del of nterpreter.Interpreter object at 0x00000000036BF160>> Traceback (most recent call last): File "C:\Users\Michael\Documents\mpt\tutorlib\interface\interpreter.py", line 39, in del PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\Users\Michael\AppData\Local\Temp\tmp1n 8mira'

— Reply to this email directly or view it on GitHub https://github.com/CSSE1001/MyPyTutor/issues/125#issuecomment-76170119.

starsnabove commented 9 years ago

If this is on win 8 it could be related to the SSL problem as Microsofts attempted fix to the SSL problem made it slow. On 26/02/2015 10:46 pm, "Sean Purdon" notifications@github.com wrote:

It just seems to get slow sometimes. I would hope that a small number of requests (50 or so) don't DDOS it, though it could be worth toning that down.

That plus a shorter timeout. There's probably some way to set a global one?

On Thursday, February 26, 2015, Michael Henderson < notifications@github.com> wrote:

I get this error when I try and close the main window while its busy syncing.

Exception in Tkinter callback Traceback (most recent call last): File "C:\Python34\lib\tkinterinit.py", line 1533, in call return self.func(

_args) File "C:\Users\Michael\Documents\mpt\tutorlib\gui\app\app.py", line 374, in c ose if self.editor.close() == tkmessagebox.YES: File "C:\Users\Michael\Documents\mpt\tutorlib\gui\editor\editor_window.py", l ne 149, in close self.close() File "C:\Python34\lib\idlelib\EditorWindow.py", line 1035, in close if self.io.filename: AttributeError: 'NoneType' object has no attribute 'filename' Exception in Tkinter callback Traceback (most recent call last): File "C:\Python34\lib\tkinter__init.py", line 1533, in call return self.func(_args) File "C:\Users\Michael\Documents\mpt\tutorlib\gui\app\app.py", line 374, in c ose if self.editor.close() == tkmessagebox.YES: File "C:\Users\Michael\Documents\mpt\tutorlib\gui\editor\editor_window.py", l ne 149, in close self.

_close() File "C:\Python34\lib\idlelib\EditorWindow.py", line 1035, in close if self.io.filename: AttributeError: 'NoneType' object has no attribute 'filename' Exception ignored in: <bound method Interpreter._del of nterpreter.Interpreter object at 0x00000000036BF160>> Traceback (most recent call last): File "C:\Users\Michael\Documents\mpt\tutorlib\interface\interpreter.py", line 39, in del PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\Users\Michael\AppData\Local\Temp\tmp1n 8mira'

— Reply to this email directly or view it on GitHub <https://github.com/CSSE1001/MyPyTutor/issues/125#issuecomment-76170119 .

— Reply to this email directly or view it on GitHub https://github.com/CSSE1001/MyPyTutor/issues/125#issuecomment-76172198.

sapi commented 9 years ago

On the new_installer branch, I changed the sync threads to retry a few times on failure and installed a global timeout.

If you're on that branch, please let me know if you're still seeing long timeouts. (Some failures are probably to be expected as a fact of life.)

If we don't go with the installer, I'll merge it into master.

sapi commented 9 years ago

Need to handle the timeout error on close. This shouldn't throw (and I thought I'd asked it really nicely not to).

sapi commented 9 years ago

Alex mentioned today that this could also be an issue with I/O throttling on the zone, seeing as we use the filesystem as a poor man's database.

I'll try to take a closer look today, and if necessary, to tone back the number of requests.

mijohen commented 9 years ago

I am still getting an error when I try and close the main window while it is syncing.

Exception in Tkinter callback Traceback (most recent call last): File "c:\Python34\lib\tkinterinit.py", line 1533, in call return self.func(_args) File "C:\Users\Michael\Documents\mpt-install\tutorlib\gui\app\app.py", line 34 1, in close if self.editor.close() == tkmessagebox.YES: File "C:\Users\Michael\Documents\mpt-install\tutorlib\gui\editor\editor_window .py", line 149, in close self._close() File "c:\Python34\lib\idlelib\EditorWindow.py", line 1035, in _close if self.io.filename: AttributeError: 'NoneType' object has no attribute 'filename' Exception in Tkinter callback Traceback (most recent call last): File "c:\Python34\lib\tkinterinit.py", line 1533, in call return self.func(_args) File "C:\Users\Michael\Documents\mpt-install\tutorlib\gui\app\app.py", line 34 1, in close if self.editor.close() == tkmessagebox.YES: File "C:\Users\Michael\Documents\mpt-install\tutorlib\gui\editor\editor_window .py", line 149, in close self._close() File "c:\Python34\lib\idlelib\EditorWindow.py", line 1035, in _close if self.io.filename: AttributeError: 'NoneType' object has no attribute 'filename' Exception in Tkinter callback Traceback (most recent call last): File "c:\Python34\lib\urllib\request.py", line 1182, in do_open h.request(req.get_method(), req.selector, req.data, headers) File "c:\Python34\lib\http\client.py", line 1088, in request self._send_request(method, url, body, headers) File "c:\Python34\lib\http\client.py", line 1126, in _send_request self.endheaders(body) File "c:\Python34\lib\http\client.py", line 1084, in endheaders self._send_output(message_body) File "c:\Python34\lib\http\client.py", line 922, in _send_output self.send(msg) File "c:\Python34\lib\http\client.py", line 857, in send self.connect() File "c:\Python34\lib\http\client.py", line 834, in connect self.timeout, self.source_address) File "c:\Python34\lib\socket.py", line 512, in create_connection raise err File "c:\Python34\lib\socket.py", line 503, in create_connection sock.connect(sa) socket.timeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\Michael\Documents\mpt-install\tutorlib\online\session.py", line 171, in _open return self._opener.open(url, data) File "c:\Python34\lib\urllib\request.py", line 463, in open response = self._open(req, data) File "c:\Python34\lib\urllib\request.py", line 481, in _open '_open', req) File "c:\Python34\lib\urllib\request.py", line 441, in _call_chain result = func(*args) File "c:\Python34\lib\urllib\request.py", line 1210, in http_open return self.do_open(http.client.HTTPConnection, req) File "c:\Python34\lib\urllib\request.py", line 1184, in do_open raise URLError(err) urllib.error.URLError:

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "c:\Python34\lib\tkinterinit.py", line 1533, in call return self.func(*args) File "C:\Users\Michael\Documents\mpt-install\tutorlib\gui\app\app.py", line 35 5, in close self.logout() File "C:\Users\Michael\Documents\mpt-install\tutorlib\gui\app\app.py", line 57 0, in logout self.web_api.logout() File "C:\Users\Michael\Documents\mpt-install\tutorlib\interface\web_api.py", l ine 140, in logout self.session_manager.logout() File "C:\Users\Michael\Documents\mpt-install\tutorlib\online\session.py", line 165, in logout self._open(LOGOUT_URL) File "C:\Users\Michael\Documents\mpt-install\tutorlib\online\session.py", line 178, in _open ) from e tutorlib.online.exceptions.RequestError: Connection Error. Check your network c onnection and try again.