{"action":"created","issue":{"url":"https://api.github.com/repos/nprapps/dailygraphics/issues/74","labels_url":"https://api.github.com/repos/nprapps/dailygraphics/issues/74/labels{/name}","comments_url":"https://api.github.com/repos/nprapps/dailygraphics/issues/74/comments","events_url":"https://api.github.com/repos/nprapps/dailygraphics/issues/74/events","html_url":"https://github.com/nprapps/dailygraphics/issues/74","id":60040265,"number":74,"title":"fab app sometimes returns a fatal error, but appears to run invisibly in the background","user":{"login":"alykat","id":491318,"avatar_url":"https://avatars.githubusercontent.com/u/491318?v=3","gravatar_id":"","url":"https://api.github.com/users/alykat","html_url":"https://github.com/alykat","followers_url":"https://api.github.com/users/alykat/followers","following_url":"https://api.github.com/users/alykat/following{/other_user}","gists_url":"https://api.github.com/users/alykat/gists{/gist_id}","starred_url":"https://api.github.com/users/alykat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alykat/subscriptions","organizations_url":"https://api.github.com/users/alykat/orgs","repos_url":"https://api.github.com/users/alykat/repos","events_url":"https://api.github.com/users/alykat/events{/privacy}","received_events_url":"https://api.github.com/users/alykat/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/nprapps/dailygraphics/labels/Priority:%20Normal","name":"Priority: Normal","color":"ffff00"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-06T00:30:10Z","updated_at":"2015-03-09T21:02:30Z","closed_at":null,"body":"Sometimes when I run ```fab app```, I get this error message and the webserver appears to stop:\r\n\r\n```\r\n(dailygraphics)ahurt-npr:dailygraphics AHurt$ fab app\r\n[localhost] local: gunicorn -b 0.0.0.0:8000 --debug --reload app:wsgi_app\r\n\r\nFatal error: local() encountered an error (return code 1) while executing 'gunicorn -b 0.0.0.0:8000 --debug --reload app:wsgi_app'\r\n\r\nAborting.\r\n(dailygraphics)ahurt-npr:dailygraphics AHurt$\r\n```\r\n\r\nBut if I pull up http://localhost:8000, pages are still loading.\r\n\r\nRestarting my computer seems to fix the problem, at least initially. But it recurs with some regularity.\r\n\r\nI've seen this happen on at least one other person's machine."},"comment":{"url":"https://api.github.com/repos/nprapps/dailygraphics/issues/comments/77941861","html_url":"https://github.com/nprapps/dailygraphics/issues/74#issuecomment-77941861","issue_url":"https://api.github.com/repos/nprapps/dailygraphics/issues/74","id":77941861,"user":{"login":"alykat","id":491318,"avatar_url":"https://avatars.githubusercontent.com/u/491318?v=3","gravatar_id":"","url":"https://api.github.com/users/alykat","html_url":"https://github.com/alykat","followers_url":"https://api.github.com/users/alykat/followers","following_url":"https://api.github.com/users/alykat/following{/other_user}","gists_url":"https://api.github.com/users/alykat/gists{/gist_id}","starred_url":"https://api.github.com/users/alykat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alykat/subscriptions","organizations_url":"https://api.github.com/users/alykat/orgs","repos_url":"https://api.github.com/users/alykat/repos","events_url":"https://api.github.com/users/alykat/events{/privacy}","received_events_url":"https://api.github.com/users/alykat/received_events","type":"User","site_admin":false},"created_at":"2015-03-09T21:02:30Z","updated_at":"2015-03-09T21:02:30Z","body":"After consulting with @TylerFisher @eads @dannydb:\r\n\r\nThis 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).\r\n\r\nOne way to fix it: Add [a function](https://gist.github.com/dannydb/167e50c6d16e37e04156) to your `.bash_profile`...\r\n\r\n```\r\nnano ~/.bash_profile\r\n```\r\n\r\nAdd this to the bottom:\r\n\r\n```\r\n# Sometimes yosemite crashes with a gunicorn server up\r\n# and when it comes back up there is a python process blocking port 8000\r\n# kill that process with this function\r\n# http://stackoverflow.com/questions/3855127/find-and-kill-process-locking-port-3000-on-mac\r\nfunction killport() {\r\n\tlsof -i TCP:$1 | grep LISTEN | awk '{print $2}' | xargs kill -9\r\n}\r\n```\r\n\r\nSave, and then refresh your terminal window:\r\n\r\n```\r\nsource ~/.bash_profile\r\n```\r\n\r\nOnce you've set that up, you can type this command to kill the port in question (usually 8000) any time you see this error:\r\n\r\n```\r\nkillport 8000\r\nfab app\r\n```"}}