salt icon indicating copy to clipboard operation
salt copied to clipboard

[FreeBSD] pkg broken in 10.0-RELEASE

Open m87carlson opened this issue 12 years ago • 6 comments

I've upgraded to 10.0-RELEASE at it seems with both 0.17.4 and 0.17.5, the pkg module is broken:

FreeBSD 10.0 system using salt 0.17.5:

[root@server states]> uname -a
FreeBSD server.m87-blackhole.org 10.0-RELEASE FreeBSD 10.0-RELEASE #0 r260789: Thu Jan 16 22:34:59 UTC 2014     [email protected]:/usr/obj/usr/src/sys/GENERIC  amd64
[root@server states]> salt --versions-report
           Salt: 0.17.5
         Python: 2.7.6 (default, Dec 12 2013, 17:19:47)
         Jinja2: 2.7.1
       M2Crypto: 0.21.1
 msgpack-python: 0.4.0
   msgpack-pure: Not Installed
       pycrypto: 2.6.1
         PyYAML: 3.10
          PyZMQ: 14.0.1
            ZMQ: 4.0.3

FreeBSD 10.0 system using salt 0.17.4

root@fbsd-qa:~ # uname -a
FreeBSD fbsd-qa.discdrive.bayphoto.com 10.0-RELEASE FreeBSD 10.0-RELEASE #0 r260789: Thu Jan 16 22:34:59 UTC 2014     [email protected]:/usr/obj/usr/src/sys/GENERIC  amd64
root@fbsd-qa:~ # salt --versions-report
           Salt: 0.17.4
         Python: 2.7.6 (default, Dec 12 2013, 17:19:47)
         Jinja2: 2.7.1
       M2Crypto: 0.21.1
 msgpack-python: 0.4.0
   msgpack-pure: Not Installed
       pycrypto: 2.6.1
         PyYAML: 3.10
          PyZMQ: 14.0.1
            ZMQ: 4.0.3

pkg module traceback:

root@fbsd-qa:~ # salt-call pkg.install vim
[INFO    ] Executing command '/sbin/zfs help || :' in directory '/root'
[INFO    ] Executing command 'None' in directory '/root'
[ERROR   ] An un-handled exception was caught by salt's global exception handler:
ValueError: need more than 1 value to unpack
Traceback (most recent call last):
  File "/usr/local/bin/salt-call", line 9, in <module>
    load_entry_point('salt==0.17.4', 'console_scripts', 'salt-call')()
  File "/usr/local/lib/python2.7/site-packages/salt/scripts.py", line 77, in salt_call
    client.run()
  File "/usr/local/lib/python2.7/site-packages/salt/cli/__init__.py", line 303, in run
    caller.run()
  File "/usr/local/lib/python2.7/site-packages/salt/cli/caller.py", line 135, in run
    ret = self.call()
  File "/usr/local/lib/python2.7/site-packages/salt/cli/caller.py", line 78, in call
    ret['return'] = func(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/salt/modules/freebsdpkg.py", line 290, in install
    old = list_pkgs()
  File "/usr/local/lib/python2.7/site-packages/salt/modules/freebsdpkg.py", line 187, in list_pkgs
    pkg, ver = line.split(' ')[0].rsplit('-', 1)
ValueError: need more than 1 value to unpack
Traceback (most recent call last):
  File "/usr/local/bin/salt-call", line 9, in <module>
    load_entry_point('salt==0.17.4', 'console_scripts', 'salt-call')()
  File "/usr/local/lib/python2.7/site-packages/salt/scripts.py", line 77, in salt_call
    client.run()
  File "/usr/local/lib/python2.7/site-packages/salt/cli/__init__.py", line 303, in run
    caller.run()
  File "/usr/local/lib/python2.7/site-packages/salt/cli/caller.py", line 135, in run
    ret = self.call()
  File "/usr/local/lib/python2.7/site-packages/salt/cli/caller.py", line 78, in call
    ret['return'] = func(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/salt/modules/freebsdpkg.py", line 290, in install
    old = list_pkgs()
  File "/usr/local/lib/python2.7/site-packages/salt/modules/freebsdpkg.py", line 187, in list_pkgs
    pkg, ver = line.split(' ')[0].rsplit('-', 1)
ValueError: need more than 1 value to unpack

m87carlson avatar Feb 03 '14 00:02 m87carlson

I've opened up a PR against the FreeBSD port, which is assigned to Christer:

http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/186397

m87carlson avatar Feb 03 '14 18:02 m87carlson

The code to which the traceback refers no longer exists in git, since FreeBSD package management has been completely rewritten.


In releases <= 0.17.x:

  • freebsdpkg.py - pkg_add support, and tries to implement pkgng if it detects the pkgng sqlite database.
  • pkgng.py - separate pkgng module, with only certain functions implemented.

Neither module is fully-implemented.


In releases >= 2014.1.0:

  • freebsdpkg.py - Does pkg_add only. Default pkg provider on FreeBSD <= 9.x
  • pkgng.py - Does pkgng only. Default pkg provider on FreeBSD >= 10.x. To use pkgng on hosts running FreeBSD 9.x or earlier, use the providers setting as documented here.

Both modules now contain a full implementation.


Since this bug is being reported against code that no longer exists, I will close it. Please file a separate issue if there are problems with package management in Salt 2014.1.0, which is due to be released this week.

terminalmage avatar Feb 03 '14 20:02 terminalmage

That is fine with me, thank you for the summary of how pkgng will work on 9.x and 10.x system

m87carlson avatar Feb 03 '14 20:02 m87carlson

No prob! I personally rewrote the FreeBSD package management for 2014.1 and also added FreeBSD ports support. I'm eager to see people start to use it so this new support can be refined.

terminalmage avatar Feb 03 '14 21:02 terminalmage

You and I will be very close friends over the next month :)

I have a good variety of 9.x and 10.0 servers to update and test with, so I'll do my best to help shake out any issues I see.

On Mon, Feb 3, 2014 at 1:18 PM, Erik Johnson [email protected]:

No prob! I personally rewrote the FreeBSD package management for 2014.1 and also added FreeBSD ports support. I'm eager to see people start to use it so this new support can be refined.

Reply to this email directly or view it on GitHubhttps://github.com/saltstack/salt/issues/10127#issuecomment-34001102 .

m87carlson avatar Feb 03 '14 21:02 m87carlson

Fantastic! Looking forward to it. :smile:

terminalmage avatar Feb 03 '14 21:02 terminalmage