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

Proxy can't be installed properly #158

Open
hamedSHF opened this issue Feb 12, 2023 · 11 comments
Open

Proxy can't be installed properly #158

hamedSHF opened this issue Feb 12, 2023 · 11 comments

Comments

@hamedSHF
Copy link

Hi
I tried to install whatsapp proxy on my vps but i couldn't.
My vps includes apache and nginx webservers and i installed Debian 11 along with hestia panel on it.
I did steps below :

I executed last command
docker run -it -p 80:80 -p 443:443 -p 5222:5222 -p 8080:8080 -p 8443:8443 -p 8222:8222 -p 8199:8199 whatsapp_proxy:1.0
and i got this error
"docker: Error response from daemon: driver failed programming external connectivity on endpoint blissful_bell (09046329ee9a28cdc4a5919a23e851bdcee9b96d794484555a7c485a500b4d39): Error starting userland proxy: listen tcp4 0.0.0.0:8443: bind: address already in use."

also for ports 8080,443 and 80 this message was showed

so i changed my server's ports to 2803,2804,2805 and 2806 and i ran following command
docker run -it -p 2806:80 -p 2805:443 -p 5222:5222 -p 2804:8080 -p 2803:8443 -p 8222:8222 -p 8199:8199 whatsapp_proxy:1.0

then another error arised :
"[ALERT] (25) : Binding [/usr/local/etc/haproxy/haproxy.cfg:60] for frontend haproxy_v4_http: cannot bind socket (Permission denied) for [0.0.0.0:80]
[ALERT] (25) : Binding [/usr/local/etc/haproxy/haproxy.cfg:69] for frontend haproxy_v4_https: cannot bind socket (Permission denied) for [0.0.0.0:443]
[ALERT] (25) : [haproxy.main()] Some protocols failed to start their listeners! Exiting."

To solve the problem above i tried several solutions but non of them worked :

  1. I cleaned cloned repository and all docker images and containers then i did all steps in order again
  2. I changed my server's OS to ubuntu 18.0.4 but nothing solved.
  3. For the last solution i tried Running as the haproxy user in 2.4 leaved haproxy unable to start - cannot bind socket (Permission denied) [0.0.0.0:80] docker-library/haproxy#160 and i ran command below:

docker run -it -p 2806:80 -p 2805:443 -p 5222:5222 -p 2804:8080 -p 2803:8443 -p 8222:8222 -p 8199:8199 --sysctl net.ipv4.ip_unprivileged_port_start=0 whatsapp_proxy:1.0

then i faced another error :
docker: Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: open /proc/sys/net/ipv4/ip_unprivileged_port_start: no such file or directory: unknown.

How can i fix it?

@Vahid22h
Copy link

Hi I tried to install whatsapp proxy on my vps but i couldn't. My vps includes apache and nginx webservers and i installed Debian 11 along with hestia panel on it. I did steps below :

I executed last command docker run -it -p 80:80 -p 443:443 -p 5222:5222 -p 8080:8080 -p 8443:8443 -p 8222:8222 -p 8199:8199 whatsapp_proxy:1.0 and i got this error "docker: Error response from daemon: driver failed programming external connectivity on endpoint blissful_bell (09046329ee9a28cdc4a5919a23e851bdcee9b96d794484555a7c485a500b4d39): Error starting userland proxy: listen tcp4 0.0.0.0:8443: bind: address already in use."

also for ports 8080,443 and 80 this message was showed

so i changed my server's ports to 2803,2804,2805 and 2806 and i ran following command docker run -it -p 2806:80 -p 2805:443 -p 5222:5222 -p 2804:8080 -p 2803:8443 -p 8222:8222 -p 8199:8199 whatsapp_proxy:1.0

then another error arised : "[ALERT] (25) : Binding [/usr/local/etc/haproxy/haproxy.cfg:60] for frontend haproxy_v4_http: cannot bind socket (Permission denied) for [0.0.0.0:80] [ALERT] (25) : Binding [/usr/local/etc/haproxy/haproxy.cfg:69] for frontend haproxy_v4_https: cannot bind socket (Permission denied) for [0.0.0.0:443] [ALERT] (25) : [haproxy.main()] Some protocols failed to start their listeners! Exiting."

To solve the problem above i tried several solutions but non of them worked :

  1. I cleaned cloned repository and all docker images and containers then i did all steps in order again
  2. I changed my server's OS to ubuntu 18.0.4 but nothing solved.
  3. For the last solution i tried Running as the haproxy user in 2.4 leaved haproxy unable to start - cannot bind socket (Permission denied) [0.0.0.0:80] docker-library/haproxy#160 and i ran command below:

