Last modified: 2014-01-15 18:16:33 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T61850, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 59850 - SERVER_HOST 0.0.0.0 should be "localhost"
SERVER_HOST 0.0.0.0 should be "localhost"
Status: RESOLVED FIXED
Product: Analytics
Classification: Unclassified
Wikimetrics (Other open bugs)
unspecified
All All
: Unprioritized normal
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-01-09 01:01 UTC by Sumana Harihareswara
Modified: 2014-01-15 18:16 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Sumana Harihareswara 2014-01-09 01:01:52 UTC
In wikimetrics/config/web_config.yaml, line 31, we set SERVER_HOST to '0.0.0.0'. I suggest we change this to "localhost". 

When I go to 0.0.0.0:5000 and try to log in with Google auth (using OAuth), I get an error. With localhost:5000, it works. And we refer to 'localhost:5000' in README.md and in various .yaml files in config/ .


The error I get when I try to do an OAuth login at 0.0.0.0:5000 is:



    File "/home/sumanah/.virtualenvs/metrics/lib/python2.7/site-packages/flask/app.py", line 1701, in __call__

    return self.wsgi_app(environ, start_response)

    File "/home/sumanah/.virtualenvs/metrics/lib/python2.7/site-packages/flask/app.py", line 1689, in wsgi_app

    response = self.make_response(self.handle_exception(e))

    File "/home/sumanah/.virtualenvs/metrics/lib/python2.7/site-packages/flask/app.py", line 1687, in wsgi_app

    response = self.full_dispatch_request()

    File "/home/sumanah/.virtualenvs/metrics/lib/python2.7/site-packages/flask/app.py", line 1360, in full_dispatch_request

    rv = self.handle_user_exception(e)

    File "/home/sumanah/.virtualenvs/metrics/lib/python2.7/site-packages/flask/app.py", line 1358, in full_dispatch_request

    rv = self.dispatch_request()

    File "/home/sumanah/.virtualenvs/metrics/lib/python2.7/site-packages/flask/app.py", line 1344, in dispatch_request

    return self.view_functions[rule.endpoint](**req.view_args)

    File "/home/sumanah/.virtualenvs/metrics/lib/python2.7/site-packages/flask_oauth.py", line 429, in decorated

    data = self.handle_oauth2_response()

    File "/home/sumanah/.virtualenvs/metrics/lib/python2.7/site-packages/flask_oauth.py", line 407, in handle_oauth2_response

    type='invalid_response', data=data)

    OAuthException: Invalid response from google



If people are fine with this change then I'm happy to submit a patch.
Comment 1 Sam Reed (reedy) 2014-01-09 04:40:10 UTC
localhost could presumably result in a dns lookup. Use 127.0.0.1?
Comment 2 Dan Andreescu 2014-01-09 12:45:51 UTC
The OAuth consumers are registered to redirect to localhost unfortunately.  I think it's ok in this case, the DNS lookup should be handled by /etc/hosts before it goes anywhere.  You're right Sumana, I'll change it
Comment 3 Gerrit Notification Bot 2014-01-09 13:13:40 UTC
Change 106509 had a related patch set uploaded by Gerrit Patch Uploader:
change SERVER_HOST from 0.0.0.0 to localhost

https://gerrit.wikimedia.org/r/106509
Comment 4 Gerrit Notification Bot 2014-01-09 18:15:13 UTC
Change 106509 merged by Milimetric:
change SERVER_HOST from 0.0.0.0 to localhost

https://gerrit.wikimedia.org/r/106509
Comment 5 Sumana Harihareswara 2014-01-15 18:16:33 UTC
git master works fine now.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links