Question

I recently started a single gear application, python 2.7 on Openshift.

I am not being allowed to open a socket -

The Terminal Returned with:

File "server.py", line 21, in <module>
    server_socket.bind(("0.0.0.0", PORT))
  File "/opt/rh/python27/root/usr/lib64/python2.7/socket.py", line 224, in meth
    return getattr(self._sock,name)(*args)
socket.error: [Errno 13] Permission denied

I just need a small socket up and running - does anyone know how I can open a socket on their hosting? If not, what is a good alternative solution so that I can host and open my own python sockets?

Was it helpful?

Solution

you need to bind to your gear's ip address, which on python cartridge i believe is OPENSHIFT_PYTHON_IP, you can't bind to 0.0.0.0, also, only applications bound to port 8080 can be accessed from outside of openshift. (ports 80,443,8000,8443 are all routed to port 8080 on your gear)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top