Uploaded image for project: 'Dev - Nexus Repo'
  1. Dev - Nexus Repo
  2. NEXUS-27710

startup fails due to partially written install configuration files from karaf bootstrap

    Details

    • Type: Bug
    • Status: Open
    • Priority: Critical
    • Resolution: Unresolved
    • Affects Version/s: 3.30.1, 3.39.0, 3.40.0, 3.41.0, 3.43.0
    • Fix Version/s: None
    • Component/s: Bootstrap
    • Story Points:
      5
    • Notability:
      2

      Description

      After an OS restart the service to restart Nexus Repo is sporadically failing to start.  When this problem occurs the following is seen in the logs:

      2021-03-03 23:37:21,716+0000 INFO  [FelixStartLevel]  *SYSTEM org.sonatype.nexus.pax.logging.NexusLogActivator - start
      2021-03-03 23:37:22,573+0000 INFO  [FelixStartLevel]  *SYSTEM org.sonatype.nexus.features.internal.FeaturesWrapper - Fast FeaturesService starting
      2021-03-03 23:37:22,644+0000 ERROR [FelixStartLevel]  *SYSTEM org.apache.karaf.deployer.features.FeatureDeploymentListener - Unable to update deployed features for bundle: org.apache.felix.framework - 5.6.12
      java.lang.NullPointerException: null
       at org.apache.karaf.deployer.features.FeatureDeploymentListener.bundleChanged(FeatureDeploymentListener.java:247)
       at org.apache.karaf.deployer.features.FeatureDeploymentListener.init(FeatureDeploymentListener.java:95)
       at org.apache.karaf.deployer.features.osgi.Activator$DeploymentFinishedListener.deploymentEvent(Activator.java:86)
       at org.apache.karaf.features.internal.service.FeaturesServiceImpl.registerListener(FeaturesServiceImpl.java:295)
       at org.apache.karaf.deployer.features.osgi.Activator.doStart(Activator.java:53)
       at org.apache.karaf.util.tracker.BaseActivator.start(BaseActivator.java:92)
       at org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:697)
       at org.apache.felix.framework.Felix.activateBundle(Felix.java:2240)
       at org.apache.felix.framework.Felix.startBundle(Felix.java:2146)
       at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1373)
       at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308)
       at java.lang.Thread.run(Thread.java:748)
      2021-03-03 23:37:22,646+0000 ERROR [FelixStartLevel]  *SYSTEM org.apache.karaf.deployer.features.FeatureDeploymentListener - Unable to update deployed features for bundle: org.apache.karaf.features.extension - 4.2.9
      java.lang.NullPointerException: null
       at org.apache.karaf.deployer.features.FeatureDeploymentListener.bundleChanged(FeatureDeploymentListener.java:247)
       at org.apache.karaf.deployer.features.FeatureDeploymentListener.init(FeatureDeploymentListener.java:95)
       at org.apache.karaf.deployer.features.osgi.Activator$DeploymentFinishedListener.deploymentEvent(Activator.java:86)
       at org.apache.karaf.features.internal.service.FeaturesServiceImpl.registerListener(FeaturesServiceImpl.java:295)
       at org.apache.karaf.deployer.features.osgi.Activator.doStart(Activator.java:53)
       at org.apache.karaf.util.tracker.BaseActivator.start(BaseActivator.java:92)
       at org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:697)
       at org.apache.felix.framework.Felix.activateBundle(Felix.java:2240)
       at org.apache.felix.framework.Felix.startBundle(Felix.java:2146)
       at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1373)
       at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308)
       at java.lang.Thread.run(Thread.java:748)
      

      Other log messages suggest that bootstrap tries to contact repo1.maven.org for config files:

      2022-05-05 14:41:20,536+1000 ERROR [FelixStartLevel] *SYSTEM org.apache.karaf.features.internal.service.BootFeaturesInstaller - Error installing boot feature repository mvn:com.sonatype.nexus/nexus-pro-edition/3.38.1-01/xml/features
      java.lang.RuntimeException: Error resolving artifact com.sonatype.nexus:nexus-pro-edition:xml:features:3.38.1-01: [Could not transfer artifact com.sonatype.nexus:nexus-pro-edition:xml:features:3.38.1-01 from/to central (https://repo1.maven.org/maven2/): transfer failed for https://repo1.maven.org/maven2/com/sonatype/nexus/nexus-pro-edition/3.38.1-01/nexus-pro-edition-3.38.1-01-features.xml] : mvn:com.sonatype.nexus/nexus-pro-edition/3.38.1-01/xml/features
      at org.apache.karaf.features.internal.service.RepositoryImpl.load(RepositoryImpl.java:121)
      at org.apache.karaf.features.internal.service.RepositoryImpl.<init>(RepositoryImpl.java:51)
      at org.apache.karaf.features.internal.service.RepositoryCacheImpl.create(RepositoryCacheImpl.java:51)
      at org.apache.karaf.features.internal.service.FeaturesServiceImpl.addRepository(FeaturesServiceImpl.java:386)
      at org.apache.karaf.features.internal.service.FeaturesServiceImpl.addRepository(FeaturesServiceImpl.java:381)
      at org.apache.karaf.features.internal.service.BootFeaturesInstaller.addRepositories(BootFeaturesInstaller.java:118)
      at org.apache.karaf.features.internal.service.BootFeaturesInstaller.installBootFeatures(BootFeaturesInstaller.java:87)
      at org.apache.karaf.features.internal.service.BootFeaturesInstaller.start(BootFeaturesInstaller.java:81)
      at org.apache.karaf.features.internal.osgi.Activator.doStart(Activator.java:214)
      at org.apache.karaf.util.tracker.BaseActivator.start(BaseActivator.java:92)
      at org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:698)
      at org.apache.felix.framework.Felix.activateBundle(Felix.java:2402)
      at org.apache.felix.framework.Felix.startBundle(Felix.java:2308)
      at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1539)
      at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308)
      at java.lang.Thread.run(Thread.java:748)
      Caused by: java.io.IOException: Error resolving artifact com.sonatype.nexus:nexus-pro-edition:xml:features:3.38.1-01: [Could not transfer artifact com.sonatype.nexus:nexus-pro-edition:xml:features:3.38.1-01 from/to central (https://repo1.maven.org/maven2/): transfer failed for https://repo1.maven.org/maven2/com/sonatype/nexus/nexus-pro-edition/3.38.1-01/nexus-pro-edition-3.38.1-01-features.xml]
      

      Additionally, other findings have been made during analysis of this type of problem:

      • configuration files are modified during startup ( ie. nexus-3.39.0-01/etc/karaf/org.ops4j.pax.url.mvn.cfg )
      • startup seems to rely on at least trying to contact repo1.maven.org in some cases to download configuration files, and this can contribute to the reported problem
      • restarting or replacing the files that would be modified on startup seems to resolve the issue in most cases

      Expected

      • do NOT contact repo1.maven.org during startup for anything ( IF that is in fact happening as the logs suggest ) - contacting any external site to just bootstrap or start the server should not be attempted at all
      • all install files should normally just be extracted from the shipped binaries as needed
      • prevent partial writing of any needed configuration files during startup, that could then lead to startup failure.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              rseddon Rich Seddon
              Last Updated By:
              Rich Seddon Rich Seddon
              Team:
              NXRM - Optimus
              Votes:
              3 Vote for this issue
              Watchers:
              15 Start watching this issue

                Dates

                Created:
                Updated:
                Date of First Response:

                  tigCommentSecurity.panel-title