OSInside / kiwi

KIWI - Appliance Builder Next Generation
https://osinside.github.io/kiwi
GNU General Public License v3.0
302 stars 152 forks source link

zypper had lost packages cache and couldn't find anything for building image #383

Closed abehterev closed 7 years ago

abehterev commented 7 years ago

Problem description

I use own SLES repo described in xml config:

    <repository alias="SLE" imageinclude="true">
        <source path="http://suse-repo.mycompany.com/repo/stable/Products/SLE-SERVER/12-SP2/ppc64le/product"/>
    </repository>
    <repository alias="SLE-Containers" imageinclude="true">
        <source path="http://suse-repo.mycompany.com/repo/stable/Products/SLE-Module-Containers/12/ppc64le/product"/>
    </repository>
    <repository alias="SLE-UPD" imageinclude="true">
        <source path="http://suse-repo.mycompany.com/repo/stable/Updates/SLE-SERVER/12-SP2/ppc64le/update"/>
    </repository>
    <repository alias="SLE-Containers-UPD" imageinclude="true">
        <source path="http://suse-repo.mycompany.com/repo/stable/Updates/SLE-Module-Containers/12/ppc64le/update"/>
    </repository>

I have got an error after kiwi --build MYDISTRO-SLE-minimal -d distro-min. Build output is:

Jun-16 13:14:29 <1> : Destination: /root/distro-min/build doesn't exist
Jun-16 13:14:29 <1> : --> Creating directory: /root/distro-min/build                                                                                                                             done
Jun-16 13:14:29 <1> : Description provides no MD5 hash, check
Jun-16 13:14:29 <1> : Reading image description [Prepare]...
Jun-16 13:14:29 <1> : Setting up package manager: zypper                                                                                                                                         done
Jun-16 13:14:29 <1> : Setting up source channel:
Jun-16 13:14:29 <1> : --> http://suse-repo.mycompany.com/repo/stable/Products/SLE-SERVER/12-SP2/ppc64le/product
Jun-16 13:14:29 <2> : --> Repository type set to: AutoDetect
Jun-16 13:14:29 <1> : Retain SLE
Jun-16 13:14:29 <1> : Setting up source channel:
Jun-16 13:14:29 <1> : --> http://suse-repo.mycompany.com/repo/stable/Products/SLE-Module-Containers/12/ppc64le/product
Jun-16 13:14:29 <2> : --> Repository type set to: AutoDetect
Jun-16 13:14:29 <1> : Retain SLE\-Containers
Jun-16 13:14:29 <1> : Setting up source channel:
Jun-16 13:14:29 <1> : --> http://suse-repo.mycompany.com/repo/stable/Updates/SLE-SERVER/12-SP2/ppc64le/update
Jun-16 13:14:29 <2> : --> Repository type set to: AutoDetect
Jun-16 13:14:29 <1> : Retain SLE\-UPD
Jun-16 13:14:29 <1> : Setting up source channel:
Jun-16 13:14:29 <1> : --> http://suse-repo.mycompany.com/repo/stable/Updates/SLE-Module-Containers/12/ppc64le/update
Jun-16 13:14:29 <2> : --> Repository type set to: AutoDetect
Jun-16 13:14:29 <1> : Retain SLE\-Containers\-UPD
Jun-16 13:14:29 <1> : Set root log: /root/distro-min/build/image-root.28920.screenrc.log...                                                                                                      done
Jun-16 13:14:29 <1> : Setting RPM doc exclusion to: true                                                                                                                                         done
Jun-16 13:14:29 <1> : Creating default template files for new root system                                                                                                                        done
Jun-16 13:14:29 <1> : Importing build keys...                                                                                                                                                    done
Jun-16 13:14:29 <1> : Adding bootstrap zypper service: SLE\-Containers\-UPD                                                                                                                      done
Jun-16 13:14:29 <1> : Adding bootstrap zypper service: SLE\-UPD                                                                                                                                  done
Jun-16 13:14:30 <1> : Adding bootstrap zypper service: SLE                                                                                                                                       done
Jun-16 13:14:30 <1> : Adding bootstrap zypper service: SLE\-Containers                                                                                                                           done
Jun-16 13:14:30 <1> : Initializing image system on: /root/distro-min/build/image-root                                                                                                            failed
+ export PBL_SKIP_BOOT_TEST=1
+ PBL_SKIP_BOOT_TEST=1
+ trap clean INT TERM
+ export ZYPP_MODALIAS_SYSFS=/tmp
+ ZYPP_MODALIAS_SYSFS=/tmp
+ export YAST_IS_RUNNING=true
+ YAST_IS_RUNNING=true
+ export ZYPP_CONF=/root/distro-min/build/image-root//var/cache/kiwi/zypper/zypp.conf.28920
+ ZYPP_CONF=/root/distro-min/build/image-root//var/cache/kiwi/zypper/zypp.conf.28920
+ export ZYPP_LOCKFILE_ROOT=/root/distro-min/build/image-root
+ ZYPP_LOCKFILE_ROOT=/root/distro-min/build/image-root
+ mkdir -p /root/distro-min/build/image-root/etc/zypp
+ SPID=29109
+ wait 29109
+ /usr/bin/zypper --non-interactive --pkg-cache-dir /var/cache/kiwi/packages --reposd-dir /root/distro-min/build/image-root//var/cache/kiwi/zypper/repos --solv-cache-dir /root/distro-min/build/image-root//var/cache/kiwi/zypper/solv --cache-dir /root/distro-min/build/image-root//var/cache/kiwi/zypper --config /var/cache/kiwi/zypper/zypper.conf.28920 --no-gpg-checks --root /root/distro-min/build/image-root install --auto-agree-with-licenses --no-recommends cracklib-dict-full filesystem glibc-locale zypper
No provider of 'cracklib-dict-full' found.
No provider of 'filesystem' found.
No provider of 'glibc-locale' found.
No provider of 'zypper' found.
Jun-16 13:14:31 <3> : Base initialization failed                                                                                                                                                 failed
Jun-16 13:14:31 <1> : Closing session with ecode: 1
Jun-16 13:14:31 <3> : KIWI exited with error(s)
Jun-16 13:14:31 <1> : Complete logfile at: /root/distro-min/build/image-root.log

If we look at log file we could find that at begin zypper adds repos and builds a cache, then zypper run bootstrap install, but unsuccessfully. Perhaps one had lost a cache?

Jun-16 13:14:29 <1> : Preserving Zypper package cache
Jun-16 13:14:29 <1> : EXEC [mv /var/cache/kiwi/packages /var/cache/kiwi/packs]
Jun-16 13:14:29 <1> : EXEC [test -f /root/distro-min/build/image-root//var/cache/kiwi/zypper/repos/SLE\-Containers\-UPD.repo]
Jun-16 13:14:29 <1> : Adding bootstrap zypper service: SLE\-Containers\-UPD
Jun-16 13:14:29 <1> : EXEC [/usr/bin/zypper --non-interactive --pkg-cache-dir /var/cache/kiwi/packages --reposd-dir /root/distro-min/build/image-root//var/cache/kiwi/zypper/repos --solv-cache-dir /root/distro-min/build/image-root//var/cache/kiwi/zypper/solv --cache-dir /root/distro-min/build/image-root//var/cache/kiwi/zypper --config /var/cache/kiwi/zypper/zypper.conf.28920 --no-gpg-checks --root "/root/distro-min/build/image-root" addrepo -f --keep-packages 'http://suse-repo.mycompany.com/repo/stable/Updates/SLE-Module-Containers/12/ppc64le/update' SLE\-Containers\-UPD 2>&1]
Jun-16 13:14:29 <1> : EXEC [test -f /root/distro-min/build/image-root//var/cache/kiwi/zypper/repos/SLE\-UPD.repo]
Jun-16 13:14:29 <1> : Adding bootstrap zypper service: SLE\-UPD
Jun-16 13:14:29 <1> : EXEC [/usr/bin/zypper --non-interactive --pkg-cache-dir /var/cache/kiwi/packages --reposd-dir /root/distro-min/build/image-root//var/cache/kiwi/zypper/repos --solv-cache-dir /root/distro-min/build/image-root//var/cache/kiwi/zypper/solv --cache-dir /root/distro-min/build/image-root//var/cache/kiwi/zypper --config /var/cache/kiwi/zypper/zypper.conf.28920 --no-gpg-checks --root "/root/distro-min/build/image-root" addrepo -f --keep-packages 'http://suse-repo.mycompany.com/repo/stable/Updates/SLE-SERVER/12-SP2/ppc64le/update' SLE\-UPD 2>&1]
Jun-16 13:14:30 <1> : EXEC [test -f /root/distro-min/build/image-root//var/cache/kiwi/zypper/repos/SLE.repo]
Jun-16 13:14:30 <1> : Adding bootstrap zypper service: SLE
Jun-16 13:14:30 <1> : EXEC [/usr/bin/zypper --non-interactive --pkg-cache-dir /var/cache/kiwi/packages --reposd-dir /root/distro-min/build/image-root//var/cache/kiwi/zypper/repos --solv-cache-dir /root/distro-min/build/image-root//var/cache/kiwi/zypper/solv --cache-dir /root/distro-min/build/image-root//var/cache/kiwi/zypper --config /var/cache/kiwi/zypper/zypper.conf.28920 --no-gpg-checks --root "/root/distro-min/build/image-root" addrepo -f --keep-packages 'http://suse-repo.mycompany.com/repo/stable/Products/SLE-SERVER/12-SP2/ppc64le/product' SLE 2>&1]
Jun-16 13:14:30 <1> : EXEC [test -f /root/distro-min/build/image-root//var/cache/kiwi/zypper/repos/SLE\-Containers.repo]
Jun-16 13:14:30 <1> : Adding bootstrap zypper service: SLE\-Containers
Jun-16 13:14:30 <1> : EXEC [/usr/bin/zypper --non-interactive --pkg-cache-dir /var/cache/kiwi/packages --reposd-dir /root/distro-min/build/image-root//var/cache/kiwi/zypper/repos --solv-cache-dir /root/distro-min/build/image-root//var/cache/kiwi/zypper/solv --cache-dir /root/distro-min/build/image-root//var/cache/kiwi/zypper --config /var/cache/kiwi/zypper/zypper.conf.28920 --no-gpg-checks --root "/root/distro-min/build/image-root" addrepo -f --keep-packages 'http://suse-repo.mycompany.com/repo/stable/Products/SLE-Module-Containers/12/ppc64le/product' SLE\-Containers 2>&1]
Jun-16 13:14:30 <1> : Restoring Zypper package cache
Jun-16 13:14:30 <1> : EXEC [mv /var/cache/kiwi/packs /var/cache/kiwi/packages &>/dev/null]
Jun-16 13:14:30 <1> : EXEC [mktemp -qt kiwi-lwp-download-XXXXXX 2>&1]
Jun-16 13:14:30 <1> : EXEC [chmod a+x /tmp/kiwi-lwp-download-oMVt9h 2>&1]
Jun-16 13:14:30 <1> : EXEC [chmod a+w /tmp/kiwi-lwp-download-oMVt9h 2>&1]
Jun-16 13:14:30 <1> : EXEC [/tmp/kiwi-lwp-download-oMVt9h http://suse-repo.mycompany.com/repo/stable/Updates/SLE-Module-Containers/12/ppc64le/update/license.tar.gz /root/distro-min/build/image-root//license.tar.gz 2>&1]
Jun-16 13:14:30 <1> : EXEC [mktemp -qt kiwi-lwp-download-XXXXXX 2>&1]
Jun-16 13:14:30 <1> : EXEC [chmod a+x /tmp/kiwi-lwp-download-1oZrBX 2>&1]
Jun-16 13:14:30 <1> : EXEC [chmod a+w /tmp/kiwi-lwp-download-1oZrBX 2>&1]
Jun-16 13:14:30 <1> : EXEC [/tmp/kiwi-lwp-download-1oZrBX http://suse-repo.mycompany.com/repo/stable/Updates/SLE-SERVER/12-SP2/ppc64le/update/license.tar.gz /root/distro-min/build/image-root//license.tar.gz 2>&1]
Jun-16 13:14:30 <1> : EXEC [mktemp -qt kiwi-lwp-download-XXXXXX 2>&1]
Jun-16 13:14:30 <1> : EXEC [chmod a+x /tmp/kiwi-lwp-download-C3tvLQ 2>&1]
Jun-16 13:14:30 <1> : EXEC [chmod a+w /tmp/kiwi-lwp-download-C3tvLQ 2>&1]
Jun-16 13:14:30 <1> : EXEC [/tmp/kiwi-lwp-download-C3tvLQ http://suse-repo.mycompany.com/repo/stable/Products/SLE-SERVER/12-SP2/ppc64le/product/license.tar.gz /root/distro-min/build/image-root//license.tar.gz 2>&1]
Jun-16 13:14:30 <1> : EXEC [mktemp -qt kiwi-lwp-download-XXXXXX 2>&1]
Jun-16 13:14:30 <1> : EXEC [chmod a+x /tmp/kiwi-lwp-download-Nhblz8 2>&1]
Jun-16 13:14:30 <1> : EXEC [chmod a+w /tmp/kiwi-lwp-download-Nhblz8 2>&1]
Jun-16 13:14:30 <1> : EXEC [/tmp/kiwi-lwp-download-Nhblz8 http://suse-repo.mycompany.com/repo/stable/Products/SLE-Module-Containers/12/ppc64le/product/license.tar.gz /root/distro-min/build/image-root//license.tar.gz 2>&1]
Jun-16 13:14:30 <1> : Initializing image system on: /root/distro-min/build/image-root
Jun-16 13:14:30 <1> : EXEC [chmod 755 /root/distro-min/build/image-root/screenrc.smart]
+ export PBL_SKIP_BOOT_TEST=1
+ PBL_SKIP_BOOT_TEST=1
+ trap clean INT TERM
+ export ZYPP_MODALIAS_SYSFS=/tmp
+ ZYPP_MODALIAS_SYSFS=/tmp
+ export YAST_IS_RUNNING=true
+ YAST_IS_RUNNING=true
+ export ZYPP_CONF=/root/distro-min/build/image-root//var/cache/kiwi/zypper/zypp.conf.28920
+ ZYPP_CONF=/root/distro-min/build/image-root//var/cache/kiwi/zypper/zypp.conf.28920
+ export ZYPP_LOCKFILE_ROOT=/root/distro-min/build/image-root
+ ZYPP_LOCKFILE_ROOT=/root/distro-min/build/image-root
+ mkdir -p /root/distro-min/build/image-root/etc/zypp
+ SPID=29109
+ wait 29109
+ /usr/bin/zypper --non-interactive --pkg-cache-dir /var/cache/kiwi/packages --reposd-dir /root/distro-min/build/image-root//var/cache/kiwi/zypper/repos --solv-cache-dir /root/distro-min/build/image-root//var/cache/kiwi/zypper/solv --cache-dir /root/distro-min/build/image-root//var/cache/kiwi/zypper --config /var/cache/kiwi/zypper/zypper.conf.28920 --no-gpg-checks --root /root/distro-min/build/image-root install --auto-agree-with-licenses --no-recommends cracklib-dict-full filesystem glibc-locale zypper
Loading repository data...
Reading installed packages...
'cracklib-dict-full' not found in package names. Trying capabilities.
No provider of 'cracklib-dict-full' found.
'filesystem' not found in package names. Trying capabilities.
No provider of 'filesystem' found.
'glibc-locale' not found in package names. Trying capabilities.
No provider of 'glibc-locale' found.
'zypper' not found in package names. Trying capabilities.
No provider of 'zypper' found.
Jun-16 13:14:30 <1> : EXEC [rm -f /root/distro-min/build/image-root/screenrc.smart*]
Jun-16 13:14:30 <1> : EXEC [rm -f /root/distro-min/build/image-root/screenrc.ctrls]
Jun-16 13:14:30 <1> : EXEC [rm -f /root/distro-min/build/image-root/screenrc.err]
Jun-16 13:14:30 <1> : EXEC [test -d "/root/distro-min/build/image-root/proc"]
Jun-16 13:14:30 <1> : Umounting path: /root/distro-min/build/image-root/proc
Jun-16 13:14:30 <1> : EXEC [umount "/root/distro-min/build/image-root/proc" 2>&1]
Jun-16 13:14:30 <1> : EXEC [test -d "/root/distro-min/build/image-root//var/cache/kiwi"]
Jun-16 13:14:30 <1> : Umounting path: /root/distro-min/build/image-root//var/cache/kiwi
Jun-16 13:14:30 <1> : EXEC [umount "/root/distro-min/build/image-root//var/cache/kiwi" 2>&1]
Jun-16 13:14:30 <1> : EXEC [test -d "/root/distro-min/build/image-root/dev"]
Jun-16 13:14:30 <1> : Umounting path: /root/distro-min/build/image-root/dev
Jun-16 13:14:30 <1> : EXEC [umount "/root/distro-min/build/image-root/dev" 2>&1]
Jun-16 13:14:31 <1> : Release package manager lock
Jun-16 13:14:31 <1> : EXEC [rm -f /var/lock/kiwi-init.lock]
Jun-16 13:14:31 <3> : Base initialization failed
Jun-16 13:14:31 <1> : Closing session with ecode: 1
Jun-16 13:14:31 <3> : KIWI exited with error(s)
Jun-16 13:14:31 <1> : EXEC [mv /root/distro-min/build/image-root.28920.screenrc.log /root/distro-min/build/image-root.log 2>&1]
Jun-16 13:14:31 <1> : Complete logfile at: /root/distro-min/build/image-root.log
Jun-16 13:14:31 <1> : Release package manager lock
Jun-16 13:14:31 <1> : EXEC [rm -f /var/lock/kiwi-init.lock]
Jun-16 13:14:31 <1> : Release package manager lock
Jun-16 13:14:31 <1> : EXEC [rm -f /var/lock/kiwi-init.lock]
Jun-16 13:14:31 <1> : EXEC [rm -f /var/cache/kiwi/zypper/zypper.conf.28920 /var/cache/kiwi/zypper/zypp.conf.28920]

When I do that manually zypper finds all cache and installs bootstrap packages normally.

If I use a small hack to set up repos like command-line argument, build done very well.

kiwi -b MYDISTRO-SLE-minimal --add-repo http://suse-repo.mycompany.com/repo/stable/Products/SLE-SERVER/12-SP2/ppc64le/product/ --add-repo http://suse-repo.mycompany.com/repo/stable/Products/SLE-Module-Containers/12/ppc64le/product/ --add-repo http://suse-repo.mycompany.com/repo/stable/Updates/SLE-SERVER/12-SP2/ppc64le/update/ --add-repo http://suse-repo.mycompany.com/repo/stable/Updates/SLE-Module-Containers/12/ppc64le/update/ --ignore-repos -d distro-min/

Versions

KIWI:

Information for package kiwi:
-----------------------------
Repository     : SLE-SERVER-UPD                  
Name           : kiwi                            
Version        : 7.03.113-71.2                   
Arch           : ppc64le                         
Vendor         : SUSE LLC <https://www.suse.com/>
Support Level  : Level 3                         
Installed Size : 5.3 MiB                         
Installed      : Yes                             
Status         : up-to-date                      
Source package : kiwi-7.03.113-71.2.src          
Summary        : KIWI - Appliance Builder        
Description    :                                 
    The KIWI Image System provides an operating system image builder
    for Linux supported hardware platforms as well as for virtualization
    and cloud systems like Xen, KVM, VMware, EC2 and more. The online
    documentation can be found here: http://doc.opensuse.org

OS:

SUSE Linux Enterprise Server 12 (ppc64le)
VERSION = 12
PATCHLEVEL = 2
davidcassany commented 7 years ago

@abehterev, thanks for reporting a such a detailed issue, it helps a lot. Just as a side note and to let you know if you didn't, this is not the appropriate repository for KIWI v7, this is the repository for the next generation of KIWI (current version 9.7), starting from KIWI v8 it has been completely rewritten in Python using more up to date technologies and development techniques. That being said I am copying this issue to the appropriate KIWI v7 here, this way the issue and all it's progress will tracked together with the appropriate base code.

abehterev commented 7 years ago

@davidcassany, thank you! That's my fault to choose correct project on github. Maybe you know, when, if will, one of new version of kiwi will be included to SLES mainstream? Or I must use it at current time only from source?

davidcassany commented 7 years ago

@abehterev, KIWI v8.30 is on the way to get into the SLE12-SP2, the appropriate procedure has started, but it is out of our control when this will finally occur. Anyway, a newer version of kiwi will certainly arrive into to SLES mainstream. The packages are called python2-kiwi and python3-kiwi, we keep a build of the edge version in this repository

davidcassany commented 7 years ago

I am closing this issue since it is already being tracked in openSUSE/kiwi repository.