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

pkg.latest with APT using fromrepo #8067

Closed
mafrosis opened this issue Oct 24, 2013 · 5 comments · Fixed by #8164
Closed

pkg.latest with APT using fromrepo #8067

mafrosis opened this issue Oct 24, 2013 · 5 comments · Fixed by #8164
Labels
Bug broken, incorrect, or confusing behavior Regression The issue is a bug that breaks functionality known to work in previous releases. severity-low 4th level, cosemtic problems, work around exists

Comments

@mafrosis
Copy link
Contributor

I ran into a problem trying to install git latest from wheezy-backports under Debian, using 0.17.1.

SLS:

wheezy-backports-pkgrepo:
  pkgrepo.managed:
    - humanname: Wheezy Backports
    - name: deb http://ftp.us.debian.org/debian wheezy-backports main
    - file: /etc/apt/sources.list.d/wheezy-backports.list
    - require_in:
      - pkg: git

git:
  pkg.latest:
    - fromrepo: wheezy-backports

salt-call output:

[INFO    ] Executing state pkgrepo.managed for deb http://ftp.au.debian.org/debian wheezy-backports main
[INFO    ] Package repo deb http://ftp.au.debian.org/debian wheezy-backports main already configured
[INFO    ] Executing state pkg.latest for git
[INFO    ] Executing command "dpkg-query --showformat='${Status} ${Package} ${Version} ${Architecture}\n' -W" in directory '/root'
[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 ['apt-cache', '-q', 'policy', 'git', '-o', "APT::Default-Release='wheezy-backports'"] in directory '/root'
[ERROR   ] Command '['apt-cache', '-q', 'policy', 'git', '-o', "APT::Default-Release='wheezy-backports'"]' failed with return code: 100
[ERROR   ] stdout: git:
  Installed: 1:1.7.10.4-1+wheezy1
  Candidate: 1:1.7.10.4-1+wheezy1
  Version table:
     1:1.8.4~rc3-1~bpo70+1 0
        100 http://ftp.au.debian.org/debian/ wheezy-backports/main amd64 Packages
 *** 1:1.7.10.4-1+wheezy1 0
        500 http://ftp.au.debian.org/debian/ wheezy/main amd64 Packages
        100 /var/lib/dpkg/status
[ERROR   ] stderr: E: The value ''wheezy-backports'' is invalid for APT::Default-Release as such a release is not available in the sources

apt-cache output from command line

vagrant@wheezy64:~$ sudo apt-cache -q policy git -o APT::Default-Release='wheezy-backports'
git:
  Installed: 1:1.7.10.4-1+wheezy1
  Candidate: 1:1.8.4~rc3-1~bpo70+1
  Version table:
     1:1.8.4~rc3-1~bpo70+1 0
        990 http://ftp.au.debian.org/debian/ wheezy-backports/main amd64 Packages
 *** 1:1.7.10.4-1+wheezy1 0
        500 http://ftp.au.debian.org/debian/ wheezy/main amd64 Packages
        100 /var/lib/dpkg/status
@basepi
Copy link
Contributor

basepi commented Oct 24, 2013

Just FYI, you should be using require as the requisite, not requires. However, since you're using require_in on the pkgrepo state, it's redundant anyway.

As far as your error goes, it's definitely a little strange that it works fine from the command line but salt has trouble with it. I wonder if it's related to the changes in how the apt commands are run that we added in 0.17.1. Did this state work previously, or is this the first time you've run this particular state?

@basepi
Copy link
Contributor

basepi commented Oct 24, 2013

Also, was git installed successfully, even though your state came back with an error?

@mafrosis
Copy link
Contributor Author

@basepi good catch. I found a couple of redundant requires in our state tree as a result too, so thanks! I've updated the original report with a more "correct" SLS.

The VM I'm testing on started out with git v1.7.10.4 installed. Running this SLS on that results in the error and no change to the git version.

Removing git first, resulted in an error and git v1.8.4.rc3 installed.

I ran a couple of tests, both with the initial install of v1.7 present. Success on Salt 0.16.4:

----------
    State: - pkg
    Name:      git
    Function:  latest
        Result:    True
        Comment:   The following packages were successfully installed/upgraded: git.
        Changes:   git: { new : 1:1.8.4~rc3-1~bpo70+1
old : 1:1.7.10.4-1+wheezy1
}
                   git-man: { new : 1:1.8.4~rc3-1~bpo70+1
old : 1:1.7.10.4-1+wheezy1
}

And also success on 0.17.0:

pkg_|-git_|-git_|-latest:
    ----------
    __run_num__:
        1
    changes:
        ----------
        git:
            ----------
            new:
                1:1.8.4~rc3-1~bpo70+1
            old:
                1:1.7.10.4-1+wheezy1
        git-man:
            ----------
            new:
                1:1.8.4~rc3-1~bpo70+1
            old:
                1:1.7.10.4-1+wheezy1
    comment:
        The following packages were successfully installed/upgraded: git.
    name:
        git
    result:
        True

@basepi
Copy link
Contributor

basepi commented Oct 25, 2013

Thanks for the update. That narrows it down a lot, I'm guessing it's related to the cmd changes that I mentioned, but I guess we'll see!

@terminalmage
Copy link
Contributor

#8164

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior Regression The issue is a bug that breaks functionality known to work in previous releases. severity-low 4th level, cosemtic problems, work around exists
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants