ENTRY

"Nexus and Yum Repository Serving. Thoughts on how it works and why it may never work for your linux distro"

Date:July 1st, 2014
Tags:
Comments: 0
  • Join date: 11-30-99
  • Posts: 12
View Counter:
  • 1,639 views
Rate it
Ad
Poll
  • How does version control (VCS) work in your enterprise?

    View Results

    Loading ... Loading ...
Feeds:
  • bodytext bodytext bodytext
💡 Sonatype Nexus can yum. But, it doesn’t seem to provide all rpm/yum etc… functionality. The Nexus Yum Plugin is rather a wrapper allowing system calls. And you system better be prepared, or you get no yum repo from Nexus.

Here I would like to talk about Yum Capabilities of Nexus and why it may never work for you if you make a wrong choice of OS.

Yum Repo on Nexus

So, I have a Sonatype Nexus Standard Editioon and I want to have one of the repositories working as a Yum / Rhel Tarball server.

Principle is simple. Smth like :

Errors, not working

Well, not exactly working. After having it running, my nexus.log got regular errors with stack-trace like :

2014-06-16 13:37:43 WARN  [pool-1-thread-5] - org.sonatype.nexus.yum.internal.task.MergeMetadataTask - Scheduled task (MergeMetadataTask) failed :: Merging Yum metadata in repository 'public' (started 2014-06-16T13:37:43+02:00, runtime 0:00:00.081)
java.io.IOException: Cannot run program "mergerepo" (in directory "."): error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1041) ~[na:1.7.0_55]
at java.lang.Runtime.exec(Runtime.java:617) ~[na:1.7.0_55]
at org.apache.commons.exec.launcher.Java13CommandLauncher.exec(Java13Comman dLauncher.java:58) ~[na:na]
at org.apache.commons.exec.DefaultExecutor.launch(DefaultExecutor.java:254) ~[na:na]
at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor. java:319) ~[na:na]
at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:160 ) ~[na:na]
at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:147 ) ~[na:na]
at org.sonatype.nexus.yum.internal.task.CommandLineExecutor.exec(CommandLin eExecutor.java:40) ~[na:na]
at org.sonatype.nexus.yum.internal.task.MergeMetadataTask.doRun(MergeMetada taTask.java:89) ~[na:na]
at org.sonatype.nexus.yum.internal.task.MergeMetadataTask.doRun(MergeMetada taTask.java:52) ~[na:na]
at org.sonatype.nexus.scheduling.AbstractNexusTask.call(AbstractNexusTask.j ava:166) ~[nexus-app-2.3.1-01.jar:2.3.1-01]
at org.sonatype.scheduling.DefaultScheduledTask.call(DefaultScheduledTask.j ava:459) [sisu-task-scheduler-1.7.jar:na]
at java.util.concurrent.FutureTask.run(FutureTask.java:262) [na:1.7.0_55]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.acc ess$201(ScheduledThreadPoolExecutor.java:178) [na:1.7.0_55]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run (ScheduledThreadPoolExecutor.java:292) [na:1.7.0_55]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.jav a:1145) [na:1.7.0_55]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.ja va:615) [na:1.7.0_55]
at java.lang.Thread.run(Thread.java:744) [na:1.7.0_55]
Caused by: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.forkAndExec(Native Method) ~[na:1.7.0_55]
at java.lang.UNIXProcess.<init>(UNIXProcess.java:135) ~[na:1.7.0_55]
at java.lang.ProcessImpl.start(ProcessImpl.java:130) ~[na:1.7.0_55]
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1022) ~[na:1.7.0_55]
... 17 common frames omitted
2014-06-16 13:37:43 DEBUG [pool-1-thread-5] - org.sonatype.sisu.goodies.eventbus.internal.DefaultEventBus - Event 'LogbackLoggingEvent [level=WARN, message=Scheduled task (MergeMetadataTask) failed :: Merging Yum metadata in repository 'public' (started 2014-06-16T13:37:43+02:00, runtime 0:00:00.081), throwable=java.io.IOException]' fired
2014-06-16 13:37:43 DEBUG [pool-1-thread-5] - org.sonatype.sisu.goodies.eventbus.internal.DefaultEventBus - Event 'NexusTaskEventStoppedFailed{nexusTask=org.sonatype.nexus.yum.internal.t ask.MergeMetadataTask@1846eea2}' fired
2014-06-16 13:37:44 DEBUG [pool-1-thread-5] - org.sonatype.nexus.feeds.DefaultFeedRecorder - Merging Yum metadata in repository 'public' : Process started on Mon Jun 16 13:37:43 CEST 2014, finished on Mon Jun 16 13:37:43 CEST 2014 with error. Error message is: java.io.IOException, Cannot run program "mergerepo" (in directory "."): error=2, No such file or directory Strack trace: java.io.IOException: Cannot run program "mergerepo" (in directory "."): error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1041)
at java.lang.Runtime.exec(Runtime.java:617)
at org.apache.commons.exec.launcher.Java13CommandLauncher.exec(Java13Comman dLauncher.java:58)
at org.apache.commons.exec.DefaultExecutor.launch(DefaultExecutor.java:254)
at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor. java:319)
at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:160 )
at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:147 )
at org.sonatype.nexus.yum.internal.task.CommandLineExecutor.exec(CommandLin eExecutor.java:40)
at org.sonatype.nexus.yum.internal.task.MergeMetadataTask.doRun(MergeMetada taTask.java:89)
at org.sonatype.nexus.yum.internal.task.MergeMetadataTask.doRun(MergeMetada taTask.java:52)
at org.sonatype.nexus.scheduling.AbstractNexusTask.call(AbstractNexusTask.j ava:166)
at org.sonatype.scheduling.DefaultScheduledTask.call(DefaultScheduledTask.j ava:459)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.acc ess$201(ScheduledThreadPoolExecutor.java:178)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run (ScheduledThreadPoolExecutor.java:292)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.jav a:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.ja va:615)
at java.lang.Thread.run(Thread.java:744)
Caused by: java.io.IOException: error=2, No such file or directory
Caused by: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.<init>(UNIXProcess.java:135)
at java.lang.ProcessImpl.start(ProcessImpl.java:130)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1022)
... 17 more

java.io.IOException: Cannot run program "mergerepo" (in directory "."): error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1041) ~[na:1.7.0_55]
at java.lang.Runtime.exec(Runtime.java:617) ~[na:1.7.0_55]
at org.apache.commons.exec.launcher.Java13CommandLauncher.exec(Java13Comman dLauncher.java:58) ~[na:na]
at org.apache.commons.exec.DefaultExecutor.launch(DefaultExecutor.java:254) ~[na:na]
at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor. java:319) ~[na:na]
at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:160 ) ~[na:na]
at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:147 ) ~[na:na]
at org.sonatype.nexus.yum.internal.task.CommandLineExecutor.exec(CommandLin eExecutor.java:40) ~[na:na]
at org.sonatype.nexus.yum.internal.task.MergeMetadataTask.doRun(MergeMetada taTask.java:89) ~[na:na]
at org.sonatype.nexus.yum.internal.task.MergeMetadataTask.doRun(MergeMetada taTask.java:52) ~[na:na]
at org.sonatype.nexus.scheduling.AbstractNexusTask.call(AbstractNexusTask.j ava:166) ~[nexus-app-2.3.1-01.jar:2.3.1-01]
at org.sonatype.scheduling.DefaultScheduledTask.call(DefaultScheduledTask.j ava:459) ~[sisu-task-scheduler-1.7.jar:na]
at java.util.concurrent.FutureTask.run(FutureTask.java:262) ~[na:1.7.0_55]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.acc ess$201(ScheduledThreadPoolExecutor.java:178) [na:1.7.0_55]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run (ScheduledThreadPoolExecutor.java:292) [na:1.7.0_55]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.jav a:1145) [na:1.7.0_55]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.ja va:615) [na:1.7.0_55]
at java.lang.Thread.run(Thread.java:744) [na:1.7.0_55]
Caused by: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.forkAndExec(Native Method) ~[na:1.7.0_55]
at java.lang.UNIXProcess.<init>(UNIXProcess.java:135) ~[na:1.7.0_55]
at java.lang.ProcessImpl.start(ProcessImpl.java:130) ~[na:1.7.0_55]
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1022) ~[na:1.7.0_55]
... 17 common frames omitted
2014-06-16 13:51:19 DEBUG [Thread-12      ] - org.apache.shiro.session.mgt.ExecutorServiceSessionValidationScheduler - Executing session validation...
2014-06-16 13:51:20 INFO  [Thread-12      ] - org.apache.shiro.session.mgt.AbstractValidatingSessionManager - Validating all active sessions...
2014-06-16 13:51:20 INFO  [Thread-12      ] - org.apache.shiro.session.mgt.AbstractValidatingSessionManager - Finished session validation.  No sessions were stopped.
2014-06-16 13:51:20 DEBUG [Thread-12      ] - org.apache.shiro.session.mgt.ExecutorServiceSessionValidationScheduler - Session validation completed successfully in 0 milliseconds.
2014-06-16 13:59:19 DEBUG [1011923020-2497] - org.apache.shiro.session.mgt.DefaultSessionManager - Unable to resolve session ID from SessionKey [org.apache.shiro.web.session.mgt.WebSessionKey@40d0c73e].  Returning null to indicate a session could not

Analyzing, what seems to be the problem

To be exact, Nexus just fires the console command like :

mergerepo --nogroups -d --repo=file:/data/nexus/storage/repo1/ --repo=file:/data/nexus/storage/repo2/ -o /data/nexus/storage/reporesult

And that fails, but why …

mergerepo command is a part of createrepo tool, which allows creating YUM repos and doing other cool things with them.

My version is

> createrepo --version
0.4.9

http://packages.ubuntu.com/de/precise/createrepo

Since my version there are many things happened to the tool, described here :
http://www.rpmfind.net/linux/RPM/atrpms/el5/x86_64/testing/createrepo-0.9.7-4_13.el5.noarch.html

And this I like most :

* Tue Oct 28 2008 Seth Vidal - 0.9.6-1
- 0.9.6-1
- add mergerepo

My Linux Distro seems to have a tool version which doesn’t have mergerepo in it :(

Choose your Linux Distro wisely or your Nexus Yum may never work

We are running on Ubuntu Precise, 12.04 LTS (not my choice). And this version has very outdated version of createrepo.
I have never found any requirement on the part of sonatype nexus repo or Nexus Yum Plugin, stating that to work in needs specific features from the linux Distro.
And yet, I think that is a fact, and if you choose now and want this feature to work, maybe verify which version of createrepo your distro has, newer is better.
Once again, Nexus only relies on OS capabilities of OS to properly work with yum. So, the caps need to be there.

Yes, there may always be an option to compile your packages, and it will work too, especially if source code doesn’t need all types of newer libraries.
Preferably, there is a proper package for your distro to begin with.

Be Sociable, Share!
 
Interesting entry?
VN:F [1.8.5_1061]
Rating: +3 (from 3 votes)
3 votes 'YES'  0 votes 'NO'


TAGS
No tags for this post.

RELATED
Pages
Posts

SOCIAL
Be Sociable, Share!

INCOMING SEARCH TERMS



Responces

Leave a Reply