How to fix "listen EACCES: permission denied 0.0.0.0:8000" - quasar-framework

I tried to explore Quasar Framework. I download node.js and quasar.cli already. i managed to create project, but when i "quasar dev" in my quasar file, it pop up the errors.
C:\Users\User>cd njir
C:\Users\User\njir>quasar dev
Dev mode.......... spa
Pkg quasar........ v1.2.2
Pkg #quasar/app... v1.2.1
Debugging......... enabled
app:quasar-conf Reading quasar.conf.js +0ms
app:dev Checking listening address availability (0.0.0.0:8080)... +25ms
app:dev ⚠️ Unknown network error occurred +0ms
{ [ Error: listen EACCES: permission denied 0.0.0.0:8080
next_tick.js:63 process._tickCallback
internal/process/next_tick.js:63:19
loader.js:834 Function.Module.runMain
internal/modules/cjs/loader.js:834:11
node.js:283 startup
internal/bootstrap/node.js:283:19
node.js:622 bootstrapNodeJSCore
internal/bootstrap/node.js:622:3
]
code: 'EACCES',
errno: 'EACCES',
syscall: 'listen',
address: '0.0.0.0',
port: 8080 }
C:\Users\User\njir>

Windows users should follow these steps:
Ensure that PowerShell is running as an administrator.
Use the following command to stop winnat:
net stop winnat
Use the following command to restart winnat:
net start winnat

I recently had this error and it resolved when I restarted my machine.
If that doesn't work for you I would try port 80 as a quick check to see if it is a problem with a closed port. Port 80 is for HTTP so it should be open.
quasar dev -p 80
If that works, then port 8080 might not be setup to run your local server.
To check port availability I use nmap (https://nmap.org/). If you install it and want to check a port from the command line run something like:
nmap localhost -p 8080

Port 8080 was not available in network , issue could be resolved by updating dev property in quasar.config.js
devServer: {
// https: true,
//port: 8080,
open: true // opens browser window automatically
},
Uncomment port and change the default port number, for e.g. port: 8089

Restarting my computer helped me solve this problem.

Related

How to remove port number from URL when running npm start?

I'm working on a create-react-app and I want to remove the port number from the URL that gets created when I run npm start in my api. Right now, my start scripts contains this:
"start": "json-server --host https://my-json-server.typicode.com/vbrambila2/1RM"
This is the URL I want my api tp run on. But when I run npm start, it gets initiated as:
https://my-json-server.typicode.com/vbrambila2/1RM:3000
I also get this error in my terminal:
Resources
http://https://my-json-server.typicode.com/vbrambila2/1RM:3000/movements
Home
http://https://my-json-server.typicode.com/vbrambila2/1RM:3000
Some error occurred Error: getaddrinfo ENOTFOUND https://my-json-server.typicode.com/vbrambila2/1RM
at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:69:26) {
errno: -3008,
code: 'ENOTFOUND',
syscall: 'getaddrinfo',
hostname: 'https://my-json-server.typicode.com/vbrambila2/1RM'
Does anyone know how I can get it to start as just the URL I provided and not add the :3000?
Any HTTP URL without the port specified implicitly specifies port 80 (HTTP) or port 443 (HTTPS). Eg.
http://example.com => http://example.com:80
https://example.com => https://example.com:443
To avoid typing in the port number, you should serve your content on port 443 (since you are using HTTPS). You haven't told us what framework you are using to host your server, but typically the CLI options for setting ports is either '-p' or '--port', although you should read the documentation page for your framework first.
Edit:
Based on your tags, I'm inferring that you're using json-server in which case, adding -p 443 to your start command should set the port appropriately.
On your .env file you must add HTTPS=true and PORT=443

Docker - eclipse-mosquitto:2.0.7 Error: Address not available

I'm trying to run mosquitto as docker container in windows 10. Getting below error log Address not available.
1614449526: mosquitto version 2.0.7 starting
1614449526: Config loaded from /mosquitto/config/mosquitto.conf.
1614449526: Starting in local only mode. Connections will only be possible from clients running on this machine.
1614449526: Create a configuration file which defines a listener to allow remote access.
1614449526: Opening ipv4 listen socket on port 1883.
1614449526: Opening ipv6 listen socket on port 1883.
**1614449526: Error: Address not available**
1614449526: mosquitto version 2.0.7 running
Could anyone advise how to solve this error?
Thank you.
I'd the same issue.
My solution was:
Enter to mosquitto container item from portainer.io. then you must loggin by console in mosquitto's container. Select command : /bin/sh for loggin...
Once into command line must to adjust the mosquitto.conf located in : /mosquitto/config
Must change the following parameters: Uncomment and fixed
listener 1883
persistence true
allow_anonymous true
later, exit from command console and restart mosquitto container...and ready !!
check logs!
Hope to help!
i followed Stéphane Trottier's suggestion but ran into issues b/c of the port and an outdated config change:
allow_anonymous true
listener 2883
protocol mqtt
i also used port 2883 instead since it seems 8883 is for tls so i was getting connection refused errors on the client and protocol errors on the server. my docker compose looks like this:
mqtt:
image: eclipse-mosquitto:latest
volumes:
- ./mqtt/config:/mosquitto/config
user: "1000:1000"
ports:
- 1883:2883
I had the same issue yesterday... Generally, some OSs require more permissions to run services on ports lower than 2000. This is how I made it work for me. I'm just running this for a hobby project. For work I would do things differently.
added local mosquitto folder and placed mosquitto.conf file in it.
added allow_anonymous true
changed port to something higher than 2000.
mount local config volume in docker
allow_anonymous true
port 8883
I run it via docker compose file.
version: '3.1'
services:
mosquitto:
image: eclipse-mosquitto
hostname: mosquitto
container_name: mosquitto
ports:
- "8883:8883"
volumes:
- ./mosquitto:/mosquitto/config
networks:
- webnet
networks:
webnet:
The error is gone from my logs and I can connect to it just fine on that port.
1614505908: The 'port' option is now deprecated and will be removed in a future version. Please use 'listener' instead.
1614505908: mosquitto version 2.0.7 starting
1614505908: Config loaded from /mosquitto/config/mosquitto.conf.
1614505908: Opening ipv4 listen socket on port 8883.
1614505908: Opening ipv6 listen socket on port 8883.
1614505908: mosquitto version 2.0.7 running
looks like I'll have to replace port with listener at some point soon.
both azegurelabs and Stéphane Trottier answers worked for me.
but the easier and more accurate solution is to just run image with default provided conf
docker run -it --rm --name mosquitto -p 1883:1883 eclipse-mosquitto:2.0 mosquitto -c /mosquitto-no-auth.conf
or to run image with your config file
docker run -it -p 1883:1883 -v <absolute-path-to-configuration-file>:/mosquitto/config/mosquitto.conf eclipse-mosquitto:<version>
you can read more here: mosquitto docker github page

Issue with getting RubyMine debugger to work with Docker

I'm setting up RubyMine Debugger with Docker but I believe I have an issue with the matching the ports and I can't find documentation that thoroughly explains what the "configuration form in ruby mine is asking for and how to find the related information for the form input fields" all I can find is generic information.
I have had many error messages and even crashing when I click the debugger button. I have tried a lot more then what I'm posting but I never wrote it down. This is just where I am at this current moment
I have followed https://confluence.jetbrains.com/display/RUBYDEV/How+to+setup+and+run+ruby+remote+debug+session
I have added ports to the docker-compose.yml file.
Setup configuration for remote Remote Ruby SDK and Gem.
Setup Ruby remote debug configuration.
I have tried working my way through every error but I just get more as I go.
This app uses docker-compose and I'm not familiar with it at all other then all the reading I been doing to get this debugger setup
docker-compose.yml file
app:
build: wffffffe_api
dockerfile: Dockerfile-development
command: rails server --port 3000 --binding 0.0.0.0
stdin_open: true
tty: true
ports:
- "3000:3000"
- "1234:1234"
- "26162:26162"
volumes:
- './wfffffe_api:/var/www/weffffffe_api'
- './dotfiles/.vimrc-basic:/root/.vimrc'
The debugger configuration
Remote host: 0.0.0.0
Remote port: 3000
Remote root folder: /var/www/wffffffe_api
local port: 26162
local root folder: /Users/josh/Work/wffffffe_api
I have tried doing
docker-compose exec app rdebug-ide --host 0.0.0.0 --port 3000 --dispatcher-port 26162 -- bin/rails server
If the docker container is already running I get:
Fatal exception in DebugThread loop:
Address already in use - bind(2) for "0.0.0.0" port 3000
If the docker container is not already running I get:
Fast Debugger (ruby-debug-ide 0.6.1, debase 0.2.2, file filtering is supported) listens on 0.0.0.0:3000
I then do docker-compose up --build -d
ERROR: for app Cannot start service app: b'driver failed programming external connectivity on endpoint work_app_1 (1e830daaecd39fab784b817a03893b592635542a8dfe3de69859c0ba7d39b483): Error starting userland proxy: Bind for 0.0.0.0:3000 failed: port is already allocated'
Do I need to have two separate servers running?
Your problem is that you are trying to debug on port 3000, which already bound by your rails application.
The --port of rdebug-ide specify the port that RubyMine will use for its debug protocol.
When you execute rails server --port 3000 --binding 0.0.0.0, you are binding port 3000 as your rails application (and not as debug port).
Change your remote port debug to 1234 (which you already exposed in your docker-compose.yml) and it should work.
To summarise, your command should look like:
docker-compose exec app rdebug-ide --host 0.0.0.0 --port 1234 --dispatcher-port 26162 -- bin/rails server --port 3000 --binding 0.0.0.0

VirtualBox port forwarding preventing port binding on host

I have a NodeJS server running within a Docker container. I'm using Docker Toolbox for this, therefore I have a VirtualBox VM that I'm running my container in. My server needs to use a dgram websocket to bind to 0.0.0.0:3000 on the host and listen for data packets there, so I set up port forwarding from 3000->3000 in VirtualBox.
The problem is, when I try and run the applications on the host that are supposed to be publishing data to port 3000, they are not able to bind to the port.
The error I get is:
{ Error: bind EACCES 0.0.0.0:3000
at Object.exports._errnoException (util.js:1020:11)
at exports._exceptionWithHostPort (util.js:1043:20)
at _handle.lookup (dgram.js:219:18)
at _combinedTickCallback (internal/process/next_tick.js:83:11)
at process._tickCallback (internal/process/next_tick.js:104:9)
at Module.runMain (module.js:606:11)
at run (bootstrap_node.js:389:7)
at startup (bootstrap_node.js:149:9)
at bootstrap_node.js:504:3
code: 'EACCES',
errno: 'EACCES',
syscall: 'bind',
address: '0.0.0.0',
port: 3000 }
If I shut down the VM and run my server outside of the container everything works fine.
I have my server set up so that it does not have exclusive binding set and reuseAddr is set to true when the websocket is created. This is why when I run it outside of the container there are no binding problems.
My question is: does port forwarding in VirtualBox do some sort of exclusive binding on the forwarded port? If so, can this be disabled? How can I run my server in a container if this happens?
UPDATE:
I have discovered this only happens when I set VirtualBox to use UDP forwarding. TCP does not cause the issue. Is there any way to do UDP port forwarding and still be able to do port binding?

composer-playground is throwing error

I followed the steps given in the link:
https://hyperledger.github.io/composer/installing/development-tools.html
when i executed the command "composer-playground" i am getting the below error
events.js:183
throw er; // Unhandled 'error' event
Error: listen EADDRINUSE :::8080
Please note i have closed all the browsers before running this command.
Thanks,
Smitha
You have another server on your machine listening in port 8080. You can start playground on a different port using the -p or --port option. For example composer-playground -p 8090 will start composer playground listening on port 8090. You then will need to specify that port on the url in your browser, for example http://localhost:8090

Resources