richardbarran / django-photologue

A customizable plug-in photo gallery management application for the Django web framework.
BSD 3-Clause "New" or "Revised" License
674 stars 239 forks source link

[Errno 41] Protocol wrong type for socket #190

Closed mina-gaid closed 6 years ago

mina-gaid commented 6 years ago

Running in the latest version of Django give's me this in the terminal. It doesn't crash the app though.

----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 54342)
Traceback (most recent call last):
  File "/Users/mina/anaconda3/lib/python3.6/wsgiref/handlers.py", line 138, in run
    self.finish_response()
  File "/Users/mina/anaconda3/lib/python3.6/wsgiref/handlers.py", line 180, in finish_response
    self.write(data)
  File "/Users/mina/anaconda3/lib/python3.6/wsgiref/handlers.py", line 274, in write
    self.send_headers()
  File "/Users/mina/anaconda3/lib/python3.6/wsgiref/handlers.py", line 332, in send_headers
    self.send_preamble()
  File "/Users/mina/anaconda3/lib/python3.6/wsgiref/handlers.py", line 255, in send_preamble
    ('Date: %s\r\n' % format_date_time(time.time())).encode('iso-8859-1')
  File "/Users/mina/anaconda3/lib/python3.6/wsgiref/handlers.py", line 453, in _write
    result = self.stdout.write(data)
  File "/Users/mina/anaconda3/lib/python3.6/socketserver.py", line 775, in write
    self._sock.sendall(b)
OSError: [Errno 41] Protocol wrong type for socket

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/mina/anaconda3/lib/python3.6/wsgiref/handlers.py", line 141, in run
    self.handle_error()
  File "/Users/mina/anaconda3/lib/python3.6/site-packages/django/core/servers/basehttp.py", line 86, in handle_error
    super().handle_error()
  File "/Users/mina/anaconda3/lib/python3.6/wsgiref/handlers.py", line 368, in handle_error
    self.finish_response()
  File "/Users/mina/anaconda3/lib/python3.6/wsgiref/handlers.py", line 180, in finish_response
    self.write(data)
  File "/Users/mina/anaconda3/lib/python3.6/wsgiref/handlers.py", line 274, in write
    self.send_headers()
  File "/Users/mina/anaconda3/lib/python3.6/wsgiref/handlers.py", line 331, in send_headers
    if not self.origin_server or self.client_is_modern():
  File "/Users/mina/anaconda3/lib/python3.6/wsgiref/handlers.py", line 344, in client_is_modern
    return self.environ['SERVER_PROTOCOL'].upper() != 'HTTP/0.9'
TypeError: 'NoneType' object is not subscriptable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/mina/anaconda3/lib/python3.6/socketserver.py", line 639, in process_request_thread
    self.finish_request(request, client_address)
  File "/Users/mina/anaconda3/lib/python3.6/socketserver.py", line 361, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/Users/mina/anaconda3/lib/python3.6/socketserver.py", line 696, in __init__
    self.handle()
  File "/Users/mina/anaconda3/lib/python3.6/site-packages/django/core/servers/basehttp.py", line 154, in handle
    handler.run(self.server.get_app())
  File "/Users/mina/anaconda3/lib/python3.6/wsgiref/handlers.py", line 144, in run
    self.close()
  File "/Users/mina/anaconda3/lib/python3.6/wsgiref/simple_server.py", line 35, in close
    self.status.split(' ',1)[0], self.bytes_sent
AttributeError: 'NoneType' object has no attribute 'split'
richardbarran commented 6 years ago

I'm not sure that the issue is with the Photologue code - I cannot see that Photologue code is called anywhere in the tracebacks. However, I haven't tested Photologue with Django 2.1 yet.

mina-gaid commented 6 years ago

It happens when the album page is loading and then you close the page during the load. Right before all the pages are displayed. It is possible however that it might be an issue with Django itself. At least that's what I was told on StackOverflow. That said, I've only experienced this with photologue.

richardbarran commented 6 years ago

Could it be an issue with Anaconda3? Is it possible for you to run your project on a "vanilla" version of Python and Django?

mina-gaid commented 6 years ago

Not at the moment because I'm on a Mac and will be forced to use Python 2

richardbarran commented 6 years ago

Hi, Thank your for the information. At present I cannot see any issues that can be traced back to Photologue (there's nothing in the tracebacks to indicate that Photologue code is being executed). Accordingly, I am going to close this ticket. Please do not hesitate to reopen the ticket if you discover new information that involves Photologue.