Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

installing custom kernel package broke in 0.16.2 #6563

Closed
jfrost opened this issue Aug 7, 2013 · 8 comments
Closed

installing custom kernel package broke in 0.16.2 #6563

jfrost opened this issue Aug 7, 2013 · 8 comments
Assignees
Milestone

Comments

@jfrost
Copy link
Contributor

jfrost commented Aug 7, 2013

I have the following sls:

kernelpkgs:
  pkg.installed:
    - sources:
      - linux-image-3.9.4-custom: salt://kernel/linux-image-3.9.4-custom_3.9.4-custom-10.00.Custom_amd64.deb
      - linux-headers-3.9.4-custom: salt://kernel/linux-headers-3.9.4-custom_3.9.4-custom-10.00.Custom_amd64.deb

To install some custom kernel packages on Ubuntu. This worked well in 0.16.0, but seems to have broken in 0.16.2.

[INFO    ] Executing command 'grep-available -F Provides -s Package,Provides -e "^.+$"' in directory '/root'
[INFO    ] Executing command 'apt-get -q update' in directory '/root'
[INFO    ] Executing command 'dpkg-deb -I "/vagrant/salt-master-etc/srv/kernel/linux-headers-3.9.4-custom_3.9.4-custom-10.00.Custom_amd64.deb"' in directory '/root'
[INFO    ] Executing command 'dpkg-deb -I "/vagrant/salt-master-etc/srv/kernel/linux-image-3.9.4-custom_3.9.4-custom-10.00.Custom_amd64.deb"' in directory '/root'
[ERROR   ] Package file salt://kernel/linux-headers-3.9.4-custom_3.9.4-custom-10.00.Custom_amd64.deb (Name: linux-headers-3.9.4-custom:amd64) does not match the specified package name (linux-headers-3.9.4-custom).
[ERROR   ] Package file salt://kernel/linux-image-3.9.4-custom_3.9.4-custom-10.00.Custom_amd64.deb (Name: linux-image-3.9.4-custom:amd64) does not match the specified package name (linux-image-3.9.4-custom).
[ERROR   ] No changes made for kernelpkgs

So, I noticed the ":amd64" at the end of the package name and changed my sls to look like this:

kernelpkgs:
  pkg.installed:
    - sources:
      - "linux-image-3.9.4-custom:amd64": salt://kernel/linux-image-3.9.4-custom_3.9.4-custom-10.00.Custom_amd64.deb
      - "linux-headers-3.9.4-custom:amd64": salt://kernel/linux-headers-3.9.4-custom_3.9.4-custom-10.00.Custom_amd64.deb

That seems to have installed them (yay?):

[INFO    ] Executing state pkg.installed for kernelpkgs
[INFO    ] Executing command "dpkg-query --showformat='${Status} ${Package} ${Version} ${Architecture}\n' -W" in directory '/home/vagrant'
[INFO    ] Executing command 'grep-available -F Provides -s Package,Provides -e "^.+$"' in directory '/home/vagrant'
[INFO    ] Executing command 'apt-get -q update' in directory '/home/vagrant'
[INFO    ] Executing command 'dpkg-deb -I "/vagrant/salt-master-etc/srv/kernel/linux-headers-3.9.4-custom_3.9.4-custom-10.00.Custom_amd64.deb"' in directory '/home/vagrant'
[INFO    ] Executing command 'dpkg-deb -I "/vagrant/salt-master-etc/srv/kernel/linux-image-3.9.4-custom_3.9.4-custom-10.00.Custom_amd64.deb"' in directory '/home/vagrant'
[INFO    ] Executing command 'dpkg -i --force-confold  /vagrant/salt-master-etc/srv/kernel/linux-headers-3.9.4-custom_3.9.4-custom-10.00.Custom_amd64.deb /vagrant/salt-master-etc/srv/kernel/linux-image-3.9.4-custom_3.9.4-custom-10.00.Custom_amd64.deb' in directory '/home/vagrant'
[INFO    ] Executing command "dpkg-query --showformat='${Status} ${Package} ${Version} ${Architecture}\n' -W" in directory '/home/vagrant'
[INFO    ] Executing command 'grep-available -F Provides -s Package,Provides -e "^.+$"' in directory '/home/vagrant'
[ERROR   ] Installed Packages:
linux-headers-3.9.4-custom changed from absent to 3.9.4-custom-10.00.Custom
linux-headers-3.9 changed from absent to 1
linux-image-3.9 changed from absent to 1
linux-image-3.9.4-custom changed from absent to 3.9.4-custom-10.00.Custom
vagrant@reports01:~$ dpkg --list|grep linux-|grep 3.9
ii  linux-headers-3.9.4-custom      3.9.4-custom-10.00.Custom  Header files related to Linux kernel, specifically,
ii  linux-image-3.9.4-custom        3.9.4-custom-10.00.Custom  Linux kernel binary image for version 3.9.4-custom

But,
When the highstate runs the next time, it breaks the package install:

[INFO    ] Executing command 'dpkg-deb -I "/vagrant/salt-master-etc/srv/kernel/linux-headers-3.9.4-custom_3.9.4-custom-10.00.Custom_amd64.deb"' in directory '/home/vagrant'
[INFO    ] Executing command 'dpkg-deb -I "/vagrant/salt-master-etc/srv/kernel/linux-image-3.9.4-custom_3.9.4-custom-10.00.Custom_amd64.deb"' in directory '/home/vagrant'
[INFO    ] Executing command 'dpkg -i --force-confold  /vagrant/salt-master-etc/srv/kernel/linux-headers-3.9.4-custom_3.9.4-custom-10.00.Custom_amd64.deb /vagrant/salt-master-etc/srv/kernel/linux-image-3.9.4-custom_3.9.4-custom-10.00.Custom_amd64.deb' in directory '/home/vagrant'
[ERROR   ] Command 'dpkg -i --force-confold  /vagrant/salt-master-etc/srv/kernel/linux-headers-3.9.4-custom_3.9.4-custom-10.00.Custom_amd64.deb /vagrant/salt-master-etc/srv/kernel/linux-image-3.9.4-custom_3.9.4-custom-10.00.Custom_amd64.deb' failed with return code: 1
[ERROR   ] stdout: (Reading database ... 71251 files and directories currently installed.)
Preparing to replace linux-headers-3.9.4-custom 3.9.4-custom-10.00.Custom (using .../linux-headers-3.9.4-custom_3.9.4-custom-10.00.Custom_amd64.deb) ...
Unpacking replacement linux-headers-3.9.4-custom ...
Preparing to replace linux-image-3.9.4-custom 3.9.4-custom-10.00.Custom (using .../linux-image-3.9.4-custom_3.9.4-custom-10.00.Custom_amd64.deb) ...
Unpacking replacement linux-image-3.9.4-custom ...
Setting up linux-headers-3.9.4-custom (3.9.4-custom-10.00.Custom) ...
Setting up linux-image-3.9.4-custom (3.9.4-custom-10.00.Custom) ...
[ERROR   ] stderr: Examining /etc/kernel/preinst.d/
Done.
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.9.4-custom /boot/vmlinuz-3.9.4-custom
update-initramfs: Deleting /boot/initrd.img-3.9.4-custom
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.9.4-custom /boot/vmlinuz-3.9.4-custom
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.9.4-custom
Found linux image: /boot/vmlinuz-3.2.0-23-generic
Found initrd image: /boot/initrd.img-3.2.0-23-generic
Found memtest86+ image: /memtest86+.bin
done
Examining /etc/kernel/header_postinst.d.
Running depmod.
update-initramfs: deferring update (hook will be called later)
Failed to symbolic-link /boot/initrd.img-3.9.4-custom to initrd.img: File exists
dpkg: error processing linux-image-3.9.4-custom (--install):
 subprocess installed post-installation script returned error exit status 17
Errors were encountered while processing:
 linux-image-3.9.4-custom
