Support Questions

Find answers, ask questions, and share your expertise

Rpm build error when build ambari from source

New Contributor

I am build it on Centos7.2, jdk 1.8, maven3.1.1, python 2.7(there is no python2.6 on my machine)。

The error says:

[INFO] [INFO] --- rpm-maven-plugin:2.1.4:rpm (default-cli) @ ambari-server --- [INFO] Directory /opt/ambari-release-2.5.2/ambari-server/target/rpm/ambari-server/BUILD already exists. Deleting all contents. [INFO] Directory /opt/ambari-release-2.5.2/ambari-server/target/rpm/ambari-server/RPMS already exists. Deleting all contents. [INFO] Directory /opt/ambari-release-2.5.2/ambari-server/target/rpm/ambari-server/SOURCES already exists. Deleting all contents. [INFO] Directory /opt/ambari-release-2.5.2/ambari-server/target/rpm/ambari-server/SPECS already exists. Deleting all contents. [INFO] Directory /opt/ambari-release-2.5.2/ambari-server/target/rpm/ambari-server/SRPMS already exists. Deleting all contents. [INFO] Directory /opt/ambari-release-2.5.2/ambari-server/target/rpm/ambari-server/tmp-buildroot already exists. Deleting all contents. [INFO] Directory /opt/ambari-release-2.5.2/ambari-server/target/rpm/ambari-server/buildroot already exists. Deleting all contents. [INFO] Copying files to /opt/ambari-release-2.5.2/ambari-server/target/rpm/ambari-server/tmp-buildroot/etc [INFO] Copying files to /opt/ambari-release-2.5.2/ambari-server/target/rpm/ambari-server/tmp-buildroot/usr/sbin [INFO] Copying files to /opt/ambari-release-2.5.2/ambari-server/target/rpm/ambari-server/tmp-buildroot/usr/lib/ambari-server [INFO] Copying files to /opt/ambari-release-2.5.2/ambari-server/target/rpm/ambari-server/tmp-buildroot/var/lib/ambari-server [INFO] Copying files to /opt/ambari-release-2.5.2/ambari-server/target/rpm/ambari-server/tmp-buildroot/usr/lib/python2.6/site-packages [INFO] Copying files to /opt/ambari-release-2.5.2/ambari-server/target/rpm/ambari-server/tmp-buildroot/var/log/ambari-server [INFO] Mapping empty with destination: ambari-server [INFO] Copying files to /opt/ambari-release-2.5.2/ambari-server/target/rpm/ambari-server/tmp-buildroot/var/run/ambari-server [INFO] Creating spec file /opt/ambari-release-2.5.2/ambari-server/target/rpm/ambari-server/SPECS/ambari-server.spec [INFO] Building target platforms: x86_64-redhat-linux [INFO] Building for target x86_64-redhat-linux [INFO] Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.Mbpkb3 [INFO] + umask 022 [INFO] + cd /opt/ambari-release-2.5.2/ambari-server/target/rpm/ambari-server/BUILD [INFO] + '[' /opt/ambari-release-2.5.2/ambari-server/target/rpm/ambari-server/buildroot '!=' / ']' [INFO] + rm -rf /opt/ambari-release-2.5.2/ambari-server/target/rpm/ambari-server/buildroot [INFO] ++ dirname /opt/ambari-release-2.5.2/ambari-server/target/rpm/ambari-server/buildroot [INFO] + mkdir -p /opt/ambari-release-2.5.2/ambari-server/target/rpm/ambari-server [INFO] + mkdir /opt/ambari-release-2.5.2/ambari-server/target/rpm/ambari-server/buildroot [INFO] + '[' -d /opt/ambari-release-2.5.2/ambari-server/target/rpm/ambari-server/buildroot ']' [INFO] + mv /opt/ambari-release-2.5.2/ambari-server/target/rpm/ambari-server/tmp-buildroot/etc /opt/ambari-release-2.5.2/ambari-server/target/rpm/ambari-server/tmp-buildroot/usr /opt/ambari-release-2.5.2/ambari-server/target/rpm/ambari-server/tmp-buildroot/var /opt/ambari-release-2.5.2/ambari-server/target/rpm/ambari-server/buildroot [INFO] + chmod -R +w /opt/ambari-release-2.5.2/ambari-server/target/rpm/ambari-server/buildroot [INFO] + /usr/lib/rpm/check-buildroot [INFO] + /usr/lib/rpm/redhat/brp-compress [INFO] + /usr/lib/rpm/redhat/brp-strip /usr/bin/strip [INFO] + /usr/lib/rpm/redhat/brp-strip-comment-note /usr/bin/strip /usr/bin/objdump [INFO] + /usr/lib/rpm/redhat/brp-strip-static-archive /usr/bin/strip [INFO] + /usr/lib/rpm/brp-python-bytecompile /usr/bin/python 1 [INFO] Bytecompiling .py files below /opt/ambari-release-2.5.2/ambari-server/target/rpm/ambari-server/buildroot/usr/lib/python2.6 using /usr/bin/python2.6 [INFO] /usr/lib/rpm/brp-python-bytecompile: line 44: /usr/bin/python2.6: No such file or directory [INFO] [INFO] [INFO] RPM build errors: [INFO] error: Bad exit status from /var/tmp/rpm-tmp.Mbpkb3 (%install) [INFO] Bad exit status from /var/tmp/rpm-tmp.Mbpkb3 (%install) [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary: [INFO] [INFO] Ambari Server ..................................... FAILURE [4:12.077s] [INFO] Ambari Functional Tests ........................... SKIPPED [INFO] Ambari Agent ...................................... SKIPPED [INFO] Ambari Client ..................................... SKIPPED [INFO] Ambari Python Client .............................. SKIPPED [INFO] Ambari Groovy Client .............................. SKIPPED [INFO] Ambari Shell ...................................... SKIPPED [INFO] Ambari Python Shell ............................... SKIPPED [INFO] Ambari Groovy Shell ............................... SKIPPED [INFO] ambari-logsearch .................................. SKIPPED [INFO] Ambari Logsearch Appender ......................... SKIPPED [INFO] Ambari Logsearch Portal ........................... SKIPPED [INFO] Ambari Logsearch Log Feeder ....................... SKIPPED [INFO] Ambari Logsearch Solr Client ...................... SKIPPED [INFO] Ambari Infra Solr Plugin .......................... SKIPPED [INFO] Ambari Logsearch Assembly ......................... SKIPPED [INFO] Ambari Logsearch Integration Test ................. SKIPPED [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 4:23.269s [INFO] Finished at: Thu Nov 23 23:08:13 PST 2017 [INFO] Final Memory: 42M/269M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.codehaus.mojo:rpm-maven-plugin:2.1.4:rpm (default-cli) on project ambari-server: RPM build execution returned: '1' executing '/bin/sh -c cd '/opt/ambari-release-2.5.2/ambari-server/target/rpm/ambari-server/SPECS' && 'rpmbuild' '-bb' '--target' 'x86_64-redhat-linux' '--buildroot' '/opt/ambari-release-2.5.2/ambari-server/target/rpm/ambari-server/buildroot' '--define' '_topdir /opt/ambari-release-2.5.2/ambari-server/target/rpm/ambari-server' '--define' '_build_name_fmt %%{ARCH}/%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm' '--define' '_builddir %{_topdir}/BUILD' '--define' '_rpmdir %{_topdir}/RPMS' '--define' '_sourcedir %{_topdir}/SOURCES' '--define' '_specdir %{_topdir}/SPECS' '--define' '_srcrpmdir %{_topdir}/SRPMS' 'ambari-server.spec'' -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:rpm-maven-plugin:2.1.4:rpm (default-cli) on project ambari-server: RPM build execution returned: '1' executing '/bin/sh -c cd '/opt/ambari-release-2.5.2/ambari-server/target/rpm/ambari-server/SPECS' && 'rpmbuild' '-bb' '--target' 'x86_64-redhat-linux' '--buildroot' '/opt/ambari-release-2.5.2/ambari-server/target/rpm/ambari-server/buildroot' '--define' '_topdir /opt/ambari-release-2.5.2/ambari-server/target/rpm/ambari-server' '--define' '_build_name_fmt %%{ARCH}/%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm' '--define' '_builddir %{_topdir}/BUILD' '--define' '_rpmdir %{_topdir}/RPMS' '--define' '_sourcedir %{_topdir}/SOURCES' '--define' '_specdir %{_topdir}/SPECS' '--define' '_srcrpmdir %{_topdir}/SRPMS' 'ambari-server.spec'' at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59) at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:555) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214) at org.apache.maven.cli.MavenCli.main(MavenCli.java:158) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) Caused by: org.apache.maven.plugin.MojoExecutionException: RPM build execution returned: '1' executing '/bin/sh -c cd '/opt/ambari-release-2.5.2/ambari-server/target/rpm/ambari-server/SPECS' && 'rpmbuild' '-bb' '--target' 'x86_64-redhat-linux' '--buildroot' '/opt/ambari-release-2.5.2/ambari-server/target/rpm/ambari-server/buildroot' '--define' '_topdir /opt/ambari-release-2.5.2/ambari-server/target/rpm/ambari-server' '--define' '_build_name_fmt %%{ARCH}/%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm' '--define' '_builddir %{_topdir}/BUILD' '--define' '_rpmdir %{_topdir}/RPMS' '--define' '_sourcedir %{_topdir}/SOURCES' '--define' '_specdir %{_topdir}/SPECS' '--define' '_srcrpmdir %{_topdir}/SRPMS' 'ambari-server.spec'' at org.codehaus.mojo.rpm.RPMHelper.buildPackage(RPMHelper.java:169) at org.codehaus.mojo.rpm.AbstractRPMMojo.execute(AbstractRPMMojo.java:706) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:106) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208) ... 19 more [ERROR] [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

I found nothing in directory "/opt/ambari-release-2.5.2/ambari-server/target/rpm/ambari-server/tmp-buildroot".

i thought that may be the problem, but i didn't know how to resolve it.

appreciate your help !

2 REPLIES 2

New Contributor

And when i run the command independently i get the error below:

[root@hadoop SPECS]# /bin/sh -c cd '/opt/ambari-release-2.5.2/ambari-server/target/rpm/ambari-server/SPECS' && 'rpmbuild' '-bb' '--target' 'x86_64-redhat-linux' '--buildroot' '/opt/ambari-release-2.5.2/ambari-server/target/rpm/ambari-server/buildroot' '--define' '_topdir /opt/ambari-release-2.5.2/ambari-server/target/rpm/ambari-server' '--define' '_build_name_fmt %%{ARCH}/%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm' '--define' '_builddir %{_topdir}/BUILD' '--define' '_rpmdir %{_topdir}/RPMS' '--define' '_sourcedir %{_topdir}/SOURCES' '--define' '_specdir %{_topdir}/SPECS' '--define' '_srcrpmdir %{_topdir}/SRPMS' 'ambari-server.spec' Building target platforms: x86_64-redhat-linux Building for target x86_64-redhat-linux Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.XHjILM + umask 022 + cd /opt/ambari-release-2.5.2/ambari-server/target/rpm/ambari-server/BUILD + '[' /opt/ambari-release-2.5.2/ambari-server/target/rpm/ambari-server/buildroot '!=' / ']' + rm -rf /opt/ambari-release-2.5.2/ambari-server/target/rpm/ambari-server/buildroot ++ dirname /opt/ambari-release-2.5.2/ambari-server/target/rpm/ambari-server/buildroot + mkdir -p /opt/ambari-release-2.5.2/ambari-server/target/rpm/ambari-server + mkdir /opt/ambari-release-2.5.2/ambari-server/target/rpm/ambari-server/buildroot + '[' -d /opt/ambari-release-2.5.2/ambari-server/target/rpm/ambari-server/buildroot ']' + mv '/opt/ambari-release-2.5.2/ambari-server/target/rpm/ambari-server/tmp-buildroot/*' /opt/ambari-release-2.5.2/ambari-server/target/rpm/ambari-server/buildroot mv: cannot stat '/opt/ambari-release-2.5.2/ambari-server/target/rpm/ambari-server/tmp-buildroot/*': No such file or directory error: Bad exit status from /var/tmp/rpm-tmp.XHjILM (%install)

appreciate any help.

New Contributor

the problem has solved, I add python2.6 to my machine ,it works.

however new error occours, the rpm package's size turns out to be much smaller than it should be.

43738-tim截图20171129100855.png

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.