Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.2.0] Addons fail to install due to Apache http OSGI components failing to download #1679

Closed
mbronk opened this issue Aug 6, 2024 · 14 comments
Labels
bug An unexpected problem or unintended behavior

Comments

@mbronk
Copy link

mbronk commented Aug 6, 2024

OH 4.2.0 fails a 🧹 clean installation w/ pre-populated addons.cfg with the following error:

Error downloading mvn:org.apache.httpcomponents/httpcore-osgi/4.4.13
Error downloading mvn:org.apache.httpcomponents/httpclient-osgi/4.5.13

Causing none of the addons to install properly. Subsequent install attempts fail as well.
Possibly some ordering/dependency issue between addons and core and may be related to pollytts

Full startup log - fresh instance, vanilla state (click to expand)
18:16:34.587 [INFO ] [org.openhab.core.Activator           ] - Starting openHAB 4.2.0 (Release Build)                                                                                                                           [174/12315]
18:16:42.163 [INFO ] [b.core.model.lsp.internal.ModelServer] - Started Language Server Protocol (LSP) service on port 5007
18:16:52.377 [INFO ] [re.automation.internal.RuleEngineImpl] - Rule engine started.
org.apache.karaf.features.internal.util.MultiException: Error:
        Error downloading mvn:org.apache.httpcomponents/httpclient-osgi/4.5.13
        Error downloading mvn:org.apache.httpcomponents/httpcore-osgi/4.4.13
        at org.apache.karaf.features.internal.download.impl.MavenDownloadManager$MavenDownloader.<init>(MavenDownloadManager.java:91)
        at org.apache.karaf.features.internal.download.impl.MavenDownloadManager.createDownloader(MavenDownloadManager.java:72)
        at org.apache.karaf.features.internal.region.Subsystem.downloadBundles(Subsystem.java:474)
        at org.apache.karaf.features.internal.region.Subsystem.downloadBundles(Subsystem.java:469)
        at org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:223)
        at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:399)
        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:840)
        Suppressed: java.io.IOException: Error downloading mvn:org.apache.httpcomponents/httpclient-osgi/4.5.13
                at org.apache.karaf.features.internal.download.impl.AbstractRetryableDownloadTask.run(AbstractRetryableDownloadTask.java:77)
                at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
                at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
                at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
                ... 3 more
        Caused by: java.io.IOException: Error resolving artifact org.apache.httpcomponents:httpclient-osgi:jar:4.5.13: [Could not find artifact org.apache.httpcomponents:httpclient-osgi:jar:4.5.13 in openhab (https://openhab.jfrog.io/o
penhab/libs-release/)]
                at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.configureIOException(AetherBasedResolver.java:803)
                at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:774)
                at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:657)
                at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:598)
                at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:565)
                at org.apache.karaf.features.internal.download.impl.MavenDownloadTask.download(MavenDownloadTask.java:52)
                at org.apache.karaf.features.internal.download.impl.AbstractRetryableDownloadTask.run(AbstractRetryableDownloadTask.java:60)
                ... 6 more
                Suppressed: shaded.org.eclipse.aether.transfer.ArtifactNotFoundException: Could not find artifact org.apache.httpcomponents:httpclient-osgi:jar:4.5.13 in openhab (https://openhab.jfrog.io/openhab/libs-release/)
                        at shaded.org.eclipse.aether.connector.basic.ArtifactTransportListener.transferFailed(ArtifactTransportListener.java:48)
                        at shaded.org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:401)
                        at shaded.org.eclipse.aether.util.concurrency.RunnableErrorForwarder.lambda$wrap$0(RunnableErrorForwarder.java:73)
                        at shaded.org.eclipse.aether.connector.basic.BasicRepositoryConnector$DirectExecutor.execute(BasicRepositoryConnector.java:669)
                        at shaded.org.eclipse.aether.connector.basic.BasicRepositoryConnector.get(BasicRepositoryConnector.java:290)
                        at shaded.org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:520)
                        at shaded.org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:408)
                        at shaded.org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:235)
                        at shaded.org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:212)
                        at shaded.org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveArtifact(DefaultRepositorySystem.java:272)
                        at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:767)
                        ... 11 more
        Caused by: shaded.org.eclipse.aether.resolution.ArtifactResolutionException: Error resolving artifact org.apache.httpcomponents:httpclient-osgi:jar:4.5.13
                at shaded.org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:431)
                at shaded.org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:235)
                at shaded.org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:212)
                at shaded.org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveArtifact(DefaultRepositorySystem.java:272)
                at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:767)
                ... 11 more
        Suppressed: java.io.IOException: Error downloading mvn:org.apache.httpcomponents/httpcore-osgi/4.4.13
                at org.apache.karaf.features.internal.download.impl.AbstractRetryableDownloadTask.run(AbstractRetryableDownloadTask.java:77)
                at org.apache.karaf.features.internal.download.impl.AbstractRetryableDownloadTask.run(AbstractRetryableDownloadTask.java:77)
                at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
                at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
                at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
                ... 3 more
        Caused by: java.io.IOException: Error resolving artifact org.apache.httpcomponents:httpcore-osgi:jar:4.4.13: [Could not find artifact org.apache.httpcomponents:httpcore-osgi:jar:4.4.13 in openhab (https://openhab.jfrog.io/openh
ab/libs-release/)]
                at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.configureIOException(AetherBasedResolver.java:803)
                at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:774)
                at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:657)
                at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:598)
                at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:565)
                at org.apache.karaf.features.internal.download.impl.MavenDownloadTask.download(MavenDownloadTask.java:52)
                at org.apache.karaf.features.internal.download.impl.AbstractRetryableDownloadTask.run(AbstractRetryableDownloadTask.java:60)
                ... 6 more
                Suppressed: shaded.org.eclipse.aether.transfer.ArtifactNotFoundException: Could not find artifact org.apache.httpcomponents:httpcore-osgi:jar:4.4.13 in openhab (https://openhab.jfrog.io/openhab/libs-release/)
                        at shaded.org.eclipse.aether.connector.basic.ArtifactTransportListener.transferFailed(ArtifactTransportListener.java:48)
                        at shaded.org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:401)
                        at shaded.org.eclipse.aether.util.concurrency.RunnableErrorForwarder.lambda$wrap$0(RunnableErrorForwarder.java:73)
                        at shaded.org.eclipse.aether.connector.basic.BasicRepositoryConnector$DirectExecutor.execute(BasicRepositoryConnector.java:669)
                        at shaded.org.eclipse.aether.connector.basic.BasicRepositoryConnector.get(BasicRepositoryConnector.java:290)
                        at shaded.org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:520)
                        at shaded.org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:408)
                        at shaded.org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:235)
                        at shaded.org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:212)
                        at shaded.org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveArtifact(DefaultRepositorySystem.java:272)
                        at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:767)
                        ... 11 more
        Caused by: shaded.org.eclipse.aether.resolution.ArtifactResolutionException: Error resolving artifact org.apache.httpcomponents:httpcore-osgi:jar:4.4.13
                at shaded.org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:431)
                at shaded.org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:235)
                at shaded.org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:212)
                at shaded.org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:212)
                at shaded.org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveArtifact(DefaultRepositorySystem.java:272)
                at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:767)
                ... 11 more
18:17:01.866 [ERROR] [.core.karaf.internal.FeatureInstaller] - Failed installing 'openhab-binding-exec, openhab-binding-volvooncall, openhab-binding-bluetooth, openhab-binding-airquality, openhab-voice-pollytts, openhab-binding-network
, openhab-automation-jsscripting, openhab-binding-chromecast, openhab-binding-mqtt, openhab-transformation-map, openhab-binding-ipcamera, openhab-binding-homematic, openhab-binding-systeminfo, openhab-transformation-jinja, openhab-tran
sformation-scale, openhab-binding-samsungtv, openhab-binding-upnpcontrol, openhab-binding-zway, openhab-binding-wled, openhab-binding-spotify, openhab-binding-lirc, openhab-transformation-regex, openhab-transformation-jsonpath, openhab
-binding-zwave, openhab-binding-miio, openhab-automation-jythonscripting, openhab-persistence-rrd4j, openhab-ui-basic, openhab-binding-ntp, openhab-binding-openweathermap, openhab-binding-astro, openhab-binding-snmp': Error:
        Error downloading mvn:org.apache.httpcomponents/httpclient-osgi/4.5.13
        Error downloading mvn:org.apache.httpcomponents/httpcore-osgi/4.4.13
org.apache.karaf.features.internal.util.MultiException: Error:
        Error downloading mvn:org.apache.httpcomponents/httpcore-osgi/4.4.13
        Error downloading mvn:org.apache.httpcomponents/httpclient-osgi/4.5.13
        at org.apache.karaf.features.internal.download.impl.MavenDownloadManager$MavenDownloader.<init>(MavenDownloadManager.java:91)
        at org.apache.karaf.features.internal.download.impl.MavenDownloadManager.createDownloader(MavenDownloadManager.java:72)
        at org.apache.karaf.features.internal.region.Subsystem.downloadBundles(Subsystem.java:474)
        at org.apache.karaf.features.internal.region.Subsystem.downloadBundles(Subsystem.java:469)
        at org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:223)
        at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:399)
        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:840)
        Suppressed: java.io.IOException: Error downloading mvn:org.apache.httpcomponents/httpcore-osgi/4.4.13
                at org.apache.karaf.features.internal.download.impl.AbstractRetryableDownloadTask.run(AbstractRetryableDownloadTask.java:77)
                at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
                at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
                at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
                ... 3 more
        Caused by: java.io.IOException: Error resolving artifact org.apache.httpcomponents:httpcore-osgi:jar:4.4.13: [Could not find artifact org.apache.httpcomponents:httpcore-osgi:jar:4.4.13 in openhab (https://openhab.jfrog.io/openh
ab/libs-release/)]
                at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.configureIOException(AetherBasedResolver.java:803)
                at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:774)
                at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:657)
                at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:598)
                at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:565)
                at org.apache.karaf.features.internal.download.impl.MavenDownloadTask.download(MavenDownloadTask.java:52)
                at org.apache.karaf.features.internal.download.impl.AbstractRetryableDownloadTask.run(AbstractRetryableDownloadTask.java:60)
                ... 6 more
                Suppressed: shaded.org.eclipse.aether.transfer.ArtifactNotFoundException: Could not find artifact org.apache.httpcomponents:httpcore-osgi:jar:4.4.13 in openhab (https://openhab.jfrog.io/openhab/libs-release/)
                        at shaded.org.eclipse.aether.connector.basic.ArtifactTransportListener.transferFailed(ArtifactTransportListener.java:48)
                        at shaded.org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:401)
                        at shaded.org.eclipse.aether.util.concurrency.RunnableErrorForwarder.lambda$wrap$0(RunnableErrorForwarder.java:73)
                        at shaded.org.eclipse.aether.connector.basic.BasicRepositoryConnector$DirectExecutor.execute(BasicRepositoryConnector.java:669)
                        at shaded.org.eclipse.aether.connector.basic.BasicRepositoryConnector.get(BasicRepositoryConnector.java:290)
                        at shaded.org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:520)
                        at shaded.org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:408)
                        at shaded.org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:235)
                        at shaded.org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:212)
                        at shaded.org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveArtifact(DefaultRepositorySystem.java:272)
                        at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:767)
                        ... 11 more
        Caused by: shaded.org.eclipse.aether.resolution.ArtifactResolutionException: Error resolving artifact org.apache.httpcomponents:httpcore-osgi:jar:4.4.13
                at shaded.org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:431)
                at shaded.org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:235)
                at shaded.org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:212)
                at shaded.org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveArtifact(DefaultRepositorySystem.java:272)
                at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:767)
                ... 11 more
        Suppressed: java.io.IOException: Error downloading mvn:org.apache.httpcomponents/httpclient-osgi/4.5.13
                at org.apache.karaf.features.internal.download.impl.AbstractRetryableDownloadTask.run(AbstractRetryableDownloadTask.java:77)
                at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
                at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
                at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
                ... 3 more
        Caused by: java.io.IOException: Error resolving artifact org.apache.httpcomponents:httpclient-osgi:jar:4.5.13: [Could not find artifact org.apache.httpcomponents:httpclient-osgi:jar:4.5.13 in openhab (https://openhab.jfrog.io/o
penhab/libs-release/)]
                at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.configureIOException(AetherBasedResolver.java:803)
                at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:774)
                at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:657)
                at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:598)
                at org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:565)
                at org.apache.karaf.features.internal.download.impl.MavenDownloadTask.download(MavenDownloadTask.java:52)
                at org.apache.karaf.features.internal.download.impl.AbstractRetryableDownloadTask.run(AbstractRetryableDownloadTask.java:60)
                ... 6 more
                Suppressed: shaded.org.eclipse.aether.transfer.ArtifactNotFoundException: Could not find artifact org.apache.httpcomponents:httpclient-osgi:jar:4.5.13 in openhab (https://openhab.jfrog.io/openhab/libs-release/)
                        at shaded.org.eclipse.aether.connector.basic.ArtifactTransportListener.transferFailed(ArtifactTransportListener.java:48)
                        at shaded.org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:401)
                        at shaded.org.eclipse.aether.util.concurrency.RunnableErrorForwarder.lambda$wrap$0(RunnableErrorForwarder.java:73)
                        at shaded.org.eclipse.aether.connector.basic.BasicRepositoryConnector$DirectExecutor.execute(BasicRepositoryConnector.java:669)
                        at shaded.org.eclipse.aether.connector.basic.BasicRepositoryConnector.get(BasicRepositoryConnector.java:290)
                        at shaded.org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:520)
                        at shaded.org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:408)
                        at shaded.org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:235)
                        at shaded.org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:212)
                        at shaded.org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveArtifact(DefaultRepositorySystem.java:272)

Isolation

  1. Looks to be introduced in 4.2.0 (vsn 4.1.3 is confirmed working)
  2. Does only reproduce if addons are installed from online source (no addons.kar downloaded)
  3. Repro rate: stable 100% (look up the Dockerfile below)

Possible cause:

Did not perform extensive testing (this may be a false lead❗), but on the surface it looks related to pollytts and changes introduced in openhab/openhab-addons#16294. Unsure if pollytts is the component at fault though, or just victim to other changes or dependency mix w/ other addons.


To reproduce

Using the Dockerfile listed below:

openHAB version Addons source Command Result
4.2.0 Online docker run --name openhab -p 8080:8080 --rm -it $(docker build -q .) ⚠️ Failure
4.2.0 Bundled (addons.kar) docker run --name openhab -p 8080:8080 --rm -it $(docker build -q . --build-arg DOWNLOAD_ADDONS=1) OK
4.1.3 Online docker run --name openhab -p 8080:8080 --rm -it $(docker build -q . --build-arg OPENHAB_VERSION=4.1.3) OK
4.1.3 Bundled (addons.kar) docker run --name openhab -p 8080:8080 --rm -it $(docker build -q . --build-arg OPENHAB_VERSION=4.1.3 --build-arg DOWNLOAD_ADDONS=1) OK

Dockerfile reproducing the issue (ref. table above for exact commands used)

   (👆 click to expand...)
FROM azul/zulu-openjdk:17-jre-headless-latest
RUN apt-get -qq update && \
    apt-get -qq -y --no-install-recommends install wget unzip supervisor -y 


ARG OPENHAB_VERSION="4.2.0"

RUN mkdir -p /opt/openhab && \
    wget -O /tmp/openhab-download.zip https://github.com/openhab/openhab-distro/releases/download/${OPENHAB_VERSION}/openhab-${OPENHAB_VERSION}.zip && \
    unzip /tmp/openhab-download.zip -d/opt/openhab

ARG DOWNLOAD_ADDONS=0
RUN /bin/bash -c "if [[ ${DOWNLOAD_ADDONS} -eq 1 ]]; then wget -P /opt/openhab/addons https://github.com/openhab/openhab-distro/releases/download/${OPENHAB_VERSION}/openhab-addons-${OPENHAB_VERSION}.kar; fi"

# HACK: Using supervisor just to execute 2 processes (openhab and its console/log tail) in parallel for quick&dirty checks.
#       This should be replaced by proper orchestration or at least a dedicated entrypoint script (but... since it works...)
COPY <<EOF /etc/supervisor/supervisord.conf
[supervisord]
nodaemon=true
logfile=/dev/stdout
logfile_maxbytes=0
pidfile=/tmp/supervisord.pid

[program:openhab]
user=openhab
command=/opt/openhab/runtime/bin/karaf daemon
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0

[program:openhab_logs]
command=/bin/bash -c 'sleep 10 && /opt/openhab/runtime/bin/client -p habopen -- "openhab:users add admin admin administrator; log:tail"'
startsecs=10
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
EOF

# Creating empty Overview page just for the MainUI to skip the 1st time setup wizard
COPY <<EOF /opt/openhab/userdata/jsondb/uicomponents_ui_page.json
{
  "overview": {
    "class": "org.openhab.core.ui.components.RootUIComponent",
    "value": {
      "uid": "overview",
      "tags": [],
      "props": {
        "parameters": [],
        "parameterGroups": []
      },
      "timestamp": "Aug 6, 2024, 11:03:28 AM",
      "component": "oh-layout-page",
      "config": {
        "label": "Overview"
      },
      "slots": {
        "default": []
      }
    }
  }
}
EOF

COPY <<EOF /opt/openhab/conf/services/addons.cfg
automation = jythonscripting, jsscripting
binding = systeminfo, zwave, zway, bluetooth, homematic, network, exec, ntp, astro, airquality, lirc, openweathermap, samsungtv, snmp, spotify, upnpcontrol, mqtt, miio, volvooncall, chromecast, wled, ipcamera
#misc = openhabcloud
persistence = rrd4j
transformation = map,regex,jsonpath,jinja,scale
ui = basic
voice = pollytts

EOF

RUN groupadd --gid 1000 openhab && \
    useradd --uid 1000 --gid 1000 openhab && \
    chown -R openhab:openhab /opt/openhab

USER openhab
EXPOSE 8080 8443 8101 5007
ENTRYPOINT ["/usr/bin/supervisord"]

Note: the Dockerfile above can be greatly minimized to isolate, but left as-is b/c this is the exact flavor I've used to test with.
BTW. if this confirmed as an issue, I'd suggest adding a similar rudimentary test to the CI (include all addons, scan for them installing correctly).

@mbronk mbronk added the bug An unexpected problem or unintended behavior label Aug 6, 2024
@mbronk
Copy link
Author

mbronk commented Aug 6, 2024

Separately - if the above gets confirmed as an issue with just a single binding (ex.: pollytts), I'd like to propose considering it (separately) as a potential issue/enhancement for openhab-core (hopefully not karaf itself).
That is, a single addon should ideally not have a system-wide impact and cause all bundles to fail installing (and w/o crisp log allowing to identify the origin ).

PS. Apology for double posting. Just consider this note to be (likely) orthogonal to the primary root cause, so wanted it to be standalone to be able to link directly to it in the future.

@openhab-bot
Copy link
Collaborator

This issue has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/openhab-4-2-release-discussion/157076/151

@lsiepel
Copy link
Contributor

lsiepel commented Aug 20, 2024

Not sure, but this issue might be a better fit into the distro repo @openhab/distro-maintainers, can someone transfer it?

@kaikreuzer kaikreuzer transferred this issue from openhab/openhab-addons Aug 20, 2024
@kaikreuzer
Copy link
Member

@mbronk I have just uploaded the two Apache libs to our Artifactory at openhab.jfrog.org, from which the online dependencies are loaded.
I would assume the issue to be solved by that. Please be so kind and test it!

@mbronk
Copy link
Author

mbronk commented Aug 22, 2024

@kaikreuzer - didn't have much time today, so only made a very rough check. Looks like the # of errors went down (2->1), but httpclient-osgi v.4.5.13 seems to still be missing.

Don't have full log (hope to be able to re-test in a few days), only this snippet which I think may be relevant:

Error resolving artifact org.apache.httpcomponents:httpclient-osgi:jar:4.5.13: [Could not find artifact org.apache.httpcomponents:httpclient-osgi:jar:4.5.13 in openhab (https://openhab.jfrog.io/openhab/libs-release/)]

Could you please check if both artifacts uploaded in the right place? Looking at https://openhab.jfrog.io/ui/native/libs-release/org/apache/httpcomponents/httpclient-osgi/ I do not see 4.5.13 indeed.

@kaikreuzer
Copy link
Member

Sorry @mbronk, my mistake. The artifact upload must have failed without me noticing or checking thoroughly.
Now the httpclient-osgi is in place as well and I hope that the issue is finally solved - thanks for your patience!

@mbronk
Copy link
Author

mbronk commented Aug 26, 2024

Hi @kaikreuzer - thanks for the note. Appreciate the updates! I can confirm the flow advances further, but there's unfortunately still an error (this time stracktrace attributes it quite vividly to pollytts). The gist of it (see at the bottom for full log and stacktrace):

 Unable to resolve com.amazonaws.aws-java-sdk-core/1.12.626

Checked on both 4.2.0 and 4.2.1. Same as before, only the online addon download has issues (.kar addons bundle works just fine and I am successfully using it as a workaround in my setup).


As mentioned before, I'm unsure if this is the same issue or should be filed separately, but I think that outside the immediate cause, there are at some areas where improvements may be considered. For example:

  1. Unless it's done already and this is more nuanced (sorry, didn't check), is it possible to use the same Artifactory instance: 1) during the CI build of addons.kar and 2) for online instance access?
    • I am assuming enabling pass-through of Artifactory to, say, Maven Central, is not an option for security reasons, but since it looks like addons.kar bundles all the deps, it would be ideal if its build failed in case the online repo is missing something.
  2. Is there anything the framework could do to defend itself from a single addon installation failure? Not sure if this is inherent to OSGI/karaf but the all-or-nothing addon installation strategy is a bit risky in such heterogenous ecosystem.
    • In this example, even though there's something happening only with pollytts, none of addons would install (incl. future attempts to install something from the UI), making the whole instance defunct.
      Is there a way to insulate/compartmentalize each addon install and/or back off of failed attempts?
    • In the newest log file, the failure trace at least points to pollytts but in the original one (see log file in my top post) there was no trace of the addon causing the aggregate failure and I only got to pollytts via bisect + looking at addons code repo. Can the handling be improved by any chance?

Startup log w/ error - fresh 4.2.1 instance, vanilla state (click to expand)
13:46:01.066 [INFO ] [org.openhab.core.Activator           ] - Starting openHAB 4.2.1 (Release Build)
13:46:05.814 [INFO ] [b.core.model.lsp.internal.ModelServer] - Started Language Server Protocol (LSP) service on port 5007
13:46:15.693 [INFO ] [re.automation.internal.RuleEngineImpl] - Rule engine started.
org.apache.felix.resolver.reason.ReasonException: Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=openhab-voice-pollytts; type=karaf.feature; version="[4.2.1,4.2.1]"; filter:="(&(osgi.identity=openhab-voice-pollytts)(type=karaf.feature)(version>=4.2.1)(version<=4.2.1))" [caused by: Unable to resolve openhab-voice-pollytts/4.2.1: missing requirement [openhab-voice-pollytts/4.2.1] osgi.identity; osgi.identity=org.openhab.voice.pollytts; type=osgi.bundle; version="[4.2.1,4.2.1]"; resolution:=mandatory [caused by: Unable to resolve org.openhab.voice.pollytts/4.2.1: missing requirement [org.openhab.voice.pollytts/4.2.1] osgi.wiring.package; filter:="(&(osgi.wiring.package=com.amazonaws.client.builder)(version>=1.12.0)(!(version>=2.0.0)))" [caused by: Unable to resolve com.amazonaws.aws-java-sdk-core/1.12.626: missing requirement [com.amazonaws.aws-java-sdk-core/1.12.626] osgi.wiring.package; filter:="(osgi.wiring.package=org.apache.http)"]]]
        at org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341)
        at org.apache.felix.resolver.ResolverImpl.doResolve(ResolverImpl.java:433)
        at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:420)
        at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:374)
        at org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:256)
        at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:399)
        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:840)
Caused by: org.apache.felix.resolver.reason.ReasonException: Unable to resolve openhab-voice-pollytts/4.2.1: missing requirement [openhab-voice-pollytts/4.2.1] osgi.identity; osgi.identity=org.openhab.voice.pollytts; type=osgi.bundle; version="[4.2.1,4.2.1]"; resolution:=mandatory [caused by: Unable to resolve org.openhab.voice.pollytts/4.2.1: missing requirement [org.openhab.voice.pollytts/4.2.1] osgi.wiring.package; filter:="(&(osgi.wiring.package=com.amazonaws.client.builder)(version>=1.12.0)(!(version>=2.0.0)))" [caused by: Unable to resolve com.amazonaws.aws-java-sdk-core/1.12.626: missing requirement [com.amazonaws.aws-java-sdk-core/1.12.626] osgi.wiring.package; filter:="(osgi.wiring.package=org.apache.http)"]]
        at org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341)
        ... 12 more
Caused by: org.apache.felix.resolver.reason.ReasonException: Unable to resolve org.openhab.voice.pollytts/4.2.1: missing requirement [org.openhab.voice.pollytts/4.2.1] osgi.wiring.package; filter:="(&(osgi.wiring.package=com.amazonaws.client.builder)(version>=1.12.0)(!(version>=2.0.0)))" [caused by: Unable to resolve com.amazonaws.aws-java-sdk-core/1.12.626: missing requirement [com.amazonaws.aws-java-sdk-core/1.12.626] osgi.wiring.package; filter:="(osgi.wiring.package=org.apache.http)"]
        at org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341)
        ... 13 more
Caused by: org.apache.felix.resolver.reason.ReasonException: Unable to resolve com.amazonaws.aws-java-sdk-core/1.12.626: missing requirement [com.amazonaws.aws-java-sdk-core/1.12.626] osgi.wiring.package; filter:="(osgi.wiring.package=org.apache.http)"
        at org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1341)
        ... 14 more
13:46:34.541 [ERROR] [.core.karaf.internal.FeatureInstaller] - Failed installing 'openhab-binding-exec, openhab-binding-volvooncall, openhab-binding-bluetooth, openhab-binding-airquality, openhab-voice-pollytts, openhab-binding-network, openhab-automation-jsscripting, openhab-binding-chromecast, openhab-binding-mqtt, openhab-transformation-map, openhab-binding-ipcamera, openhab-binding-homematic, openhab-binding-systeminfo, openhab-transformation-jinja, openhab-transformation-scale, openhab-binding-samsungtv, openhab-binding-upnpcontrol, openhab-binding-zway, openhab-binding-wled, openhab-binding-spotify, openhab-binding-lirc, openhab-transformation-regex, openhab-transformation-jsonpath, openhab-binding-zwave, openhab-binding-miio, openhab-automation-jythonscripting, openhab-persistence-rrd4j, openhab-ui-basic, openhab-binding-ntp, openhab-binding-openweathermap, openhab-binding-astro, openhab-binding-snmp': Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=openhab-voice-pollytts; type=karaf.feature; version="[4.2.1,4.2.1]"; filter:="(&(osgi.identity=openhab-voice-pollytts)(type=karaf.feature)(version>=4.2.1)(version<=4.2.1))" [caused by: Unable to resolve openhab-voice-pollytts/4.2.1: missing requirement [openhab-voice-pollytts/4.2.1] osgi.identity; osgi.identity=org.openhab.voice.pollytts; type=osgi.bundle; version="[4.2.1,4.2.1]"; resolution:=mandatory [caused by: Unable to resolve org.openhab.voice.pollytts/4.2.1: missing requirement [org.openhab.voice.pollytts/4.2.1] osgi.wiring.package; filter:="(&(osgi.wiring.package=com.amazonaws.client.builder)(version>=1.12.0)(!(version>=2.0.0)))" [caused by: Unable to resolve com.amazonaws.aws-java-sdk-core/1.12.626: missing requirement [com.amazonaws.aws-java-sdk-core/1.12.626] osgi.wiring.package; filter:="(osgi.wiring.package=org.apache.http)"]]]

@wborn
Copy link
Member

wborn commented Aug 29, 2024

Unable to resolve com.amazonaws.aws-java-sdk-core/1.12.626

The same build error is causing the sandbox builds to fail, see:

@kaikreuzer
Copy link
Member

@wborn The sandbox builds only started failing a week ago - before, the 4.3.0 builds were just fine. @mbronk reports the problem on 4.2.x, though. Do you have any idea, how that fits together?

The AWS SDK in PollyTTS has last been updated 8 months ago and it was correctly published through the OSGify build (https://ci.openhab.org/view/Release%20Jobs/job/openhab-osgiify/32/). It is also still present in artifactory as expected.

What might be the issue here?

@wborn
Copy link
Member

wborn commented Sep 1, 2024

I see the sandbox build succeeds again and I can also install Polly TTS with OH 4.2.1.
Does it also work for you again @mbronk?

It probably got fixed by redeploying the artifacts because the openhab-osgiify CI task ran to deploy com.hubspot.jinjava.jinjava, see openhab/openhab-osgiify#48.

@kaikreuzer
Copy link
Member

It should work for 4.2.x and main again. It took me 2 hours last night to figure out, what was the problem:
It turned out, that the artifact upload didn't fail, but that I uploaded both as the httpclient library. Which meant that when Karaf installed the httpcore bundle, it ended up installing httpclient instead - and as a result, the httpcore packages were missing.

@wborn
Copy link
Member

wborn commented Sep 1, 2024

Thanks for fixing it Kai! 👍 Looking at the actual JAR content was what I wanted to do next if it was still failing. 😉

@mbronk
Copy link
Author

mbronk commented Sep 2, 2024

I see the sandbox build succeeds again and I can also install Polly TTS with OH 4.2.1. Does it also work for you again @mbronk?

I confirm. Both 4.2.0 and 4.2.1 work for me again! Thanks tons for the fix 👏 .

Technically this issue can be closed now as the original symptoms are gone.
Unsure if there's anything in #1679 (comment) that you would like to consider for improvement, or if there's room for adding E2E test cases to the CI. Personally unsure if brings enough return on investment, but if you feel anything of it is worth following up, I can file these separately - let me know!

@wborn
Copy link
Member

wborn commented Sep 7, 2024

That's good news! I've created #1686 for addressing the root cause.

@wborn wborn closed this as completed Sep 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

5 participants