Skip to content

fab app sometimes returns a fatal error, but appears to run invisibly in the background #74

Closed

Description

@alykat

Sometimes when I run fab app, I get this error message and the webserver appears to stop:

(dailygraphics)ahurt-npr:dailygraphics AHurt$ fab app
[localhost] local: gunicorn -b 0.0.0.0:8000 --debug --reload app:wsgi_app

Fatal error: local() encountered an error (return code 1) while executing 'gunicorn -b 0.0.0.0:8000 --debug --reload app:wsgi_app'

Aborting.
(dailygraphics)ahurt-npr:dailygraphics AHurt$

But if I pull up http://localhost:8000, pages are still loading.

Restarting my computer seems to fix the problem, at least initially. But it recurs with some regularity.

I've seen this happen on at least one other person's machine.

Activity

  1. alykat commented on Mar 9, 2015

    @alykat
    MemberAuthor

    After consulting with @TylerFisher @eads @dannydb:

    This error happens when you don't explicitly quit out of a gunicorn session (say, if you close your terminal window without first hitting ctrl+c to stop the webserver).

    One way to fix it: Add a function to your .bash_profile...

    nano ~/.bash_profile
    

    Add this to the bottom:

    # Sometimes yosemite crashes with a gunicorn server up
    # and when it comes back up there is a python process blocking port 8000
    # kill that process with this function
    # http://stackoverflow.com/questions/3855127/find-and-kill-process-locking-port-3000-on-mac
    function killport() {
        lsof -i TCP:$1 | grep LISTEN | awk '{print $2}' | xargs kill -9
    }
    

    Save, and then refresh your terminal window:

    source ~/.bash_profile
    

    Once you've set that up, you can type this command to kill the port in question (usually 8000) any time you see this error:

    killport 8000
    fab app
    
  2. added a commit that references this issue on Mar 9, 2015
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