Skip to content

Upgrading to 19.7.0 means can't bind anymore #1480

Closed

Description

@hartym

Upgraded to latest gunicorn and could not bind ip address anymore (simple wsgi app, ipv4 or ipv6 same story).

foo@xxx:~$ cd current
foo@xxx:~/current$ . env/bin/activate
foo@xxx:~/current$ gunicorn my.wsgi.package
[2017-03-10 18:50:46 +0000] [9242] [INFO] Starting gunicorn 19.7.0
[2017-03-10 18:50:46 +0000] [9242] [ERROR] Retrying in 1 second.
[2017-03-10 18:50:47 +0000] [9242] [ERROR] Retrying in 1 second.
[2017-03-10 18:50:48 +0000] [9242] [ERROR] Retrying in 1 second.
[2017-03-10 18:50:49 +0000] [9242] [ERROR] Retrying in 1 second.
[2017-03-10 18:50:50 +0000] [9242] [ERROR] Retrying in 1 second.
[2017-03-10 18:50:51 +0000] [9242] [ERROR] Can't connect to ('127.0.0.1', 8000)

Reverting to 19.6.0 fixes the problem.

System version : Linux xxx 3.2.0-4-amd64 #1 SMP Debian 3.2.68-1+deb7u1 x86_64 GNU/Linux

Let me know if I can provide more info, 19.6.0 is acceptable solution for me but I guess that's a regression you wanna at least understand ?

Activity

  1. lee-pai-long commented on Mar 13, 2017

    @lee-pai-long

    Adding to @hartym comment using --log-level debug I get the following:

    [2017-03-13 15:49:39 +0100] [7175] [INFO] Starting gunicorn 19.7.0
    [2017-03-13 15:49:39 +0100] [7175] [DEBUG] connection to ('0.0.0.0', 8000) failed: [Errno 92] Protocol not available
    [2017-03-13 15:49:39 +0100] [7175] [ERROR] Retrying in 1 second.
    [2017-03-13 15:49:40 +0100] [7175] [DEBUG] connection to ('0.0.0.0', 8000) failed: [Errno 92] Protocol not available
    [2017-03-13 15:49:40 +0100] [7175] [ERROR] Retrying in 1 second.
    [2017-03-13 15:49:41 +0100] [7175] [DEBUG] connection to ('0.0.0.0', 8000) failed: [Errno 92] Protocol not available
    [2017-03-13 15:49:41 +0100] [7175] [ERROR] Retrying in 1 second.
    [2017-03-13 15:49:42 +0100] [7175] [DEBUG] connection to ('0.0.0.0', 8000) failed: [Errno 92] Protocol not available
    [2017-03-13 15:49:42 +0100] [7175] [ERROR] Retrying in 1 second.
    [2017-03-13 15:49:43 +0100] [7175] [DEBUG] connection to ('0.0.0.0', 8000) failed: [Errno 92] Protocol not available
    [2017-03-13 15:49:43 +0100] [7175] [ERROR] Retrying in 1 second.
    [2017-03-13 15:49:44 +0100] [7175] [ERROR] Can't connect to ('0.0.0.0', 8000)
    
  2. tilgovi commented on Mar 13, 2017

    @tilgovi
    Collaborator

    It's very hard to imagine why this would be. Are you positive that nothing else was bound on the port at that time?

  3. tilgovi commented on Mar 13, 2017

    @tilgovi
    Collaborator

    Hmm. It does seem you're binding to 0.0.0.0 now, when you used to be using 127.0.0.1. Does this make a difference?

  4. tilgovi commented on Mar 13, 2017

    @tilgovi
    Collaborator

    Oh, I see. Both logs are from 19.7.0.

  5. lee-pai-long commented on Mar 14, 2017

    @lee-pai-long

    @tilgovi For my part I double checked, on the VM and try on another "empty" VM and the result is the same, in both case using 19.6 worked perfectly.

  6. tilgovi commented on Mar 14, 2017

    @tilgovi
    Collaborator

    I suspect this is due to SO_REUSEPORT issues.

    We probably need to make a change like this one in thriftpy: Thriftpy/thriftpy#264

  7. tilgovi commented on Mar 14, 2017

    @tilgovi
    Collaborator

    Any chance you can test this?

    The change would be in gunicorn/sock.py in the set_options method of BaseSocket class.

  8. added a commit that references this issue on Mar 14, 2017
    316f2a8
  9. tilgovi commented on Mar 14, 2017

    @tilgovi
    Collaborator

    I've pushed a branch for this.

  10. added 2 commits that reference this issue on Mar 14, 2017
    9e076f4
    15408a3
  11. benoitc commented on Mar 16, 2017

    @benoitc
    Owner

    @hartym @lee-pai-long can you test it ? If OK we will bump a 0.17.1 .

  12. tilgovi commented on Mar 17, 2017

    @tilgovi
    Collaborator

    @hartym @lee-pai-long branch for testing is over at #1483.

  13. hartym commented on Mar 20, 2017

    @hartym
    Author

    Woops, sorry i did not see the thread before. I'm going to see if I can pull something quickly to test the suggested change.

  14. hartym commented on Mar 20, 2017

    @hartym
    Author

    Works for me.

    I bumped the gunicorn version number back to 19.7.0, deployed to check the breakage was still there, it was indeed broken, applied the patch, restarted the server and the port bind now works again.

    Thank you, will bumb to 19.7.1 when it will be available.

  15. tilgovi commented on Mar 21, 2017

    @tilgovi
    Collaborator

    19.7.1 should be available now

  16. RazZziel commented on Apr 25, 2017

    @RazZziel

    19.7.1 is still broken for me:

    root@server:/var/www/service# .venv/bin/gunicorn wsgi -c ../gunicorn.conf.py
    [2017-04-25 08:56:45 +0000] [1234] [INFO] Starting gunicorn 19.7.1
    Traceback (most recent call last):
      File "/var/www/service/.venv/lib/python3.5/site-packages/gunicorn/sock.py", line 44, in set_options
        sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT, 1)
    OSError: [Errno 92] Protocol not available
    
  17. benoitc commented on Apr 25, 2017

    @benoitc
    Owner
  18. petermorlion commented on May 12, 2017

    @petermorlion

    I can verify the master works for me (while 19.7.1 doesn't).

  19. added a commit that references this issue on Mar 16, 2018
    684071c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions