Port 8080 not reachable

  • Platform information:
    • Hardware: CPUArchitecture/RAM/storage
    • OS: what OS is used and which version
    • Java Runtime Environment: which java platform is used and what version
    • openHAB version:
  • Issue of the topic: please be detailed explaining your issue
  • Please post configurations (if applicable):
    • Items configuration related to the issue
    • Sitemap configuration related to the issue
    • Rules code related to the issue
    • Services configuration related to the issue
  • If logs where generated please post these here using code fences:
##        Ip = 192.168.2.215
##   Release = Raspbian GNU/Linux 10 (buster)
##    Kernel = Linux 4.19.118-v7l+
##  Platform = Raspberry Pi 4 Model B Rev 1.1
##    Uptime = 0 day(s). 1:46:18
## CPU Usage = 0.25% avg over 4 cpu(s) (4 core(s) x 1 socket(s))
##  CPU Load = 1m: 0.08, 5m: 0.05, 15m: 0.01
##    Memory = Free: 3.34GB (87%), Used: 0.51GB (13%), Total: 3.86GB
##      Swap = Free: 0.09GB (100%), Used: 0.00GB (0%), Total: 0.09GB
##      Root = Free: 10.67GB (77%), Used: 3.04GB (23%), Total: 14.32GB
##   Updates = 0 apt updates available.
##  Sessions = 1 session(s)
## Processes = 115 running processes of 32768 maximum processes```
openHab2 2.5.6-

Hi,
To tackle some problems with openweathermap I cleared the cache after a shutdown, as suggested in some posts. On reboot I get the remark "run systemctl daemon-reload". Done, but after reboot the web interface at port 8080 is not reachable. Ports 22, 139 and 445 work fine. 
I read topics that seemed related, but I can not find a solution. I am new to Linux and openhabian, which does not help.. I am using demo setup.
I notice that the last entries in the openhablog are all of this kind:
```2020-07-06 21:12:21.465 [WARN ] [it.internal.HomekitAccessoryRegistry] - trying to remove org.openhab.io.homekit.internal.accessories.HomekitWindowCoveringImpl@148965e but bridge is null```

Should I start all over or is there a better way?

Thanks in advance,

Jan.

If port 8080 is not reachable that simply means that openhab is not starting up when you boot. This is further supported by the log line you posted:

This is part of OH cleaning up during the last time you shut it down and there has been no other activity since then (i.e., no attempts to re-start OH).

I don’t know why you were directed to run systemctl at reboot, but this is at the heart of the matter. When you cleared the cache, it appears, that something else happened to the openhab .service file that lets linux control when and how to automatically start OH, including during the system starting up.

I don’t use openhabian so someone more familiar with that structure may have to correct me, but the name of the service should be openhab2 so if you run

systemctl start openhab2.service

this should start up OH for you and fix your short-term problem.

It will not fix the problem about OH not starting on boot in the first place. To check what is going on with that, run

systemctl list-unit-files | grep openhab

This should give you a result that looks something like this:

openhab2.service enabled

If it says disabled instead (as I suspect it will), then you need to run:

systemctl enable openhab2.service

That should set openhab to startup when you boot again.

Hi Justin,

Thanks sofar.

systemctl start openhab2.service returned:

Warning: The unit file, source configuration file or drop-ins of openhab2.service changed on disk. Run 'systemctl daemon-reload' to reload units.

systemctl list-unit-files | grep openhab returned:

srv-openhab2\x2daddons.mount           enabled
srv-openhab2\x2dconf.mount             enabled
srv-openhab2\x2dlogs.mount             enabled
srv-openhab2\x2dsys.mount              enabled
srv-openhab2\x2duserdata.mount         enabled
openhab2.service                       enabled```

I tried to run systemctl daemon-reload before, but that does not give any response, just returns the commandline after half a second.

Jan.

That is the correct behavior for daemon-reload, so no worries there.

This is a little more surprising. Again, I don’t run openhabian and I’m not on a pi, so maybe this is not unusual behavior, but I can’t see any normal reason why there should be any change to the service file or its component just from a cleared cache.

How did you clear the cache?

Also, if you run systemctl daemon-reload followed immediately by systemctl start openhab2.service what result do you get?

This is how I cleared the cache:
sudo systemctl stop openhab2
sudo openhab-cli clean-cache
sudo systemctl start openhab2 or sudo reboot

the commands you mention do not return anything…

[21:53:46] openhabian@openhab:~$ sudo systemctl daemon-reload
[sudo] password for openhabian:
[21:54:17] openhabian@openhab:~$ sudo systemctl start openhab2.service
[21:55:12] openhabian@openhab:~$

I found this topic:

I can not conclude anything from it, but maybe you can.

Thanks, Jan.

Well, that’s a good sign. Neither of those commands should return anything. Did you check to see if OH is now running?

If it is not running can you post the output from:
sudo systemctl status openhab2.service

No, not running.

22:28:51] openhabian@openhab:~$ sudo systemctl status openhab2.service
[sudo] password for openhabian:
● openhab2.service - openHAB 2 - empowering the smart home
Loaded: loaded (/usr/lib/systemd/system/openhab2.service; enabled; vendor preset: enabled)
Drop-In: /etc/systemd/system/openhab2.service.d
└─override.conf
Active: active (running) since Tue 2020-07-07 21:28:18 CEST; 1h 1min ago
Docs: https://www.openhab.org/docs/
https://community.openhab.org
Main PID: 560 (java)
Tasks: 35 (limit: 4915)
Memory: 188.6M
CGroup: /system.slice/openhab2.service
└─560 /usr/bin/java -Dopenhab.home=/usr/share/openhab2 -Dopenhab.conf=/etc/openhab2 -Dopenhab.runtime=/usr/share/openhab2/runtime -Dopenhab.userdata=/var/lib/openhab2 -Dopenhab.logdir=/var/log/openhab2 -Dfelix.cm.dir=/var/lib/

Jul 07 10:10:38 openhab systemd[1]: Starting openHAB 2 - empowering the smart home…
Jul 07 21:28:18 openhab systemd[1]: Started openHAB 2 - empowering the smart home.
lines 1-15/15 (END)

This tells you that the OH process is, in fact, now running. If you still can’t reach port 8080, then there’s something else going on.

Can you access the console (see below if you haven’t done this before)?

like this?
pw: habopen

[23:14:10] openhabian@openhab:~$ sudo ssh -p 8101 openhab@localhost
[sudo] password for openhabian:
Sorry, try again.
[sudo] password for openhabian:

Yes like that, but in this case without the sudo, just

ssh -p 8101 openhab@localhost.

The inclusion of sudo in your command is why the habopen password isn’t working for you.

[23:32:15] openhabian@openhab:~$ ssh -p 8101 openhab@localhost
ssh: connect to host localhost port 8101: Connection refused

That’s ominous.

If you’ve got a recent OH backup, then reinstalling and and restoring the backup maybe faster at this point than troubleshooting the rest of the issues. But before going that route, I would try just simply restarting OH a few times. Sometimes after clearing the cache it takes 2 or more restarts before the system stabilizes again. If you look at the the status output that you posted, the last time you started it up it took several hours before OH reported a successful start:

Although several hours is extreme (and probably not a good sign) when the cache has been cleared it is not uncommon for OH to take a little while to restart as it rebuilds some of what it needs and because of this process not everything gets added back in on the first try. So run

sudo systemctl restart openhab2.servce

and then check its status occasionally with

sudo systemctl status openhab2.servce

When it gives you the line at the bottom of the status report that says “Started openHAB2” then check your web portal to see if it is responding again. Repeat one more time if necessary, but if after 2 restarts you’re still not getting anything, the clean reinstall may be your best bet.

Hi Justin, It does not restart the webpage.
So a reinstall will be necessary.
I am not sure if I have the courage. The learning curve is too steep for me, not being acqainted to Linux and all Openhab peculiarities.
I just tried to get a proper openweathermap binding either with weather1 binding or openweathermap binding, starting from the demo setup, just to get an indicator of the outside temperature. It seemed an appropriate step 1 for me, but instead: complete failure, despite reading a lot of docs and q&a’s .
So I guess for me other options for getting a smart home might be more efficient. and rewarding.
Thanks a lot for your help.
Do you actually have a solid home automation setup with openhab running?
Regards, Jan.

I first encountered openhab probably 5 or so years ago and, like you, just tried it as a brief experiment but decided that the few devices that I had didn’t warrant what appeared to be the steep entry requirements. I had the advantage that I had been working with linux systems for many years at that point, but the extensive manual configuration that was still required (and more documentation in French than in English at the time if I recall) at that point was more than I wanted to get into at the time. A few years later with more smart devices in my home I “rediscovered” openhab and spent the time building up my system slowly (and occasionally painfully). I’ve now been running a solid automation system in a three story house with openhab as the core for 3-4 years with many dozens of devices under numerous different “smart” protocols.

I get it. But I can also, from my own experience see the other side as well. Once you get that first piece to work, it get’s easier with every subsequent piece. I’m still not entirely sure what happened in your particular case here; suffice it to say that this was a very unusual situation and I would be optimistic that another round would be successful. I’m not familiar with the openweathermap binding, but there are many who are and could surely point you in the right direction.

One of the wonderful things about these forums is that you will find quite a few people who understand the value of the all of the many systems out there (e.g., I also have homeassitant installed on this machine, or at least probably still do, I don’t use it a lot any more) and get it when OH isn’t the right tool for someone. If one of those other options seems like a better fit at the moment, then try it out. But, even if you find something else that works for you, I recommend you check back in on OH in six months or a year; this system is always improving and the devs and forum regulars work hard on making it as accessible as possible for people of all experience levels.

Cheers,
Justin

can you login to your linux box and run

sudo netstat -tulpe --numeric-ports

this should show a list of ports that is being listened on.

Hi, Thanks for your help, but I already took the long road…
I do not see the option to close the topic.
rgds, Jan.