docker run -it -p 2806:80 -p 2805:443 -p 5222:5222 -p 2804:8080 -p 2803:8443 -p 8222:8222 -p 8199:8199 --sysctl net.ipv4.ip_unprivileged_port_start=0 whatsapp_proxy:1.0

then i faced another error : docker: Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: open /proc/sys/net/ipv4/ip_unprivileged_port_start: no such file or directory: unknown.

How can i fix it?

@aria1991
Copy link
Contributor

Hi @hamed-sharafdoost . The latest error is related to the missing file or directory /proc/sys/net/ipv4/ip_unprivileged_port_start. To fix this, you could try setting the sysctl value to 1 instead of 0. You can run the command:

docker run -it -p 2806:80 -p 2805:443 -p 5222:5222 -p 2804:8080 -p 2803:8443 -p 8222:8222 -p 8199:8199 --sysctl net.ipv4.ip_unprivileged_port_start=1 whatsapp_proxy:1.0

This should allow the container to start successfully.

@hamedSHF
Copy link
Author

Thanks @aria1991 but it doesn't work unfortunately.
Same error is showed :

docker: Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: open /proc/sys/net/ipv4/ip_unprivileged_port_start: no such file or directory: unknown.

@aria1991
Copy link
Contributor

@hamed-sharafdoost No worries. hmm, let's try sth else. Could you please verify whether the file system is mounted on your machine? mount | grep proc. In case it is not , do sudo mount -t proc proc /proc ( I assume you have root access)

Then could you please check the output of the command sysctl net.ipv4.ip_unprivileged_port_start ? If it is not do sudo sysctl -w net.ipv4.ip_unprivileged_port_start=1. I hope it would fix your issue , if not try sudo service docker restart after applying those changes. Let me know if you were able to solve the issue.

@hamedSHF
Copy link
Author

Output of mount | grep proc is :

proc on /proc type proc (rw,relatime,hidepid=2)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=29,pipe_ino=3288410318,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=3288410318)

None of these commands didn't work :

  1. sysctl net.ipv4.ip_unprivileged_port_start
  2. sudo sysctl -w net.ipv4.ip_unprivileged_port_start=1

We have the same errors again :

sysctl: cannot stat /proc/sys/net/ipv4/ip_unprivileged_port_start: No such file or directory

I tried sudo service docker restart and did all previous steps but nothing changed.

@aria1991
Copy link
Contributor

@hamed-sharafdoost. Could you tell me what is the output of ls /proc/sys/net/ipv4/ ?

@hamedSHF
Copy link
Author

@aria1991
Ouput of ls /proc/sys/net/ipv4/ :

  1. conf
  2. ip_forward
  3. tcp_fastopen
  4. fwmark_reflect
  5. ip_forward_use_pmtu
  6. tcp_keepalive_intvl
  7. icmp_echo_ignore_all
  8. ip_local_port_range
  9. tcp_keepalive_probes
  10. icmp_echo_ignore_broadcasts
  11. ip_no_pmtu_disc
  12. tcp_keepalive_time
  13. icmp_errors_use_inbound_ifaddr
  14. ip_nonlocal_bind
  15. tcp_mem
  16. icmp_ignore_bogus_error_responses
  17. neigh
  18. tcp_min_snd_mss
  19. icmp_ratelimit
  20. ping_group_range
  21. vs
  22. icmp_ratemask
  23. route
  24. xfrm4_gc_thresh
  25. ip_default_ttl
  26. tcp_ecn

@aria1991
Copy link
Contributor

aria1991 commented Feb 23, 2023

@hamed-sharafdoost Seems you don't have ip_unprivileged_port_start file. So let's make it manually by executing the command below:

sudo sh -c 'echo "1024" > /proc/sys/net/ipv4/ip_unprivileged_port_start'

This will set the starting port number to 1024, which is the default value for most Linux systems. You can change this value to any other port number that you prefer. After setting this parameter, you may need to restart any services that rely on it, such as Docker or other network-related applications, for the changes to take effect.

@hamedSHF
Copy link
Author

Sorry for late reply @aria1991
That's unbelievable.I faced another error and i was struggling to fix it but i could not.

Here is :

sh: 1: cannot create /proc/sys/net/ipv4/ip_unprivileged_port_start: Directory nonexistent

Also i used cat and touch commands but i can't even create a simple txt file.
May it relates to my vps configuration?

@aria1991
Copy link
Contributor

@hamed-sharafdoost if you have root access, and you are not able to do that, it's better to contact your VPS provider

@iceicerickert
Copy link

on synology NAS there is an older Kernel version installed. I cannot get it working either

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

4 participants