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

docker repository indexUrl validation can prevent start-up after upgrade to 3.13

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 3.13.0
    • Fix Version/s: None
    • Component/s: Docker, Scripting
    • Labels:

      Description

      In pre Nexus 3.13 it was possible to create a docker proxy repo with an empty indexUrl e.g.

      repository.createDockerProxy('docker-proxy','https://dockerRegistry','REGISTRY','',0,0,'prod',true,true)

       

      Changes introduced by --NEXUS-17416-- prevent this in 3.13 and for this version a value or null needs to be passed. As a result of this change, repos that were created pre 3.13 without an indexUrl and have been upgraded to 3.13 can prevent startup due to the following validation error:

      2018-07-25 17:51:19,024+0000 WARN [FelixStartLevel] *SYSTEM org.sonatype.nexus.repository.config.internal.ConfigurationFacetImpl - Validation failed; 1 constraints violated:
      1) URL should be in the format 'http://www.example.com', type: class org.sonatype.nexus.repository.config.internal.ConfigurationFacetImpl$SectionWrapper, property: attributes[dockerProxy].indexUrl, value:

      2018-07-25 17:51:19,050+0000 ERROR [FelixStartLevel] *SYSTEM org.sonatype.nexus.repository.manager.internal.RepositoryManagerImpl - Failed transition: NEW -> STARTED
      javax.validation.ConstraintViolationException: null
      at org.sonatype.nexus.repository.manager.internal.RepositoryImpl.validate(RepositoryImpl.java:174)
      at org.sonatype.nexus.repository.manager.internal.RepositoryManagerImpl.newRepository(RepositoryManagerImpl.java:173)
      at org.sonatype.nexus.repository.manager.internal.RepositoryManagerImpl.restoreRepositories(RepositoryManagerImpl.java:248)
      at org.sonatype.nexus.repository.manager.internal.RepositoryManagerImpl.doStart(RepositoryManagerImpl.java:230)
      at org.sonatype.nexus.common.stateguard.StateGuardLifecycleSupport.start(StateGuardLifecycleSupport.java:67)
      at org.sonatype.nexus.common.stateguard.MethodInvocationAction.run(MethodInvocationAction.java:39)
      at org.sonatype.nexus.common.stateguard.StateGuard$TransitionImpl.run(StateGuard.java:191)
      at org.sonatype.nexus.common.stateguard.TransitionsInterceptor.invoke(TransitionsInterceptor.java:56)
      at org.sonatype.nexus.extender.NexusLifecycleManager.startComponent(NexusLifecycleManager.java:155)
      at org.sonatype.nexus.extender.NexusLifecycleManager.to(NexusLifecycleManager.java:95)
      at org.sonatype.nexus.extender.NexusContextListener.frameworkEvent(NexusContextListener.java:191)
      at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1429)
      at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308)
      at java.lang.Thread.run(Thread.java:748)
      2018-07-25 17:51:19,055+0000 ERROR [FelixStartLevel] *SYSTEM org.sonatype.nexus.extender.NexusContextListener - Failed to start nexus
      javax.validation.ConstraintViolationException: null
      at org.sonatype.nexus.repository.manager.internal.RepositoryImpl.validate(RepositoryImpl.java:174)
      at org.sonatype.nexus.repository.manager.internal.RepositoryManagerImpl.newRepository(RepositoryManagerImpl.java:173)
      at org.sonatype.nexus.repository.manager.internal.RepositoryManagerImpl.restoreRepositories(RepositoryManagerImpl.java:248)
      at org.sonatype.nexus.repository.manager.internal.RepositoryManagerImpl.doStart(RepositoryManagerImpl.java:230)
      at org.sonatype.nexus.common.stateguard.StateGuardLifecycleSupport.start(StateGuardLifecycleSupport.java:67)
      at org.sonatype.nexus.common.stateguard.MethodInvocationAction.run(MethodInvocationAction.java:39)
      at org.sonatype.nexus.common.stateguard.StateGuard$TransitionImpl.run(StateGuard.java:191)
      at org.sonatype.nexus.common.stateguard.TransitionsInterceptor.invoke(TransitionsInterceptor.java:56)
      at org.sonatype.nexus.extender.NexusLifecycleManager.startComponent(NexusLifecycleManager.java:155)
      at org.sonatype.nexus.extender.NexusLifecycleManager.to(NexusLifecycleManager.java:95)
      at org.sonatype.nexus.extender.NexusContextListener.frameworkEvent(NexusContextListener.java:191)
      at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1429)
      at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308)
      at java.lang.Thread.run(Thread.java:748)

      Workaround, set the indexUrl via the UI prior to upgrade or run config DB update to set url directly against the repository class.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              rseddon Rich Seddon
              Reporter:
              hardeepn Hardeep Nagra
              CC:
              Lawrence Poon
              Last Updated By:
              Peter Lynch Peter Lynch
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Date of First Response:

                  tigCommentSecurity.panel-title