Port 8080 already in use on local server / could not access admin panel page

hello!

i’ve just installed a local server on a rpi zero v2, with the latest server version. it is configured as a stand alone access point, without internet.

when i start the zero, it can not load the admin panel page, however the app can connect to the server. in the server logs it shows this issue:

17:56:19.534 ERROR- Error initializing HTTP API and WebSockets, port 8080
java.net.BindException: Address already in use
        at sun.nio.ch.Net.bind0(Native Method) ~[?:?]
        at sun.nio.ch.Net.bind(Net.java:459) ~[?:?]
        at sun.nio.ch.Net.bind(Net.java:448) ~[?:?]
        at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:227) ~[?:?]
        at io.netty.channel.socket.nio.NioServerSocketChannel.doBind(NioServerSocketChannel.java:134) ~[server-0.41.17.jar:?]
        at io.netty.channel.AbstractChannel$AbstractUnsafe.bind(AbstractChannel.java:562) ~[server-0.41.17.jar:?]
        at io.netty.channel.DefaultChannelPipeline$HeadContext.bind(DefaultChannelPipeline.java:1334) ~[server-0.41.17.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.invokeBind(AbstractChannelHandlerContext.java:506) ~[server-0.41.17.jar:?]
        at io.netty.channel.AbstractChannelHandlerContext.bind(AbstractChannelHandlerContext.java:491) ~[server-0.41.17.jar:?]
        at io.netty.channel.DefaultChannelPipeline.bind(DefaultChannelPipeline.java:973) ~[server-0.41.17.jar:?]
        at io.netty.channel.AbstractChannel.bind(AbstractChannel.java:260) ~[server-0.41.17.jar:?]
        at io.netty.bootstrap.AbstractBootstrap$2.run(AbstractBootstrap.java:356) ~[server-0.41.17.jar:?]
        at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164) ~[server-0.41.17.jar:?]
        at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472) ~[server-0.41.17.jar:?]
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500) ~[server-0.41.17.jar:?]
        at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989) ~[server-0.41.17.jar:?]
        at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[server-0.41.17.jar:?]
        at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[server-0.41.17.jar:?]
        at java.lang.Thread.run(Thread.java:829) [?:?]

so, i changed the port just for testing to 8081 in server.properties, but still not working. can someone please help?

should i investigate what uses the 8080 port (how?), or just use another (which one)? i have very limited linux knowledge.

Are you sure that the server isn’t already running, and that launching a second instance isn’t what’s causing this error message?

Also, changes to server.properties aren’t applied until you stop and start the server.

Pete.

yes, you’re right. it is already running, what can be the problem in not opening the control panel?

from the app i can connect…

A bit of light reading for you…

My guess is that it’s to do with the password for the user. The first link is a bit long, but it gets there in the end with a good explanation of why this was happening. Have a quick skim through it and see if what you’re seeing in your browser is the same.

Pete.

i read them. for me the problem is, that it does not loads at all the admin page:

so, for sure is not the password.

192.168.4.1 is a strange IP address. It’s normally the IP of an ESP’s captive portal.

Is it the IP that it showed in the console when the server started?

Also, have you tried from a laptop running Chrome? You’ll normally get a securit6warning and have to say that yes, you really really do want to visit that page. It may be Thayer your mobile browser is making the decision for you that you don’t want to go there.

Pete.

Log on to your RPI and run netstat -plnt.

@PeteKnight
yes, i have tried on laptop. exactly the same result.

i followed this tutorial to set up the access point, and they used this ip:

i can access the rpi through ssh with putty using this ip address, both from laptop and phone. also, from the blynk app i can access the server with the above ip address, so i assume it is correct.

i will try to investigate with the netstat command, thanks @distans

1 Like

Personally, I’d try logging-in through the native IP address of the device (https://10.10.0.2:9443/admin in the example from your link).

Also, does your server.properties contain a line that says allowed.administrator.ips=0.0.0.0/0 ?

You’ll need to add a sudo to the front of that command to see details of processes that you don’t own…

sudo netstat -plnt

Also, it might be worth taking a look at this:

Pete.

Doh!

Just realised that I’ve told you to take a look at your own tutorial!!

:crazy_face:

Pete.

2 Likes

yep, unfortunately that tutorial is quite old and lots of things changed since then. the adafruit article was top, but nowadays is deprecated, not possible to follow the steps. this is why i choose a different method, which is more simple by the way.

im not sure what do you mean by native ip address, the zero w does not have ethernet port, only wifi.

the allowed admin ips are correct in server properties.

in the netstat command it shows all blynk ports are listening on the same java process, so i guess the blynk server works correctly. maybe some config file is broken in the os, because first i tried to ser up the access point with the old adafruit tutorial, and that didn’t worked.

i think i will format the sd card and begin from scartch. i already lost too much time with debug, and no luck :frowning:

btw, @PeteKnight , are you in spain next weeks? currently i’m in portugal and heading to spain…

Okay, so you aren’t setting-up a routed wireless access point, as descried in the documentation that you linked to…

                                         +- RPi -------+
                                     +---+ 10.10.0.2   |          +- Laptop ----+
                                     |   |     WLAN AP +-)))  (((-+ WLAN Client |
                                     |   | 192.168.4.1 |          | 192.168.4.2 |
                                     |   +-------------+          +-------------+
                 +- Router ----+     |
                 | Firewall    |     |   +- PC#2 ------+
(Internet)---WAN-+ DHCP server +-LAN-+---+ 10.10.0.3   |
                 |   10.10.0.1 |     |   +-------------+
                 +-------------+     |
                                     |   +- PC#1 ------+
                                     +---+ 10.10.0.4   |
                                         +-------------+

We’ll be in Spain from 11th May for about 1 month. Will you be there then?

Pete.

only partially. i need a standalone (offline) blynk server, without internet. so i followed the steps in the tutorial, skipping the ethernet part.

unfortunately, i will be only in first half of april in spain.

1 Like

hi!

after a clean install it works ok. thanks for the tips and tricks :wink:

2 Likes