Docker image for 2.2.0 would not start

I use OpenHAB 2.1.0 in a container with:

docker run --env USER_ID=999 --rm --name openhab --net=host \
-v /etc/localtime:/etc/localtime:ro \
-v /etc/timezone:/etc/timezone:ro \
-v /opt/openhab/addons:/openhab/addons \
-v /opt/openhab/conf:/openhab/conf \
-v /opt/openhab/userdata:/openhab/userdata -ti \
--device=/dev/ttyACM0 openhab/openhab:2.1.0-amd64-debian

This lets me use my z wave USB device nicely. Now, I’d like to upgrade to the 2.2.0 snapshot version. I only change the image to openhab/openhab:2.2.0-snapshot-amd64-debian. But this results in an error:

Could not resolve mvn:org.eclipse.tycho/org.eclipse.osgi/3.10.101.v20150820-1432

What must I change in order to be able to upgrade?

Did you also follow the instructions at: http://docs.openhab.org/installation/docker.html#updating-the-image ?

To be honest, no, but now I removed the two directories tmp and cache (I think the other steps are already taken care of), but the container aborts with the same error message.

Another known issue is that the files in /openhab/userdata/etc are not properly migrated between versions. So you could try to migrate them yourself by using the files from a freshly installed 2.2.0-snapshot container instead of those of the previous 2.1.0 installation.

I got the same issue. Did someone figure out how to fix it?

I just upgraded my docker image from 2.1.0 to 2.2.0 and got the same error “Could not resolve mvn:org.eclipse.tycho/org.eclipse.osgi/3.10.101.v20150820-1432”

Same with the latest 2.3.0-snapshot image.

I got the same error witout docker. But so far there is no idea to fix it!

Maybe I’ve seen it before and if I remember correctly got it fixed by just restarting the container. :thinking:

I’m having the same issue. I’ll try to troubleshoot this too, but for anyone who feels stuck… the glory of containers is that you can just roll back to the 2.1 release, and it should work fine. If you’ve deleted your cache/tmp as @wborn recommended, there may be a few small things you have to re-do in PaperUI, but I just went through the exercise and was back up and running with 2.1 in a matter of minutes until we figure out a fix for this.

Me too. I tried a backup then restore and then got

+ exec gosu openhab ./start.sh                                                                                                                                                                                                                                                               
Launching the openHAB runtime...                                                                                                                                                                                                                                                             
null                                                                                                                                                                                                                                                                                         
Error occurred shutting down framework: java.lang.NumberFormatException: null                                                                                                                                                                                                                
java.lang.NumberFormatException: null                                                                                                                                                                                                                                                        
        at java.lang.Integer.parseInt(Integer.java:542)                                                                                                                                                                                                                                      
        at java.lang.Integer.parseInt(Integer.java:615)                                                                                                                                                                                                                                      
        at org.apache.karaf.main.ConfigProperties.<init>(ConfigProperties.java:214)                                                                                                                                                                                                          
        at org.apache.karaf.main.Main.updateInstancePidAfterShutdown(Main.java:228)                                                                                                                                                                                                          
        at org.apache.karaf.main.Main.main(Main.java:193)

You need to replace userdata/etc/config.properties with the 2.2.0 version.

You can use this:

################################################################################
#
#    Licensed to the Apache Software Foundation (ASF) under one or more
#    contributor license agreements.  See the NOTICE file distributed with
#    this work for additional information regarding copyright ownership.
#    The ASF licenses this file to You under the Apache License, Version 2.0
#    (the "License"); you may not use this file except in compliance with
#    the License.  You may obtain a copy of the License at
#
#       http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS,
#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#    See the License for the specific language governing permissions and
#    limitations under the License.
#
################################################################################

#
# This file lists Karaf default settings for this particular version of Karaf.
# For easier maintenance when upgrading Karaf and to better document which
# default values have changed, it is recommended to place any changes to
# these values in a custom.properties file in the same folder as this file.
# Each value specified in custom.properties will override the default value
# here.
#

#
# Properties file inclusions (as a space separated list of relative paths)
# Included files will override the values specified in this file
# NB: ${includes} properties files are mandatory, it means that Karaf will not start
# if the include file is not found
#
${includes} = jre.properties custom.properties

#
# Properties file inclusions (as a space separated list of relative paths)
# Included files will override the values specified in this file
# NB: ${optionals} properties files are optionals, it means that Karaf will just
# display a warning message but the bootstrap will be performed
#
# ${optionals} = my.properties

#
# Framework selection properties
#
karaf.framework=felix

#
# Location of the OSGi frameworks
#
karaf.framework.equinox=mvn\:org.eclipse.platform/org.eclipse.osgi/3.11.3
karaf.framework.felix=mvn\:org.apache.felix/org.apache.felix.framework/5.6.8

