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

a docker connector port set to the same value as one of the main Nexus Repository jetty connector ports can prevent startup

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: New
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 3.26.1
    • Fix Version/s: None
    • Component/s: Docker
    • Labels:
      None
    • Notability:
      n/a

      Description

      In general, when a docker repository port is configured to a value of a port already in use by any other process on the host, this will not prevent startup of NXRM: NEXUS-19527

      A special case exists where if a docker repository http or https port is configured to be matching the same port as the same NXRM instance Jetty application connector ports, then startup will fail.

      Reproduce

      Start NXRM with default 8081 port.
      Add a docker repo with http port of 9081.
      Shut down NXRM and edit etc/nexus.properties application-port value to be 9081
      Try to start NXRM. Startup will fail with logs containing a message similar to:

      2020-09-14 10:53:02,573-0300 WARN  [FelixStartLevel] *SYSTEM org.sonatype.nexus.repository.docker.internal.DockerConnectorFacetImpl - Validation failed; 1 constraints violated:
        1) Port is already in use, type: class org.sonatype.nexus.validation.ConstraintViolationFactory$HelperBean, property: attributes.docker.httpsPort, value: org.sonatype.nexus.validation.ConstraintViolationFactory$HelperBean@7e86c050
      
      2020-09-14 10:53:02,584-0300 ERROR [FelixStartLevel] *SYSTEM org.sonatype.nexus.repository.manager.internal.RepositoryManagerImpl - Failed transition: NEW -> STARTED
      javax.validation.ConstraintViolationException: attributes.docker.httpsPort: Port is already in use
      	at org.sonatype.nexus.repository.manager.internal.RepositoryImpl.validate(RepositoryImpl.java:174)
      	at org.sonatype.nexus.repository.manager.internal.RepositoryManagerImpl.newRepository(RepositoryManagerImpl.java:192)
      	at org.sonatype.nexus.repository.manager.internal.RepositoryManagerImpl.restoreRepositories(RepositoryManagerImpl.java:269)
      	at org.sonatype.nexus.repository.manager.internal.RepositoryManagerImpl.doStart(RepositoryManagerImpl.java:251)
      	at org.sonatype.nexus.common.stateguard.StateGuardLifecycleSupport.start(StateGuardLifecycleSupport.java:69)
      	at org.sonatype.nexus.common.stateguard.MethodInvocationAction.run(MethodInvocationAction.java:39)
      	at org.sonatype.nexus.common.stateguard.StateGuard$TransitionImpl.run(StateGuard.java:193)
      	at org.sonatype.nexus.common.stateguard.TransitionsInterceptor.invoke(TransitionsInterceptor.java:56)
      	at org.sonatype.nexus.extender.NexusLifecycleManager.startComponent(NexusLifecycleManager.java:199)
      	at org.sonatype.nexus.extender.NexusLifecycleManager.to(NexusLifecycleManager.java:111)
      	at org.sonatype.nexus.extender.NexusContextListener.moveToPhase(NexusContextListener.java:321)
      	at org.sonatype.nexus.extender.NexusContextListener.frameworkEvent(NexusContextListener.java:218)
      	at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1431)
      	at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308)
      	at java.lang.Thread.run(Thread.java:748)
      2020-09-14 10:53:02,588-0300 ERROR [FelixStartLevel] *SYSTEM org.sonatype.nexus.extender.NexusContextListener - Failed to start nexus
      javax.validation.ConstraintViolationException: attributes.docker.httpsPort: Port is already in use
      	at org.sonatype.nexus.repository.manager.internal.RepositoryImpl.validate(RepositoryImpl.java:174)
      	at org.sonatype.nexus.repository.manager.internal.RepositoryManagerImpl.newRepository(RepositoryManagerImpl.java:192)
      	at org.sonatype.nexus.repository.manager.internal.RepositoryManagerImpl.restoreRepositories(RepositoryManagerImpl.java:269)
      	at org.sonatype.nexus.repository.manager.internal.RepositoryManagerImpl.doStart(RepositoryManagerImpl.java:251)
      	at org.sonatype.nexus.common.stateguard.StateGuardLifecycleSupport.start(StateGuardLifecycleSupport.java:69)
      	at org.sonatype.nexus.common.stateguard.MethodInvocationAction.run(MethodInvocationAction.java:39)
      	at org.sonatype.nexus.common.stateguard.StateGuard$TransitionImpl.run(StateGuard.java:193)
      	at org.sonatype.nexus.common.stateguard.TransitionsInterceptor.invoke(TransitionsInterceptor.java:56)
      	at org.sonatype.nexus.extender.NexusLifecycleManager.startComponent(NexusLifecycleManager.java:199)
      	at org.sonatype.nexus.extender.NexusLifecycleManager.to(NexusLifecycleManager.java:111)
      	at org.sonatype.nexus.extender.NexusContextListener.moveToPhase(NexusContextListener.java:321)
      	at org.sonatype.nexus.extender.NexusContextListener.frameworkEvent(NexusContextListener.java:218)
      	at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1431)
      	at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308)
      	at java.lang.Thread.run(Thread.java:748)
      2020-09-14 10:53:02,589-0300 ERROR [FelixStartLevel] *SYSTEM Felix - Framework listener delivery error.
      javax.validation.ConstraintViolationException: attributes.docker.httpsPort: Port is already in use
      	at org.sonatype.nexus.repository.manager.internal.RepositoryImpl.validate(RepositoryImpl.java:174)
      	at org.sonatype.nexus.repository.manager.internal.RepositoryManagerImpl.newRepository(RepositoryManagerImpl.java:192)
      	at org.sonatype.nexus.repository.manager.internal.RepositoryManagerImpl.restoreRepositories(RepositoryManagerImpl.java:269)
      	at org.sonatype.nexus.repository.manager.internal.RepositoryManagerImpl.doStart(RepositoryManagerImpl.java:251)
      	at org.sonatype.nexus.common.stateguard.StateGuardLifecycleSupport.start(StateGuardLifecycleSupport.java:69)
      	at org.sonatype.nexus.common.stateguard.MethodInvocationAction.run(MethodInvocationAction.java:39)
      	at org.sonatype.nexus.common.stateguard.StateGuard$TransitionImpl.run(StateGuard.java:193)
      	at org.sonatype.nexus.common.stateguard.TransitionsInterceptor.invoke(TransitionsInterceptor.java:56)
      	at org.sonatype.nexus.extender.NexusLifecycleManager.startComponent(NexusLifecycleManager.java:199)
      	at org.sonatype.nexus.extender.NexusLifecycleManager.to(NexusLifecycleManager.java:111)
      	at org.sonatype.nexus.extender.NexusContextListener.moveToPhase(NexusContextListener.java:321)
      	at org.sonatype.nexus.extender.NexusContextListener.frameworkEvent(NexusContextListener.java:218)
      	at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1431)
      	at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308)
      	at java.lang.Thread.run(Thread.java:748)
      
      

      Expected

      The main application-port / application-port-https ports should always take precedence over individual repo connector ports and where a conflict occurs, only the repo connector is allowed to fail starting. NXRM application should not be prevented from starting.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              plynch Peter Lynch
              Last Updated By:
              Joe Tom Joe Tom
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Date of First Response:

                  tigCommentSecurity.panel-title