[INFO    ] Executing command "dpkg-query --showformat='${Status} ${Package} ${Version} ${Architecture}\n' -W" in directory '/home/vagrant'
[INFO    ] Executing command 'grep-available -F Provides -s Package,Provides -e "^.+$"' in directory '/home/vagrant'
[ERROR   ] Installed Packages:
linux-image-3.9.4-custom changed from 3.9.4-custom-10.00.Custom to absent
linux-image-3.9 changed from 1 to absent

    State: - pkg
    Name:      kernelpkgs
    Function:  installed
        Result:    False
        Comment:   The following packages failed to install/update: linux-headers-3.9.4-custom:amd64, linux-image-3.9.4-custom:amd64.
        Changes:   linux-image-3.9.4-custom: { new : 
old : 3.9.4-custom-10.00.Custom
}
                   linux-image-3.9: { new : 
old : 1
}

What am I missing here?

@basepi
Copy link
Contributor

basepi commented Aug 8, 2013

Let me get @terminalmage involved in the conversation -- I know we changed something recently about package names (amd64 stuff) but can't remember exactly what.

Also, just wanted to point out that you can use triple backticks to surround blocks of code. Makes them much more readable. I've edited your post above, adding in triple backticks where I thought they belonged.

@jfrost
Copy link
Contributor Author

jfrost commented Aug 8, 2013

On the backticks: nice! My markdown foo is poor, so thanks for pointing it out!

I looked at the release notes and thought the amd64 changes were only for yum based distros.

I think I forgot to mention this is Ubuntu 12.04.

@terminalmage
Copy link
Contributor

@jfrost Sorry, I fixed the installation of non-amd64 binary packages on amd64 arch (using the sources param) for 0.16.2 and appear to have caused this regression. I will get it fixed today.

@ghost ghost assigned terminalmage Aug 8, 2013
@terminalmage
Copy link
Contributor

@jfrost #6576 fixes this regression. Sorry for the inconvenience. To get your states working again, you can do the following:

  1. Grab the 0.16.2 version of the pkg_resource module from here.
  2. Make the change detailed in this diff to the copy that you downloaded.
  3. Place it in a directory called _modules located within your file roots (so with the default file_roots configuration, this would be /srv/salt/_modules).
  4. Run salt -G 'os_family:Debian' saltutil.sync_modules from the master to push the updated module out to the minions that use apt.

The file located in /srv/salt/_modules will take precedence over the the module that is distributed with Salt. However, it is VERY IMPORTANT to remember to remove this file and re-run the saltutil.sync_modules before you upgrade to the next Salt release, otherwise it will still be favored over the module from the updated release.

@jfrost
Copy link
Contributor Author

jfrost commented Aug 8, 2013

Thanks for the fast turnaround!

Verified that fixes it.

Might just pin the minion versions at 0.16.0 since our current state files don't seem to have any issues with that release.

@terminalmage
Copy link
Contributor

@jfrost I'll go ahead and close this. Sorry for the inconvenience.

@twerkmeister
Copy link

Hey I'm using the salt 0.16.3 on debian and im experiencing this error for a package with architecture=all. Changing the architecture of the package to amd64 solved to problem for me. I used the state pkg.installed with the sources option:

sbt:
pkg.installed:
- sources:
- sbt: salt://resources/sbt_0.12.4.deb

*This is the debug output

[INFO ] Executing command 'dpkg-deb -I "/var/cache/salt/minion/files/base/resources/sbt_0.12.4.deb"' in directory '/root'
[DEBUG ] stdout: new debian package, version 2.0.
size 984284 bytes: control archive=711 bytes.
17 bytes, 1 lines conffiles
407 bytes, 12 lines control
414 bytes, 7 lines md5sums
Package: sbt
Version: 0.12.4-0.1-build-001
Section: java
Priority: optional
Architecture: all
Installed-Size: 1093
Depends: curl, java2-runtime, bash (>= 2.05a-11)
Recommends: git
Maintainer: Josh Suereth joshua.suereth@typesafe.com
Description: Simple Build Tool for Scala-driven builds
This script provides a native way to run the Simple Build Tool,
a build tool for Scala software, also called SBT.
[ERROR ] Package file salt://resources/sbt_0.12.4.deb (Name: sbt:all) does not match the specified package name (sbt).
[ERROR ] No changes made for sbt

@terminalmage
Copy link
Contributor

Already fixed in git.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants