Streamlit run NTUT-AutoML-v1.1.py --server.port 443 => Permission denied

streamlit run NTUT-AutoML-v1.1.py --server.port 443

I was trying to use port 443, but get error: Permission denied. Please help! (Running in AWS EC2: Window Server 2019 with ubuntu installed. Which means I ran ubuntu inside Windows Server)

(autosklearn) ntut@EC2AMAZ-CMJJ1M4:~$ streamlit run NTUT-AutoML-v1.1.py --server.port 443
Traceback (most recent call last):
  File "/home/ntut/anaconda3/envs/autosklearn/bin/streamlit", line 8, in <module>
    sys.exit(main())
  File "/home/ntut/anaconda3/envs/autosklearn/lib/python3.7/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/ntut/anaconda3/envs/autosklearn/lib/python3.7/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/ntut/anaconda3/envs/autosklearn/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/ntut/anaconda3/envs/autosklearn/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/ntut/anaconda3/envs/autosklearn/lib/python3.7/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/ntut/anaconda3/envs/autosklearn/lib/python3.7/site-packages/streamlit/cli.py", line 228, in main_run
    _main_run(target, args)
  File "/home/ntut/anaconda3/envs/autosklearn/lib/python3.7/site-packages/streamlit/cli.py", line 256, in _main_run
    bootstrap.run(file, command_line, args)
  File "/home/ntut/anaconda3/envs/autosklearn/lib/python3.7/site-packages/streamlit/bootstrap.py", line 254, in run
    server.start(_on_server_start)
  File "/home/ntut/anaconda3/envs/autosklearn/lib/python3.7/site-packages/streamlit/server/server.py", line 301, in start
    start_listening(app)
  File "/home/ntut/anaconda3/envs/autosklearn/lib/python3.7/site-packages/streamlit/server/server.py", line 145, in start_listening
    start_listening_tcp_socket(http_server)
  File "/home/ntut/anaconda3/envs/autosklearn/lib/python3.7/site-packages/streamlit/server/server.py", line 164, in start_listening_tcp_socket
    http_server.listen(port, address)
  File "/home/ntut/anaconda3/envs/autosklearn/lib/python3.7/site-packages/tornado/tcpserver.py", line 151, in listen
    sockets = bind_sockets(port, address=address)
  File "/home/ntut/anaconda3/envs/autosklearn/lib/python3.7/site-packages/tornado/netutil.py", line 174, in bind_sockets
    sock.bind(sockaddr)
PermissionError: [Errno 13] Permission denied

Hi @Steve_Chen -

If I’m understanding this correctly, you are running Streamlit from a Windows Server, which itself is running Ubuntu from Windows Subsystem for Linux? If so, I suspect the issue here is that you aren’t able to bind to port 443 because something else is already attached to that port.

Have you tried running from other ports to debug whether you can run a Streamlit app from that configuration at all?

Best,
Randy

Thank you so much for the reply.

Yes, I am running ubuntu in Windows server 2019.

Have you tried running from other ports to debug whether you can run a Streamlit app from that configuration at all?
Yes, I have tried other ports which worked fine, except port 443 and 80.

I got the Permission denied. Could you show me how to run streamlit with sudo? Thanks a lot!

Please refer Permission denied in ec2 port 80

The reason I gone through these was because the web site I created using Streamlit is insecure! I have launched the web site but no one was willing to test because of it (insecure). I need to use https to make it a secure web site. Am I on the right track?
-Steve-

Let’s take a step back, so that we can be sure we’re solving for your specific case. Some questions:

  1. Do you have to use Windows server? Meaning, did this server already exist at work, and you’re trying to work within those constraints?
  2. Does this project need authentication and/or use sensitive data?
  3. Who are the people who won’t use the website because it’s “insecure”? Are you asking people to upload sensitive data?

The reason why I ask these questions is that depending on your answers, you might 1) try Streamlit sharing, 2) use a different EC2 image, 3) not really have an issue that https solves, and any number of other considerations.

One thing I can say while I wait for your answers is that just by putting the app on port 443 doesn’t automatically make it secure, you need an SSL certificate. This functionality is usually handled by using nginx or Apache as a reverse proxy, Streamlit doesn’t specifically include this type of functionality.

How you doing, Randy?

Yes, Streamlit sharing will solve my problem! I need it at this time. And eventually, once I launch the web site, I still need AWS EC2 to host it. You guys are doing a great job. When google purchase your Streamlit, you guys can retire in your early 30.

To answer your questions:

  1. auto-sklearn ONLY supports Linux. That’s why I ran Ubuntu inside the Windows. I don’t own the server. I used AWS EC2.
    2&3 Psychological speaking, when people see the insecure web address, they might just be scared to play with it. Yes, the users will upload the training data for machine learning.

Thank you so much for providing the help. Eventually, I still have figure out how to get https work!

-Steve-

1 Like

If that’s the case, you’ll have a much easier time if you use a Linux image directly, instead of Linux inside Windows.

Thank you so much for the reply.

Yes, Streamlit sharing will solve my problem! I need it at this time. I have already requested an invite to start sharing now! BUT I am still in the queue! Could you have me one more time? Thanks!
-Steve-

I’ll send a message to our internal folks today to get you set up :slight_smile:

I got it work! Thanks!
https://share.streamlit.io/stevessschen/field1/main/NTUT-AutoML-v1.2.py

I got it work, BUT without auto-sklearn==0.10.0

If I add auto-sklearn==0.10.0 to the requirements.txt, I got error: command ‘swig’ failed with exit status 1. Please see attached error.png.

Below is requirements.txt
streamlit==0.66.0
pandas==0.25.3
numpy==1.18.5
scikit-learn==0.22.2.post1
auto-sklearn==0.10.0 => if I take it out, it works!
joblib==0.17.0
keras==2.4.3
matplotlib==3.3.2
h5py==2.10.0
tensorflow==2.3.1

I have tested the codes ( NTUT-AutoML-v1.1.py LSTM_codes.py ) both in colab and ubuntu. It all works fine including auto-sklearn. But not work in Streamlit share!

Thanks once again. You guys are doing a great job.