openhab-docker icon indicating copy to clipboard operation
openhab-docker copied to clipboard

Runnig container with 4.0.0 snapshot results in exception

Open B0rner opened this issue 1 year ago • 2 comments

Summary

I tried runnig the OH docker container with snapshot tag (4.0.0) on an synology nas. I used the same setting from OH 3.2 container including same shared folders with same rights. The startup process stops at the following error:

+ IFS='
	'
+ '[' limited = unlimited ']'
+ rm -f /openhab/runtime/instances/instance.properties
+ rm -f /openhab/userdata/tmp/instances/instance.properties
+ NEW_USER_ID=9001
+ NEW_GROUP_ID=9001
+ echo 'Starting with openhab user id: 9001 and group id: 9001'
Starting with openhab user id: 9001 and group id: 9001
+ id -u openhab
+ initialize_volume /openhab/conf /openhab/dist/conf
+ volume=/openhab/conf
+ source=/openhab/dist/conf
++ ls -A /openhab/conf
+ '[' -z 'automation
html
icons
items
misc
persistence
rules
scripts
services
sitemaps
sounds
things
transform' ']'
+ initialize_volume /openhab/userdata /openhab/dist/userdata
+ volume=/openhab/userdata
+ source=/openhab/dist/userdata
++ ls -A /openhab/userdata
+ '[' -z 'backup
cache
config
etc
jsondb
logs
persistence
secrets
tmp' ']'
++ cmp /openhab/userdata/etc/version.properties /openhab/dist/userdata/etc/version.properties
+ '[' '!' -z '/openhab/userdata/etc/version.properties /openhab/dist/userdata/etc/version.properties differ: byte 101, line 3' ']'
+ echo 'Image and userdata versions differ! Starting an upgrade.'
+ tee /openhab/userdata/logs/update.log
Image and userdata versions differ! Starting an upgrade.
++ date +%FT%H-%M-%S
+ backup_file=userdata-2023-06-11T13-51-12.tar
+ '[' '!' -d /openhab/userdata/backup ']'
+ tar --exclude=/openhab/userdata/backup -c -f /openhab/userdata/backup/userdata-2023-06-11T13-51-12.tar /openhab/userdata
tar: Removing leading `/' from member names
+ tee -a /openhab/userdata/logs/update.log
+ echo 'You can find backup of userdata in /openhab/userdata/backup/userdata-2023-06-11T13-51-12.tar'
You can find backup of userdata in /openhab/userdata/backup/userdata-2023-06-11T13-51-12.tar
+ tee -a /openhab/userdata/logs/update.log

  Warning:  Netatmo Binding: New scope has been added for the introduction of the Carbon Monoxide Alarm. Authorization process has to be replayed (and former refreshToken can be removed from things config files -- see above).
  Warning:  Windcentrale Binding: The binding has been reworked to support the new API that requires authentication. Delete old 'mill' Things, add an 'account' Bridge and add new 'windmill' Things using the 'account' as Bridge. The channel names now follow the naming conventions. Items must be adapted for these changes.
Replacing userdata system files with newer versions...
Clearing cache...
Performing post-update tasks for version 3.3.0:
Performing post-update tasks for version 3.4.0:
Starting JSON database update...
[main] INFO org.openhab.core.tools.internal.Upgrader - Already executed 'itemCopyUnitToMetadata' on 2023-06-11T13:47:45.190311544+02:00[Europe/Berlin]. Use '--force'  to execute it again.
[main] INFO org.openhab.core.tools.internal.Upgrader - Already executed 'linkUpgradeJsProfile' on 2023-06-11T13:47:45.232309520+02:00[Europe/Berlin]. Use '--force'  to execute it again.
JSON database updated successfully.
SUCCESS: openHAB updated from 3.2.0 to 4.0.0-SNAPSHOT
+ chown -R openhab:openhab /openhab
+ sync
+ '[' -d /etc/cont-init.d ']'
+ sync
+ '[' true == false ']'
+ exec gosu openhab tini -s ./start.sh
Launching the openHAB runtime...

                           _   _     _     ____  
   ___   ___   ___   ___  | | | |   / \   | __ ) 
  / _ \ / _ \ / _ \ / _ \ | |_| |  / _ \  |  _ \ 
 | (_) | (_) |  __/| | | ||  _  | / ___ \ | |_) )
  \___/|  __/ \___/|_| |_||_| |_|/_/   \_\|____/ 
       |_|       4.0.0-SNAPSHOT - Build #3491


Use '<tab>' for a list of available commands

and '[cmd] --help' for help on a specific command.

To exit, use '<ctrl-d>' or 'logout'.

~                                                                               
 
openhab> 

~                                                                               
 
openhab> java.io.IOException: Permission denied
	at java.base/java.io.UnixFileSystem.createFileExclusively(Native Method)
	at java.base/java.io.File.createNewFile(File.java:1043)
	at org.apache.karaf.features.internal.service.FeatureConfigInstaller.installConfigurationFile(FeatureConfigInstaller.java:311)
	at org.apache.karaf.features.internal.service.FeatureConfigInstaller.installFeatureConfigs(FeatureConfigInstaller.java:173)
	at org.apache.karaf.features.internal.service.BundleInstallSupportImpl.installConfigs(BundleInstallSupportImpl.java:301)
	at org.apache.karaf.features.internal.service.FeaturesServiceImpl.installConfigs(FeaturesServiceImpl.java:1185)
	at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:961)
	at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1069)
	at org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:1004)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:833)

The same setting and same volumes works fine with OH3.

Expected Behavior

OH4 starts using the OH3 configuration.

Current Behavior

OH4 stops during startup with the error shown above.

Possible Solution

Steps to Reproduce

  1. runnig an small OH3 installation in docker on an synology nas
  2. changing the image in docker configuration from openhab:latest to openhab:snapshot
  3. start the container

Context

I'm not sure, if this is an openhab-docker issue or an openhab-[something else] isseue

Your Environment

A synology NAS with intel x64 CPU and 2 GB of RAM.

Image

  • openHAB version: 4.0.0-snapshop
  • Image tag used: snapshot

Docker Host

  • Operating System: DSM
  • Docker Version: 20.10.3
  • Architecture: x86_64

Configuration

[...]
"image" : "openhab/openhab:snapshot",
   "is_ddsm" : false,
   "is_package" : false,
   "links" : [],
   "memory_limit" : 1473249280,
   "name" : "openhab3.2",
   "network" : [
      {
         "driver" : "host",
         "name" : "host"
      }
   ],
   "network_mode" : "host",
   "port_bindings" : [],
   "privileged" : false,
   "shortcut" : {
      "enable_shortcut" : false,
      "enable_status_page" : false,
      "enable_web_page" : false,
      "web_page_url" : ""
   },
   "use_host_network" : true,
   "volume_bindings" : [
      {
         "host_volume_file" : "/docker/openhab/Berlin",
         "mount_point" : "/etc/localtime",
         "type" : "ro"
      },
      {
         "host_volume_file" : "/docker/openhab/timezone",
         "mount_point" : "/etc/timezone",
         "type" : "ro"
      },
      {
         "host_volume_file" : "/docker/openhab/addons",
         "mount_point" : "/openhab/addons",
         "type" : "rw"
      },
      {
         "host_volume_file" : "/docker/openhab/conf",
         "mount_point" : "/openhab/conf",
         "type" : "rw"
      },
      {
         "host_volume_file" : "/docker/openhab/userdata",
         "mount_point" : "/openhab/userdata",
         "type" : "rw"
      }

B0rner avatar Jun 11 '23 12:06 B0rner

Works fine for me.

Maybe you can double check that files can be created in the /openhab/userdata/config dir in the container?

You can also reconfigure the FeatureConfigInstaller logger to see logging about what file it is creating by adding this to log4j2.xml:

<Logger level="DEBUG" name="org.apache.karaf.features.internal.service.FeatureConfigInstaller"/>

wborn avatar Aug 05 '23 13:08 wborn

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Oct 04 '23 23:10 stale[bot]