Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no socket could be created (port 80) #314

Closed
ecvick85 opened this issue Feb 6, 2019 · 11 comments
Closed

no socket could be created (port 80) #314

ecvick85 opened this issue Feb 6, 2019 · 11 comments

Comments

@ecvick85
Copy link

ecvick85 commented Feb 6, 2019

When trying to run the server on port 80, we are receiving this error:

./e-mission-py.bash emission/net/api/cfc_webapp.py
storage not configured, falling back to sample, default configuration
Connecting to database URL localhost
Finished configuring logging for <RootLogger root (WARNING)>
Replaced json_dumps in plugin with the one from bson
Changing bt.json_loads from <function <lambda> at 0x7f05f9145400> to <function loads at 0x7f05f5db3f28>
Running with HTTPS turned OFF - use a reverse proxy on production
Bottle v0.13-dev server starting up (using CherootServer())...
Listening on http://52.91.65.149:80/
Hit Ctrl-C to quit.

Traceback (most recent call last):
  File "emission/net/api/cfc_webapp.py", line 504, in <module>
    run(host=server_host, port=server_port, server='cheroot', debug=True)
  File "/home/ubuntu/e-mission-server/emission/net/api/bottle.py", line 3713, in run
    server.run(app)
  File "/home/ubuntu/e-mission-server/emission/net/api/bottle.py", line 3303, in run
    server.start()
  File "/home/ubuntu/miniconda3/envs/emission/lib/python3.6/site-packages/cheroot/server.py", line 1525, in start
    raise socket.error(msg)
OSError: No socket could be created -- (('52.91.65.149', 80): [Errno 99] Cannot assign requested address)
sys:1: ResourceWarning: unclosed file <_io.TextIOWrapper name='conf/storage/db.conf.sample' mode='r' encoding='UTF-8'>
sys:1: ResourceWarning: unclosed file <_io.TextIOWrapper name='conf/net/ext_service/habitica.json' mode='r' encoding='UTF-8'>
sys:1: ResourceWarning: unclosed file <_io.TextIOWrapper name='conf/net/ext_service/yelpfusion.json' mode='r' encoding='UTF-8'>

Any tips?

@shankari
Copy link
Contributor

shankari commented Feb 7, 2019

port 80 is a system port. You cannot open it as a non-root user.

@shankari
Copy link
Contributor

shankari commented Feb 7, 2019

https://serverfault.com/questions/112795/how-to-run-a-server-on-port-80-as-a-normal-user-on-linux
has lots of potential solutions. Easiest but least secure is probably to just run the server as root.

@ecvick85
Copy link
Author

ecvick85 commented Feb 7, 2019

I tried running the server as root and received this error (and I'm in the emission environment too)

sudo ./e-mission-py.bash emission/net/api/cfc_webapp.py
sudo: unable to resolve host ip-
Traceback (most recent call last):
  File "emission/net/api/cfc_webapp.py", line 6, in <module>
    from future import standard_library
ImportError: No module named future

@shankari
Copy link
Contributor

shankari commented Feb 7, 2019

@ecvick85 do you remember what the no module named future error represents?
It is very well known :)

@shankari
Copy link
Contributor

shankari commented Feb 7, 2019

also, you might want to look up what sudo actually does, including in terms of environment variable propagation.

@shankari
Copy link
Contributor

shankari commented Feb 7, 2019

@ecvick85 did you figure this out? If you did not, then instead of doing the pedagogically right thing and helping you figure out the answer, I might just tell you, since we do have to get this to work before the demo to Trevor's professor.

@ecvick85
Copy link
Author

ecvick85 commented Feb 7, 2019

The server is back up - I don't think I did it the safe way, however. I logged in as root (sudo -s) then I started the emission environment and restarted the server on port 80.

@shankari
Copy link
Contributor

shankari commented Feb 7, 2019

@ecvick85 Great job! We were able to do this the pedagogically right way because you figured out the answer yourself :) You are right that it is still not the best overall solution (as the posts on stackoverflow said) but I think it is fine for now.

@shankari
Copy link
Contributor

shankari commented Feb 7, 2019

and restarted the server on port 80.

Doesn't seem to be running on port 80. I just tried connecting to http://52.91.65.149 and it hangs.

@shankari
Copy link
Contributor

shankari commented Feb 8, 2019

ah, I had to open port 80 in the incoming port list
I did wonder why the connection hung instead of failing...

@shankari
Copy link
Contributor

@ecvick85 if this is resolved, can you please close this bug?

@shankari shankari transferred this issue from e-mission/e-mission-server Feb 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants