[Solved] Not able to access .png file in openhab2/html

Hi All,

When I try to access a .png file in openhab2/html by this command “https://10.1.68.206:8443/static/led-bulb.png” and I am getting below error.

2018-11-16 11:16:53.988 [DEBUG] [eclipse.jetty.servlet.ServletHandler] - chain=null
2018-11-16 11:16:53.988 [DEBUG] [.jetty.servlet.ErrorPageErrorHandler] - getErrorPage(GET /static/led-bulb.png) => error_page=null (from global default)
2018-11-16 11:16:53.988 [DEBUG] [se.jetty.server.handler.ErrorHandler] - No Error Page mapping for request(GET /static/led-bulb.png) (using default)
2018-11-16 11:16:53.989 [DEBUG] [org.eclipse.jetty.server.HttpChannel] - sendResponse info=null content=HeapByteBuffer@21b3de0c[p=0,l=336,c=32768,r=336]={<<<\n\n<me…/body>\n\n>>>>\n \n <a…linked.length;} complete=true committing=true callback=Blocker@6a9dba9{null}
2018-11-16 11:16:53.989 [DEBUG] [org.eclipse.jetty.server.HttpChannel] - COMMIT for /static/led-bulb.png on HttpChannelOverHttp@1ff453ea{r=1,c=true,a=DISPATCHED,uri=https://10.1.68.206:8443/static/led-bulb.png,age=3}
404 Not Found HTTP/1.1
Cache-Control: must-revalidate,no-cache,no-store
Content-Type: text/html;charset=iso-8859-1

I am new to OH. Can you please help me to solve this issue?.

Thanks,
Dhanasekar

which OH2 version? (post the output of openhab-cli info)

just in case: check permissions

ls -al /etc/openhab2/html/

Hi Dim,

Following are my observation,

ananth@ananth:~$ openhab-cli info

Version: 2.4.0-SNAPSHOT (#1407)

User: openhab (Active Process 1612)
User Groups: openhab

Directories: Folder Name | Path | User:Group
----------- | ---- | ----------
OPENHAB_HOME | /usr/share/openhab2 | openhab:openhab
OPENHAB_RUNTIME | /usr/share/openhab2/runtime | openhab:openhab
OPENHAB_USERDATA | /var/lib/openhab2 | openhab:openhab
OPENHAB_CONF | /etc/openhab2 | openhab:openhab
OPENHAB_LOGDIR | /var/log/openhab2 | openhab:openhab

URLs: http://10.1.68.206:8080
https://10.1.68.206:8443

ananth@ananth:~$ ls -al /etc/openhab2/html/
total 696
drwxr-xr-x 3 openhab openhab 4096 Nov 15 16:55 .
drwxr-xr-x 13 openhab openhab 4096 Oct 31 18:18 …
-rw-r–r-- 1 root root 430552 Nov 13 11:33 drawing.svg
-rw-r–r-- 1 root root 2261 Nov 12 16:15 floorplan.css
-rw-r–r-- 1 root root 61908 Nov 12 16:16 floorplan.svg
-rw-r–r-- 1 root root 44 Nov 13 15:31 floorplan_test1.css
-rw-r–r-- 1 root root 69614 Nov 13 15:31 floorplan_test1.svg
-rw-r–r-- 1 root root 44 Nov 13 16:13 floorplan_test2.css
-rw-r–r-- 1 root root 69608 Nov 13 16:12 floorplan_test2.svg
-rw-r–r-- 1 root root 44 Nov 9 17:24 floorplan_test.css
-rw-r–r-- 1 root root 15304 Nov 12 12:11 floorplan_test.svg
-rw-r–r-- 1 openhab openhab 451 Oct 31 16:10 index.html
-rw-r–r-- 1 root root 17377 Nov 15 10:11 led-bulb.png
-rw-r–r-- 1 openhab openhab 282 Oct 31 16:10 readme.txt
drwxr-xr-x 2 root root 4096 Nov 15 16:57 weather-data
ananth@ananth:~$

Thanks,
Dhanasekasr

upgrade to >1409
Latest is 1425

Thanks for the info…

I am unable to get the release date of #1409.

I can use below command to update SNAPSHOT to latest version

sudo apt-get update && sudo apt-get install openhab2

Can I update to latest version?

Thanks,
Dhanasekar

of course. I mentioned to go to a release greater than (>) 1409 (not to 1409 since 1409 is also broken)

by the way, since you have installed 2.4.0 Snapshot using apt, you just need to upgrade it

sudo apt-get update && sudo apt-get upgrade

(your command will also work)

i was reading again and actually, I am not sure if your build (1407) was affected by this issue…
it doesn’t hurt to upgrade to 1425 and try again

you mean I can continue in upgrading SNAPSHOT.

yes you can

but… try this first to see if the problem is resolved:

sudo chown -R openhab:openhab /etc/openhab2/html/

Even changing owner for /openhab2/html, still I am unable to load .png file in browser

ls -al /etc/openhab2/html/

do any of the other static files load?

No… I have tried to load index.html and noun_Light_1407048.png and getting same error

I can able to see .png files in browser. Thanks for you help.

When try to read status of openhab2, I am getting below error,

ananth@ananth:~$ sudo sysctl status openhab2.service
[sudo] password for ananth:
sysctl: cannot stat /proc/sys/status: No such file or directory
sysctl: cannot stat /proc/sys/openhab2/service: No such file or directory

is it expected ?.

Thanks,
Dhanasekar

yes. sysctl is used to set or query certain kernel parameters, while systemctl is used to communicate with systemd.

use:

systemctl status openhab2.service

what was the root-cause? :slight_smile:

After updating to latest version, I can able to load image in browser and I am not seeing the error.

I am not sure about the root-cause. I am new to OH.

Thanks for your help :grinning:

1 Like