#
# Framework config properties.
#
org.osgi.framework.system.packages= \
 org.osgi.dto;version="1.0",\
 org.osgi.resource;version="1.0",\
 org.osgi.resource.dto;version="1.0";uses:="org.osgi.dto",\
 org.osgi.framework;version="1.8",\
 org.osgi.framework.dto;version="1.8";uses:="org.osgi.dto",\
 org.osgi.framework.hooks.bundle;version="1.1";uses:="org.osgi.framework",\
 org.osgi.framework.hooks.resolver;version="1.0";uses:="org.osgi.framework.wiring",\
 org.osgi.framework.hooks.service;version="1.1";uses:="org.osgi.framework",\
 org.osgi.framework.hooks.weaving;version="1.1";uses:="org.osgi.framework.wiring",\
 org.osgi.framework.launch;version="1.2";uses:="org.osgi.framework",\
 org.osgi.framework.namespace;version="1.1";uses:="org.osgi.resource",\
 org.osgi.framework.startlevel;version="1.0";uses:="org.osgi.framework",\
 org.osgi.framework.startlevel.dto;version="1.0";uses:="org.osgi.dto",\
 org.osgi.framework.wiring;version="1.2";uses:="org.osgi.framework,org.osgi.resource",\
 org.osgi.framework.wiring.dto;version="1.2";uses:="org.osgi.dto,org.osgi.resource.dto",\
 org.osgi.service.condpermadmin;version="1.1.1";uses:="org.osgi.framework,org.osgi.service.permissionadmin",\
 org.osgi.service.packageadmin;version="1.2";uses:="org.osgi.framework",org.osgi.service.permissionadmin;version="1.2",\
 org.osgi.service.resolver;version="1.0";uses:="org.osgi.resource",\
 org.osgi.service.startlevel;version="1.1";uses:="org.osgi.framework",\
 org.osgi.service.url;version="1.0",\
 org.osgi.util.tracker;version="1.5.1";uses:="org.osgi.framework",\
 org.apache.karaf.version;version="4.1.3",\
 org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version="4.1.3",\
 org.apache.karaf.jaas.boot;uses:="javax.security.auth,javax.security.auth.callback,javax.security.auth.login,javax.security.auth.spi,org.osgi.framework";version="4.1.3",\
 ${jre-${java.specification.version}}

#
# Extra packages appended after standard packages
#
org.osgi.framework.system.packages.extra = \
    org.apache.karaf.branding, \
    sun.misc, \
    org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version=4.1.3, \
    org.apache.karaf.jaas.boot;uses:=\"javax.security.auth,javax.security.auth.callback,javax.security.auth.login,javax.security.auth.spi,org.osgi.framework\";version=4.1.3, \
    org.apache.karaf.diagnostic.core;uses:=org.osgi.framework;version=4.1.3, \
    org.apache.karaf.diagnostic.core.common;uses:=org.apache.karaf.diagnostic.core;version=4.1.3

org.osgi.framework.system.capabilities= \
 ${eecap-${java.specification.version}}, \
 ${${karaf.framework}-capabilities}, \
 ${karaf-capabilities}

karaf-capabilities= \
 osgi.service;objectClass:List<String>=org.apache.karaf.info.ServerInfo

felix-capabilities= \
 osgi.service;objectClass:List<String>=org.osgi.service.packageadmin.PackageAdmin, \
 osgi.service;objectClass:List<String>=org.osgi.service.resolver.Resolver, \
 osgi.service;objectClass:List<String>=org.osgi.service.startlevel.StartLevel

equinox-capabilities= \
 osgi.service;objectClass:List<String>=java.lang.ClassLoader;equinox.classloader.type=contextClassLoader, \
 osgi.service;objectClass:List<String>=javax.xml.parsers.DocumentBuilderFactory, \
 osgi.service;objectClass:List<String>=javax.xml.parsers.SAXParserFactory, \
 osgi.service;objectClass:List<String>=org.eclipse.osgi.framework.log.FrameworkLog, \
 osgi.service;objectClass:List<String>=org.eclipse.osgi.framework.log.FrameworkLog;performance=true, \
 osgi.service;objectClass:List<String>=org.eclipse.osgi.service.datalocation.Location;type=eclipse.home.location, \
 osgi.service;objectClass:List<String>=org.eclipse.osgi.service.datalocation.Location;type=osgi.configuration.area, \
 osgi.service;objectClass:List<String>=org.eclipse.osgi.service.datalocation.Location;type=osgi.install.area, \
 osgi.service;objectClass:List<String>=org.eclipse.osgi.service.datalocation.Location;type=osgi.instance.area, \
 osgi.service;objectClass:List<String>=org.eclipse.osgi.service.datalocation.Location;type=osgi.user.area, \
 osgi.service;objectClass:List<String>=org.eclipse.osgi.service.debug.DebugOptions, \
 osgi.service;objectClass:List<String>=org.eclipse.osgi.service.environment.EnvironmentInfo, \
 osgi.service;objectClass:List<String>=org.eclipse.osgi.service.localization.BundleLocalization, \
 osgi.service;objectClass:List<String>="org.osgi.service.log.LogReaderService,org.eclipse.equinox.log.ExtendedLogReaderService", \
 osgi.service;objectClass:List<String>="org.osgi.service.log.LogService,org.eclipse.equinox.log.ExtendedLogService", \
 osgi.service;objectClass:List<String>=org.eclipse.osgi.service.security.TrustEngine;osgi.signedcontent.trust.engine=org.eclipse.osgi, \
 osgi.service;objectClass:List<String>=org.eclipse.osgi.service.urlconversion.URLConverter;protocol:List<String>="bundleentry,bundleresource"

eecap-9= osgi.ee; osgi.ee="OSGi/Minimum"; version:List<Version>="1.0,1.1,1.2", \
 osgi.ee; osgi.ee="JavaSE"; version:List<Version>="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0", \
 osgi.ee; osgi.ee="JRE"; version:List<Version>="1.0,1.1", \
 osgi.ee; osgi.ee="JavaSE/compact1"; version:List<Version>="1.8,9.0", \
 osgi.ee; osgi.ee="JavaSE/compact2"; version:List<Version>="1.8,9.0", \
 osgi.ee; osgi.ee="JavaSE/compact3"; version:List<Version>="1.8,9.0"
eecap-1.8= osgi.ee; osgi.ee="OSGi/Minimum"; version:List<Version>="1.0,1.1,1.2", \
 osgi.ee; osgi.ee="JavaSE"; version:List<Version>="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8", \
 osgi.ee; osgi.ee="JRE"; version:List<Version>="1.0,1.1", \
 osgi.ee; osgi.ee="JavaSE/compact1"; version:List<Version>="1.8", \
 osgi.ee; osgi.ee="JavaSE/compact2"; version:List<Version>="1.8", \
 osgi.ee; osgi.ee="JavaSE/compact3"; version:List<Version>="1.8"

#
# javax.transaction is needed to avoid class loader constraint violation when using javax.sql
#
org.osgi.framework.bootdelegation = \
    com.sun.*, \
    javax.transaction, \
    javax.transaction.*, \
    javax.xml.crypto, \
    javax.xml.crypto.*, \
    jdk.nashorn.*, \
    sun.*, \
    org.apache.karaf.jaas.boot.principal, \
    org.apache.karaf.jaas.boot

# jVisualVM support
# in order to use Karaf with jvisualvm, the org.osgi.framework.bootdelegation property has to contain the org.netbeans.lib.profiler.server package
# and, so, it should look like:
#
# org.osgi.framework.bootdelegation=org.apache.karaf.jaas.boot,org.apache.karaf.jaas.boot.principal,sun.*,com.sun.*,javax.transaction,javax.transaction.*,javax.xml.crypto,javax.xml.crypto.*,org.apache.xerces.jaxp.datatype,org.apache.xerces.stax,org.apache.xerces.parsers,org.apache.xerces.jaxp,org.apache.xerces.jaxp.validation,org.apache.xerces.dom,org.netbeans.lib.profiler.server
#
# YourKit support
# in order to use Karaf with YourKit, the org.osgi.framework.bootdelegation property has to contain the com.yourkit.* packages
# and, so, it should look like:
#
# org.osgi.framework.bootdelegation=org.apache.karaf.jaas.boot,org.apache.karaf.jaas.boot.principal,sun.*,com.sun.*,javax.transaction,javax.transaction.*,javax.xml.crypto,javax.xml.crypto.*,org.apache.xerces.jaxp.datatype,org.apache.xerces.stax,org.apache.xerces.parsers,org.apache.xerces.jaxp,org.apache.xerces.jaxp.validation,org.apache.xerces.dom,com.yourkit.*
#

#
# Set the parent classloader for the bundle to the classloader that loads the Framework (i.e. everything in lib/*.jar)
#
org.osgi.framework.bundle.parent=framework

#
# Definition of the default bundle start level
#
org.osgi.framework.startlevel.beginning=100
karaf.startlevel.bundle=80

#
# The location of the Karaf shutdown port file used to stop instance
#
karaf.shutdown.port.file=${karaf.data}/port

#
# The location of the Karaf pid file
#
karaf.pid.file=${karaf.base}/karaf.pid

#
# Configuration FileMonitor properties
#
felix.fileinstall.enableConfigSave = true
felix.fileinstall.dir    = ${karaf.etc}
felix.fileinstall.filter = .*\\.(cfg|config)
felix.fileinstall.poll   = 1000
felix.fileinstall.noInitialDelay = true
felix.fileinstall.log.level = 3
felix.fileinstall.log.default = jul

# Use cached urls for bundle CodeSource to avoid
# problems with JCE cached informations, see KARAF-3974
felix.bundlecodesource.usecachedurls = true

#
# Delay for writing the framework state to disk in equinox
# must be  >= 1000 and <= 1800000
#
eclipse.stateSaveDelayInterval = 1000

#
# OBR Repository list
# This property will be modified by the obr:addUrl and obr:removeUrl commands. 
#
obr.repository.url = 

#
# Start blueprint bundles synchronously when possible
#
org.apache.aries.blueprint.synchronous=true

#
# Do not weave all any classes by default
#
org.apache.aries.proxy.weaving.enabled=

#
# mvn url handler requires config instance configuration
#
org.ops4j.pax.url.mvn.requireConfigAdminConfig=true

#
# Don't delay the console startup. Set to true if you want the console to start after all other bundles
#
karaf.delay.console=false

#
# Generated command shutdown
#
karaf.shutdown.command = a28b5a9c-1ceb-4462-85ee-273b7a4f9eb0

#
# Enable native Karaf support for systemd's watchdog.
#
#karaf.systemd.enabled=false

2 Likes

@mbo Thank you!!! It seems that is the solution for my problem.
I restored my files and replaced the config.properties from the fresh install.

@mbo: After applying that fix, I get another error:

09T22:57:39.008268781Z + ls -A /openhab/conf

09T22:57:39.011665768Z + [ -z html

09T22:57:39.011826394Z icons

09T22:57:39.011902279Z items

09T22:57:39.011968061Z persistence

09T22:57:39.012032592Z rules

09T22:57:39.012134572Z scripts

09T22:57:39.012218791Z services

09T22:57:39.012309937Z sitemaps

09T22:57:39.012410926Z sounds

09T22:57:39.012571760Z things

09T22:57:39.012642958Z transform ]

09T22:57:39.012710042Z + chown -R openhab:openhab /openhab

09T22:57:39.338285180Z + exec su-exec openhab ./start.sh

09T22:57:39.348141349Z Launching the openHAB runtime...

09T22:59:24.175636338Z Error installing bundle listed in startup.properties with url: mvn:org.ops4j.pax.logging/pax-logging-api/1.8.5 and startlevel: 8

09T22:59:28.977020926Z + test -t 0

09T22:59:28.977270197Z + [ 0 -eq 1 ]

09T22:59:28.977385249Z + set -euo pipefail

09T22:59:28.977506916Z + IFS=

09T22:59:28.977609312Z 	

09T22:59:28.977705718Z + rm -f /openhab/runtime/instances/instance.properties

09T22:59:28.982831090Z + rm -f /openhab/userdata/tmp/instances/instance.properties

09T22:59:28.986854116Z + NEW_USER_ID=9001

09T22:59:28.987855367Z + echo Starting with openhab user id: 9001

09T22:59:28.988056201Z Starting with openhab user id: 9001

09T22:59:28.988131618Z + id -u openhab

09T22:59:28.993665948Z + ls -A /openhab/userdata

09T22:59:28.997611891Z + [ -z Californium.properties

09T22:59:29.008494301Z cache

09T22:59:29.008652114Z config

09T22:59:29.008722687Z etc

09T22:59:29.008786177Z jsondb

09T22:59:29.008843833Z kar

09T22:59:29.008904146Z log

09T22:59:29.008965083Z logs

09T22:59:29.009025656Z tmp ]

09T22:59:29.009101073Z + ls -A /openhab/conf

09T22:59:29.009163417Z + [ -z html

09T22:59:29.009224250Z icons

09T22:59:29.009286698Z items

09T22:59:29.009346282Z persistence

09T22:59:29.009408730Z rules

09T22:59:29.009841439Z scripts

09T22:59:29.009933105Z services

09T22:59:29.009998053Z sitemaps

09T22:59:29.010063991Z sounds

09T22:59:29.010133210Z things

09T22:59:29.010201752Z transform ]

09T22:59:29.010268783Z + chown -R openhab:openhab /openhab

09T22:59:29.345291104Z + exec su-exec openhab ./start.sh

09T22:59:29.351887519Z Launching the openHAB runtime...

09T23:01:13.869467740Z Error installing bundle listed in startup.properties with url: mvn:org.ops4j.pax.logging/pax-logging-api/1.8.5 and startlevel: 8

09T23:01:18.367989542Z + test -t 0

09T23:01:18.368253708Z + [ 0 -eq 1 ]

09T23:01:18.368337979Z + set -euo pipefail

09T23:01:18.368403188Z + IFS=

@ChrisH when you pull the latest version of the openHAB Docker containers they will automatically upgrade userdata from a previous version (2.0.0, 2.1.0, 2.2.0 or 2.3.0-SNAPSHOT). See also: New Docker Upgrade Ability.