Giter Club home page Giter Club logo

Comments (9)

qzhuyan avatar qzhuyan commented on July 21, 2024

permission_denied looks like a platform issue.

You could try if another application could bind to port 80.

ncat  -l -p 80
# or with sudo
sudo ncat  -l -p 80

If the above works, ensure emqx runs as user root.

from emqx.

GKRESAUDIO avatar GKRESAUDIO commented on July 21, 2024

after entering the cmd nothing appear and i am running it as sudo ... It work on port 81 but not on 80 ...

from emqx.

ieQu1 avatar ieQu1 commented on July 21, 2024

Is there any other service listening on port 80? This can be checked with sudo netstat -tnlp command.

from emqx.

GKRESAUDIO avatar GKRESAUDIO commented on July 21, 2024

root@remotesystem-mqtt:~# sudo netstat -tnlp
Connexions Internet actives (seulement serveurs)
Proto Recv-Q Send-Q Adresse locale Adresse distante Etat PID/Program name
tcp 0 0 0.0.0.0:8883 0.0.0.0:* LISTEN 21093/emqx
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 430/sshd: /usr/sbin
tcp 0 0 0.0.0.0:1880 0.0.0.0:* LISTEN 21093/emqx
tcp 0 0 0.0.0.0:5370 0.0.0.0:* LISTEN 21093/emqx
tcp 0 0 0.0.0.0:1883 0.0.0.0:* LISTEN 21093/emqx
tcp 0 0 0.0.0.0:4370 0.0.0.0:* LISTEN 21093/emqx
tcp6 0 0 :::22 :::* LISTEN 430/sshd: /usr/sbin

from emqx.

GKRESAUDIO avatar GKRESAUDIO commented on July 21, 2024

It's a fresh debian install and i only install emqx community edition .. no other program ..

from emqx.

ieQu1 avatar ieQu1 commented on July 21, 2024

How exactly are you starting EMQX? Did you make sure that EMQX was stopped before you restarted as root? I can't reproduce this problem when I run sudo emqx console:

sudo bin/emqx console
WARNING: Default (insecure) Erlang cookie is in use.
WARNING: Configure node.cookie in /home/me/Documents/work/emqx/_build/emqx/rel/emqx/etc/emqx.conf or override from environment variable EMQX_NODE__COOKIE
WARNING: NOTE: Use the same cookie for all nodes in the cluster.
Erlang/OTP 25 [erts-13.2.2] [emqx-8639768b7a] [64-bit] [smp:8:8] [ds:8:8:8] [async-threads:4] [jit:ns]

Listener ssl:default on 0.0.0.0:8883 started.
Listener tcp:default on 0.0.0.0:1883 started.
Listener ws:default on 0.0.0.0:8083 started.
Listener wss:default on 0.0.0.0:8084 started.
Listener http:dashboard on :80 started.
EMQX 5.3.2-g7161f9d1 is running now!
Restricted Eshell V13.2.2  (abort with ^G)
v5.3.2-g7161f9d1([email protected])1> 

My guess is that the previous instance of the daemon was running, so restarting it as root didn't take any effect.

On a different note, it's not recommended to run daemons (including EMQX) as root. The simplest workaround is to make port 80 non-priviliged via sysctl net.ipv4.ip_unprivileged_port_start=80 command and run EMQX as emqx user.

from emqx.

GKRESAUDIO avatar GKRESAUDIO commented on July 21, 2024

I just reinstall everything ...

  • Debian 12
  • Emqx
  • sysctl net.ipv4.ip_unprivileged_port_start=80
  • Change dashboard to 80
  • sudo emqx console

And i got this :

root@remotesystem-mqtt:~# sudo emqx console
WARNING: Default (insecure) Erlang cookie is in use.
WARNING: Configure node.cookie in /etc/emqx/emqx.conf or override from environment variable EMQX_NODE__COOKIE
WARNING: NOTE: Use the same cookie for all nodes in the cluster.
Erlang/OTP 25 [erts-13.2.2] [emqx] [64-bit] [smp:1:1] [ds:1:1:8] [async-threads:4] [jit:ns]

Listener ssl:default on 0.0.0.0:8883 started.
Listener tcp:default on 0.0.0.0:1883 started.
Listener ws:default on 0.0.0.0:8083 started.
Listener wss:default on 0.0.0.0:8084 started.
2023-11-26T11:23:27.784077+01:00 [error] Failed to start Ranch listener 'http:dashboard' in ranch_tcp:listen([{cacerts,'...'},{key,'...'},{cert,'...'},inet,{send_timeout,10000},{port,80},{backlog,1024}]) for reason eacces (permission denied)
2023-11-26T11:23:27.784181+01:00 [error] Supervisor: {<0.2812.0>,ranch_listener_sup}. Context: start_error. Reason: {listen_error,'http:dashboard',eacces}. Offender: id=ranch_acceptors_sup,pid=undefined.
2023-11-26T11:23:27.784240+01:00 [error] crasher: initial call: supervisor:ranch_acceptors_sup/1, pid: <0.2814.0>, registered_name: [], exit: {{listen_error,'http:dashboard',eacces},[{ranch_acceptors_sup,listen_error,5,[{file,"ranch_acceptors_sup.erl"},{line,66}]},{supervisor,init,1,[{file,"supervisor.erl"},{line,330}]},{gen_server,init_it,2,[{file,"gen_server.erl"},{line,851}]},{gen_server,init_it,6,[{file,"gen_server.erl"},{line,814}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,240}]}]}, ancestors: [<0.2812.0>,ranch_sup,<0.2468.0>], message_queue_len: 0, messages: [], links: [<0.2812.0>], dictionary: [{logger,error_logger}], trap_exit: true, status: running, heap_size: 1598, stack_size: 28, reductions: 4285; neighbours:
2023-11-26T11:23:27.784564+01:00 [error] msg: started_listener_failed, mfa: minirest:log_start_result/2(105), description: permission_denied, name: 'http:dashboard', port: 80, reason: eacces
2023-11-26T11:23:27.784687+01:00 [error] crasher: initial call: application_master:init/4, pid: <0.2797.0>, registered_name: [], exit: {{['http:dashboard'],{emqx_dashboard_app,start,[normal,[]]}},[{application_master,init,4,[{file,"application_master.erl"},{line,142}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,240}]}]}, ancestors: [<0.2796.0>], message_queue_len: 1, messages: [{'EXIT',<0.2798.0>,normal}], links: [<0.2796.0>,<0.2038.0>], dictionary: [], trap_exit: true, status: running, heap_size: 376, stack_size: 28, reductions: 168; neighbours:
2023-11-26T11:23:27.785481+01:00 [critical] msg: failed_to_start_app, mfa: emqx_machine_boot:start_one_app/1(116), app: emqx_dashboard, reason: {emqx_dashboard,{['http:dashboard'],{emqx_dashboard_app,start,[normal,[]]}}}
2023-11-26T11:23:27.786076+01:00 [error] Supervisor: {local,emqx_machine_sup}. Context: start_error. Reason: {'EXIT',{{failed_to_start_app,emqx_dashboard,{emqx_dashboard,{['http:dashboard'],{emqx_dashboard_app,start,[normal,[]]}}}},[{emqx_machine_boot,start_one_app,1,[{file,"emqx_machine_boot.erl"},{line,117}]},{lists,foreach_1,2,[{file,"lists.erl"},{line,1442}]},{emqx_machine_boot,ensure_apps_started,0,[{file,"emqx_machine_boot.erl"},{line,107}]},{emqx_machine_boot,post_boot,0,[{file,"emqx_machine_boot.erl"},{line,47}]},{supervisor,do_start_child_i,3,[{file,"supervisor.erl"},{line,414}]},{supervisor,do_start_child,2,[{file,"supervisor.erl"},{line,400}]},{supervisor,'-start_children/2-fun-0-',3,[{file,"supervisor.erl"},{line,384}]},{supervisor,children_map,4,[{file,"supervisor.erl"},{line,1250}]},{supervisor,init_children,2,[{file,"supervisor.erl"},{line,350}]},{gen_server,init_it,2,[{file,"gen_server.erl"},{line,851}]},{gen_server,init_it,6,[{file,"gen_server.erl"},{line,814}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,240}]}]}}. Offender: id=emqx_machine_boot,pid=undefined.
2023-11-26T11:23:27.786402+01:00 [error] crasher: initial call: application_master:init/4, pid: <0.2207.0>, registered_name: [], exit: {{{shutdown,{failed_to_start_child,emqx_machine_boot,{'EXIT',{{failed_to_start_app,emqx_dashboard,{emqx_dashboard,{['http:dashboard'],{emqx_dashboard_app,start,[normal,[]]}}}},[{emqx_machine_boot,start_one_app,1,[{file,"emqx_machine_boot.erl"},{line,117}]},{lists,foreach_1,2,[{file,"lists.erl"},{line,1442}]},{emqx_machine_boot,ensure_apps_started,0,[{file,"emqx_machine_boot.erl"},{line,107}]},{emqx_machine_boot,post_boot,0,[{file,"emqx_machine_boot.erl"},{line,47}]},{supervisor,do_start_child_i,3,[{file,"supervisor.erl"},{line,414}]},{supervisor,do_start_child,2,[{file,"supervisor.erl"},{line,400}]},{supervisor,'-start_children/2-fun-0-',3,[{file,"supervisor.erl"},{line,384}]},{supervisor,children_map,4,[{file,"supervisor.erl"},{line,1250}]},{supervisor,init_children,2,[{file,"supervisor.erl"},{line,350}]},{gen_server,init_it,2,[{file,"gen_server.erl"},{line,851}]},{gen_server,init_it,6,[{file,"gen_server.erl"},{line,814}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,240}]}]}}}},{emqx_machine_app,start,[normal,[]]}},[{application_master,init,4,[{file,"application_master.erl"},{line,142}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,240}]}]}, ancestors: [<0.2206.0>], message_queue_len: 1, messages: [{'EXIT',<0.2208.0>,normal}], links: [<0.2206.0>,<0.2038.0>], dictionary: [], trap_exit: true, status: running, heap_size: 610, stack_size: 28, reductions: 213; neighbours:
Listener ssl:default on 0.0.0.0:8883 stopped.
Listener tcp:default on 0.0.0.0:1883 stopped.
Listener ws:default on 0.0.0.0:8083 stopped.
Listener wss:default on 0.0.0.0:8084 stopped.
{"Kernel pid terminated",application_controller,"{application_start_failure,emqx_machine,{{shutdown,{failed_to_start_child,emqx_machine_boot,{'EXIT',{{failed_to_start_app,emqx_dashboard,{emqx_dashboard,{['http:dashboard'],{emqx_dashboard_app,start,[normal,[]]}}}},[{emqx_machine_boot,start_one_app,1,[{file,"emqx_machine_boot.erl"},{line,117}]},{lists,foreach_1,2,[{file,"lists.erl"},{line,1442}]},{emqx_machine_boot,ensure_apps_started,0,[{file,"emqx_machine_boot.erl"},{line,107}]},{emqx_machine_boot,post_boot,0,[{file,"emqx_machine_boot.erl"},{line,47}]},{supervisor,do_start_child_i,3,[{file,"supervisor.erl"},{line,414}]},{supervisor,do_start_child,2,[{file,"supervisor.erl"},{line,400}]},{supervisor,'-start_children/2-fun-0-',3,[{file,"supervisor.erl"},{line,384}]},{supervisor,children_map,4,[{file,"supervisor.erl"},{line,1250}]},{supervisor,init_children,2,[{file,"supervisor.erl"},{line,350}]},{gen_server,init_it,2,[{file,"gen_server.erl"},{line,851}]},{gen_server,init_it,6,[{file,"gen_server.erl"},{line,814}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,240}]}]}}}},{emqx_machine_app,start,[normal,[]]}}}"}
Kernel pid terminated (application_controller) ({application_start_failure,emqx_machine,{{shutdown,{failed_to_start_child,emqx_machine_boot,{'EXIT',{{failed_to_start_app,emqx_dashboard,{emqx_dashboard,{['http:dashboard'],{emqx_dashboard_app,start,[normal,[]]}}}},[{emqx_machine_boot,start_one_app,1,[{file,"emqx_machine_boot.erl"},{line,117}]},{lists,foreach_1,2,[{file,"lists.erl"},{line,1442}]},{emqx_machine_boot,ensure_apps_started,0,[{file,"emqx_machine_boot.erl"},{line,107}]},{emqx_machine_boot,post_boot,0,[{file,"emqx_machine_boot.erl"},{line,47}]},{supervisor,do_start_child_i,3,[{file,"supervisor.erl"},{line,414}]},{supervisor,do_start_child,2,[{file,"supervisor.erl"},{line,400}]},{supervisor,'-start_children/2-fun-0-',3,[{file,"supervisor.erl"},{line,384}]},{supervisor,children_map,4,[{file,"supervisor.erl"},{line,1250}]},{supervisor,init_children,2,[{file,"supervisor.erl"},{line,350}]},{gen_server,init_it,2,[{file,"gen_server.erl"},{line,851}]},{gen_server,init_it,6,[{file,"gen_server.erl"},{line,814}]

from emqx.

GKRESAUDIO avatar GKRESAUDIO commented on July 21, 2024

One solution is to edit /etc/sysctl.conf and add net.ipv4.ip_unprivileged_port_start=80
than reboot ..

from emqx.

ieQu1 avatar ieQu1 commented on July 21, 2024

Yes, if you intend to use ip_unprivileged_port_start workaround, it has to be persisted in /etc/sysctl.conf (it may depend on the distro). Can we consider this issue solved?

from emqx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.