5 Replies Latest reply on Oct 3, 2012 12:47 PM by jbossfu

    ec2 Builds failing on kvm meta appliance with local repos

    fcoj

      When not specifying any repo's I can successfully create ami's, however when use a local repo it doesn't work at all. I have included the command, the appl file and errors that occur in the logs. It looks like all the rpm's are downloaded and installed so confused as to what the difference is. Any pointers would be much appreciated.

       

      Command

      boxgrinder-build centos-ha.appl -p ec2 -d ami

       

      Appl file

      cat centos5.appl

      name: centos5-standard

      summary: "CentOS 5 Standard"

      os:

        name: centos

        version: 5

      hardware:

        partitions:

          "/":

            size: 8

      default_repos: false

      repos:

        - name: "Centos_5_OS"

          baseurl: "http://repo-production/mrepo/CentOS-5.5-x86_64/RPMS.os/"

          ephemeral: false

      packages:

        - @core

       

      D, [2012-05-16T20:24:07.260782 #18012] DEBUG -- : Installing: libselinux                   ####################### [77/98]

      D, [2012-05-16T20:24:07.376321 #18012] DEBUG -- : Installing: MAKEDEV                      ####################### [78/98]

      D, [2012-05-16T20:24:07.387078 #18012] DEBUG -- : /var/tmp/rpm-tmp.vDBjjg: line 5: touch: command not found

      D, [2012-05-16T20:24:07.387867 #18012] DEBUG -- : /var/tmp/rpm-tmp.vDBjjg: line 5: touch: command not found

      D, [2012-05-16T20:24:07.388493 #18012] DEBUG -- : /var/tmp/rpm-tmp.vDBjjg: line 5: touch: command not found

      D, [2012-05-16T20:24:07.389194 #18012] DEBUG -- : /var/tmp/rpm-tmp.vDBjjg: line 5: touch: command not found

      D, [2012-05-16T20:24:07.389747 #18012] DEBUG -- : warning: %post(rsyslog-3.22.1-3.el5.x86_64) scriptlet failed, exit status 127

      D, [2012-05-16T20:24:07.594814 #18012] DEBUG -- : Installing: rsyslog                      ####################### [79/98]

      D, [2012-05-16T20:24:07.623721 #18012] DEBUG -- : /var/tmp/rpm-tmp.IhzPFN: line 10: cat: command not found

      D, [2012-05-16T20:24:07.624337 #18012] DEBUG -- : /var/tmp/rpm-tmp.IhzPFN: line 11: rm: command not found

      D, [2012-05-16T20:24:07.625150 #18012] DEBUG -- : /var/tmp/rpm-tmp.IhzPFN: line 26: install: command not found

      D, [2012-05-16T20:24:07.625852 #18012] DEBUG -- : /var/tmp/rpm-tmp.IhzPFN: line 29: install: command not found

      D, [2012-05-16T20:24:07.626744 #18012] DEBUG -- : warning: %post(pam-0.99.6.2-6.el5_4.1.x86_64) scriptlet failed, exit status 127

      D, [2012-05-16T20:24:07.934461 #18012] DEBUG -- : Installing: pam                          ####################### [80/98]

      D, [2012-05-16T20:24:08.061738 #18012] DEBUG -- : Installing: coreutils                    ####################### [81/98]

      D, [2012-05-16T20:24:08.284886 #18012] DEBUG -- : Installing: udev                         ####################### [82/98]

      D, [2012-05-16T20:24:08.352057 #18012] DEBUG -- : Installing: util-linux                   ####################### [83/98]

      D, [2012-05-16T20:24:08.370237 #18012] DEBUG -- : Installing: krb5-libs                    ####################### [84/98]

      D, [2012-05-16T20:24:08.408188 #18012] DEBUG -- : Installing: mcstrans                     ####################### [85/98]

      D, [2012-05-16T20:24:08.601186 #18012] DEBUG -- : Installing: module-init-tools            ####################### [86/98]

      D, [2012-05-16T20:24:08.652905 #18012] DEBUG -- : Installing: initscripts                  ####################### [87/98]

      D, [2012-05-16T20:24:08.668332 #18012] DEBUG -- : Installing: mkinitrd                     ####################### [88/98]

      D, [2012-05-16T20:24:08.681267 #18012] DEBUG -- : Installing: libselinux-utils             ####################### [89/98]

      D, [2012-05-16T20:24:08.694437 #18012] DEBUG -- : Installing: vim-minimal                  ####################### [90/98]

      D, [2012-05-16T20:24:08.729293 #18012] DEBUG -- : Installing: newt                         ####################### [91/98]

      D, [2012-05-16T20:24:08.775194 #18012] DEBUG -- : Installing: openldap                     ####################### [92/98]

      D, [2012-05-16T20:24:08.838683 #18012] DEBUG -- : Installing: sudo                         ####################### [93/98]

      D, [2012-05-16T20:24:10.806769 #18012] DEBUG -- : Installing: system-config-securitylevel- ####################### [94/98]

      D, [2012-05-16T20:24:13.447276 #18012] DEBUG -- : Installing: kernel                       ####################### [95/98]

      D, [2012-05-16T20:24:13.537331 #18012] DEBUG -- : Installing: curl                         ####################### [96/98]

      D, [2012-05-16T20:24:14.183830 #18012] DEBUG -- : Installing: grub                         ####################### [97/98]

      D, [2012-05-16T20:24:14.552759 #18012] DEBUG -- : Installing: setarch                      ####################### [98/98]

      D, [2012-05-16T20:24:14.552943 #18012] DEBUG -- :

      D, [2012-05-16T20:24:14.553111 #18012] DEBUG -- : Traceback (most recent call last):

      D, [2012-05-16T20:24:14.553231 #18012] DEBUG -- : File "/usr/bin/appliance-creator", line 164, in <module>

      D, [2012-05-16T20:24:14.553825 #18012] DEBUG -- : sys.exit(main())

      D, [2012-05-16T20:24:14.553945 #18012] DEBUG -- : File "/usr/bin/appliance-creator", line 150, in main

      D, [2012-05-16T20:24:14.554053 #18012] DEBUG -- : creator.configure()

      D, [2012-05-16T20:24:14.554149 #18012] DEBUG -- : File "/usr/lib/python2.7/site-packages/imgcreate/creator.py", line 741, in configure

      D, [2012-05-16T20:24:14.554244 #18012] DEBUG -- : kickstart.RPMMacroConfig(self._instroot).apply(self.ks)

      D, [2012-05-16T20:24:14.554346 #18012] DEBUG -- : File "/usr/lib/python2.7/site-packages/imgcreate/kickstart.py", line 252, in apply

      D, [2012-05-16T20:24:14.554441 #18012] DEBUG -- : f = open(self.path("/etc/rpm/macros.imgcreate"), "w+")

      D, [2012-05-16T20:24:14.554756 #18012] DEBUG -- : IOError: [Errno 2] No such file or directory: '/root/appliances/build/appliances/x86_64/centos/5/centos5-local-repo/1.0/centos-plugin/tmp/imgcreate-NQrvVk/install_root/etc/rpm/macros.imgcreate'

      D, [2012-05-16T20:24:14.620097 #18012] DEBUG -- : Unmounting directory /root/appliances/build/appliances/x86_64/centos/5/centos5-local-repo/1.0/centos-plugin/tmp/imgcreate-NQrvVk/install_root/boot

      D, [2012-05-16T20:24:14.627846 #18012] DEBUG -- : Unmounting directory /root/appliances/build/appliances/x86_64/centos/5/centos5-local-repo/1.0/centos-plugin/tmp/imgcreate-NQrvVk/install_root/

      D, [2012-05-16T20:24:14.776985 #18012] DEBUG -- : Removing compat symlinks

      D, [2012-05-16T20:24:14.777170 #18012] DEBUG -- : Unmapping /dev/loop0

      D, [2012-05-16T20:24:14.803433 #18012] DEBUG -- : Losetup remove /dev/loop0

      E, [2012-05-16T20:24:14.991300 #18012] ERROR -- : /usr/lib/ruby/gems/1.8/gems/boxgrinder-core-0.3.11/lib/boxgrinder-core/helpers/exec-helper.rb:85:in `execute'

      /usr/lib/ruby/gems/1.8/gems/boxgrinder-build-0.10.1/lib/boxgrinder-build/plugins/os/rpm-based/rpm-based-os-plugin.rb:107:in `execute_appliance_creator'

      /usr/lib/ruby/gems/1.8/gems/boxgrinder-build-0.10.1/lib/boxgrinder-build/plugins/os/rpm-based/rpm-based-os-plugin.rb:71:in `build_with_appliance_creator'

      /usr/lib/ruby/gems/1.8/gems/boxgrinder-build-0.10.1/lib/boxgrinder-build/plugins/os/rhel/rhel-plugin.rb:33:in `build_rhel'

      /usr/lib/ruby/gems/1.8/gems/boxgrinder-build-0.10.1/lib/boxgrinder-build/plugins/os/centos/centos-plugin.rb:44:in `execute'

      /usr/lib/ruby/gems/1.8/gems/boxgrinder-build-0.10.1/lib/boxgrinder-build/plugins/base-plugin.rb:172:in `run'

      /usr/lib/ruby/gems/1.8/gems/boxgrinder-build-0.10.1/lib/boxgrinder-build/appliance.rb:184:in `execute_plugin'

      /usr/lib/ruby/gems/1.8/gems/boxgrinder-build-0.10.1/lib/boxgrinder-build/appliance.rb:207:in `execute_without_userchange'

      /usr/lib/ruby/gems/1.8/gems/boxgrinder-build-0.10.1/lib/boxgrinder-build/appliance.rb:129:in `execute_plugin_chain'

      /usr/lib/ruby/gems/1.8/gems/boxgrinder-build-0.10.1/lib/boxgrinder-build/appliance.rb:125:in `each'

      /usr/lib/ruby/gems/1.8/gems/boxgrinder-build-0.10.1/lib/boxgrinder-build/appliance.rb:125:in `execute_plugin_chain'

      /usr/lib/ruby/gems/1.8/gems/boxgrinder-build-0.10.1/lib/boxgrinder-build/appliance.rb:164:in `create'

      /usr/lib/ruby/gems/1.8/gems/boxgrinder-build-0.10.1/bin/boxgrinder-build:202

      /usr/bin/boxgrinder-build:19:in `load'

      /usr/bin/boxgrinder-build:19

      F, [2012-05-16T20:24:14.991971 #18012] FATAL -- : RuntimeError: An error occurred while executing command: 'appliance-creator -d -v -t 'build/appliances/x86_64/centos/5/centos5-local-repo/1.0/centos-plugin/tmp' --cache=/var/cache/boxgrinder/rpms-cache/x86_64/centos/5 --config 'build/appliances/x86_64/centos/5/centos5-local-repo/1.0/centos-plugin/tmp/centos5-local-repo.ks' -o 'build/appliances/x86_64/centos/5/centos5-local-repo/1.0/centos-plugin/tmp' --name 'centos5-local-repo' --vmem 256 --vcpu 1 --format raw', process exited with wrong exit status: 1

      /usr/lib/ruby/gems/1.8/gems/boxgrinder-core-0.3.11/lib/boxgrinder-core/helpers/exec-helper.rb:92:in `execute'

      /usr/lib/ruby/gems/1.8/gems/boxgrinder-build-0.10.1/lib/boxgrinder-build/plugins/os/rpm-based/rpm-based-os-plugin.rb:107:in `execute_appliance_creator'

      /usr/lib/ruby/gems/1.8/gems/boxgrinder-build-0.10.1/lib/boxgrinder-build/plugins/os/rpm-based/rpm-based-os-plugin.rb:71:in `build_with_appliance_creator'

      /usr/lib/ruby/gems/1.8/gems/boxgrinder-build-0.10.1/lib/boxgrinder-build/plugins/os/rhel/rhel-plugin.rb:33:in `build_rhel'

      /usr/lib/ruby/gems/1.8/gems/boxgrinder-build-0.10.1/lib/boxgrinder-build/plugins/os/centos/centos-plugin.rb:44:in `execute'

      /usr/lib/ruby/gems/1.8/gems/boxgrinder-build-0.10.1/lib/boxgrinder-build/plugins/base-plugin.rb:172:in `run'

      /usr/lib/ruby/gems/1.8/gems/boxgrinder-build-0.10.1/lib/boxgrinder-build/appliance.rb:184:in `execute_plugin'

      /usr/lib/ruby/gems/1.8/gems/boxgrinder-build-0.10.1/lib/boxgrinder-build/appliance.rb:207:in `execute_without_userchange'

      /usr/lib/ruby/gems/1.8/gems/boxgrinder-build-0.10.1/lib/boxgrinder-build/appliance.rb:129:in `execute_plugin_chain'

      /usr/lib/ruby/gems/1.8/gems/boxgrinder-build-0.10.1/lib/boxgrinder-build/appliance.rb:125:in `each'

      /usr/lib/ruby/gems/1.8/gems/boxgrinder-build-0.10.1/lib/boxgrinder-build/appliance.rb:125:in `execute_plugin_chain'

      /usr/lib/ruby/gems/1.8/gems/boxgrinder-build-0.10.1/lib/boxgrinder-build/appliance.rb:164:in `create'

      /usr/lib/ruby/gems/1.8/gems/boxgrinder-build-0.10.1/bin/boxgrinder-build:202

      /usr/bin/boxgrinder-build:19:in `load'

      /usr/bin/boxgrinder-build:19

       

        • 1. Re: ec2 Builds failing on kvm meta appliance with local repos
          msavy

          Nick,

           

          I'll investigate this.

           

          Marc

          • 2. Re: ec2 Builds failing on kvm meta appliance with local repos
            msavy

            Nick,

             

            I'm rejecting the ticket associated with this post, I've investigated and can't reproduce your problem.

             

            Firstly, I'd try re-download the local repository as it could be that you have some sort of corrupted meta-data or RPMs. That is very unlikely given the error, but just to be sure.

             

            Also, it is always worth checking that your system hasn't run out of disk space, as that can cause strange errors.

            • 3. Re: ec2 Builds failing on kvm meta appliance with local repos

              I am experiencing this as well on fully patched F17 i686 when building a RHEL5 i386 appliance:

               

              The F17 build host has these packages installed:

               

              yum-3.4.3-29.fc17.noarch

              yum-utils-1.1.31-4.fc17.noarch

              yum-metadata-parser-1.1.4-6.fc17.i686

              rubygem-boxgrinder-build-0.10.4-1.fc17.noarch

              rubygem-boxgrinder-core-0.3.14-1.fc17.noarch

               

              I believe the problem is related to this bug:

               

              https://bugzilla.redhat.com/show_bug.cgi?id=499048

              https://bugzilla.redhat.com/show_bug.cgi?id=497570

               

              And is said to be fixed in the errata of the current version:

               

              http://rhn.redhat.com/errata/RHBA-2009-1358.html

               

              "* the coreutils package was listed incorrectly as a prerequisite

              requirement for the pam packages instead of a post-install requirement.

              This dependency statement has been corrected in these updated packages.

              (BZ#497570)"

               

              If you do (on F17):

               

              rpm -qp --requires -v pam-0.99.6.2-6.el5_5.2.i386.rpm  | grep core

               

              You'll see:

               

              post,prereq: coreutils 

               

              However, CentOS5 and RHEL6 both display:

               

              post: coreutils

              • 4. Re: ec2 Builds failing on kvm meta appliance with local repos
                msavy

                Thanks Kevin, I'll try to see what is happening.

                • 5. Re: ec2 Builds failing on kvm meta appliance with local repos

                  Thank you!  Looks like circular dependencies used to be handled by a mechanism called whiteout which is no longer in the RPM code base.  I wasn't able to find a way to adjust the ordering through boxgrinder / appliance creator / imgcreate. 

                   

                  However I was able to get RHEL5 i386 to build consistently.

                   

                  I took the distro coreutils rpm and ran:

                   

                  rpmrebuild -e -p coreutils-5.97-34.el5_8.1.i386.rpm

                   

                  I searched for and removed all references to pam or pam libraries.

                   

                  I then took the resulting re-built coreutils RPM, put it in a local directory, and ran createrepo in that directory.

                   

                  Then in the appliance file I reference this local repository first, i.e.

                   

                  repos:

                    - name: local

                      baseurl: "file:///mnt/trunk/repo/rhel5-i386"

                      ephemeral: true