sparckles / Robyn

Robyn is a Super Fast Async Python Web Framework with a Rust runtime.
https://robyn.tech/
BSD 2-Clause "Simplified" License
3.89k stars 195 forks source link

Crashes when a reserved port is used #856

Closed VishnuSanal closed 2 weeks ago

VishnuSanal commented 2 weeks ago

Bug Description

Starting dev server...
Reloading /home/vishnu/Miscellaneous/fun-projects/RobynApp/app.py...
INFO:robyn.logger:SERVER IS RUNNING IN VERBOSE/DEBUG MODE. Set --log-level to WARN to run in production mode.
INFO:robyn.logger:Added route HttpMethod.GET /
INFO:robyn.logger:Robyn version: 0.55.0
INFO:robyn.logger:Starting server at http://0.0.0.0:22
Traceback (most recent call last):
  File "/home/vishnu/Miscellaneous/fun-projects/RobynApp/app.py", line 12, in <module>
    app.start(host="0.0.0.0", port=22)
  File "/home/vishnu/Miscellaneous/fun-projects/RobynApp/.venv/lib/python3.12/site-packages/robyn/__init__.py", line 228, in start
    run_processes(
  File "/home/vishnu/Miscellaneous/fun-projects/RobynApp/.venv/lib/python3.12/site-packages/robyn/processpool.py", line 31, in run_processes
    socket = SocketHeld(url, port)
             ^^^^^^^^^^^^^^^^^^^^^
PermissionError: Permission denied (os error 13)```

### Steps to Reproduce

from robyn import Robyn

app = Robyn(file)

@app.get("/") def index(): return "hi"

if name == "main": app.start(host="0.0.0.0", port=22)



### Your operating system

Linux

### Your Python version (`python --version`)

3.12

### Your Robyn version

main branch

### Additional Info

PS: I am working on this.
sansyrox commented 2 weeks ago

@VishnuSanal why do you want to use it on a reserved port?

VishnuSanal commented 2 weeks ago

@VishnuSanal why do you want to use it on a reserved port?

@sansyrox I don't want to use it in a reserved port! but, shouldn't the error be handled gracefully?

sansyrox commented 2 weeks ago

I don't think this should be a major issue. Does it work when you use sudo?

sansyrox commented 2 weeks ago

Not an issue. Will work with sudo . This is the expected behaviour.

sansyrox commented 2 weeks ago

Can discuss further if you have any questions @VishnuSanal 😄