python 2.7.15~rc1-1 breaks chef

Asked by Bill MacAllister

On our most recent builds of 18.04 systems we are seeing the following chef failure:

[2019-06-12T07:28:14+00:00] FATAL: ArgumentError: python_virtualenv[/opt/.corp_env] (corp_python_dbxcorp::default line 14) had an error: ArgumentError: python_runtime_pip[/opt/.corp_env] (/var/chef/cache/cookbooks/poise-python/files/halite_gem/poise_python/python_providers/base.rb line 118) had an error: ArgumentError: Malformed version number string 2.7.15+

It appears that chef/ruby are choking on the '+' in the python version number. What is puzzling about this failure is that this change in behavior is quite recent, i.e. within the last week or two. Additionally, the version show by apt on a working system and a failing system are the same, but the output of python --version differs.

Working
-------------
$ apt policy python
python:
  Installed: 2.7.15~rc1-1
  Candidate: 2.7.15~rc1-1
...
$ python --version
Python 2.7.15rc1

Failing
----------
# apt policy python
python:
  Installed: 2.7.15~rc1-1
  Candidate: 2.7.15~rc1-1
...
# python --version
Python 2.7.15+

The failure is bad enough, but that the version number has not been incremented is really troubling.

Is there a work around for this problem? Am I missing something?

Thanks for you ear,

Bill

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Manfred Hampl (m-hampl) said :
#1

What is the output of

which python

on these two systems?

Revision history for this message
Bill MacAllister (oill) said :
#2

I dug around some more and realized that I was looking at the wrong packages when analyzing the version differences. The version on the failing systems were 2.7.15-4ubuntu4~18.04. By downgrading to the following packages I was able to get chef to run to completion.

libpython2.7-dev_2.7.15~rc1-1ubuntu0.1_amd64.deb
libpython2.7-minimal_2.7.15~rc1-1ubuntu0.1_amd64.deb
libpython2.7-stdlib_2.7.15~rc1-1ubuntu0.1_amd64.deb
libpython2.7_2.7.15~rc1-1ubuntu0.1_amd64.deb
python2.7-dev_2.7.15~rc1-1ubuntu0.1_amd64.deb
python2.7-minimal_2.7.15~rc1-1ubuntu0.1_amd64.deb
python2.7_2.7.15~rc1-1ubuntu0.1_amd64.deb

So, my original worry about the version number not changing was wrong, but the problem caused by the newer version of python 2.7 remains. I guess it might be a ruby/chef bug that the change in internal python version number has exposed.

Revision history for this message
Manfred Hampl (m-hampl) said :
#3

Part of the diff between python2.7 version 2.7.15~rc1-1 and version 2.7.15-4ubuntu4~18.04
https://launchpad.net/ubuntu/+archive/primary/+files/python2.7_2.7.15~rc1-1_2.7.15-4ubuntu4~18.04.diff.gz

+diff --git a/Include/patchlevel.h b/Include/patchlevel.h
+index 99e837024a..8a04a90f9a 100644
+--- a/Include/patchlevel.h
++++ b/Include/patchlevel.h
+@@ -27,7 +27,7 @@
+ #define PY_RELEASE_SERIAL 0
+
+ /* Version as a string */
+-#define PY_VERSION "2.7.15"
++#define PY_VERSION "2.7.15+"
+ /*--end constants--*/

Apparently in python 2.7.15-4ubuntu4~18.04 the string "2.7.15+" is displayed as version Information.

It seems that is is a known problem
https://github.com/DataDog/chef-datadog/issues/79

Revision history for this message
Jamie Murphy (itjamie) said :
#4

Im also experiencing this issue

Ive logged this over at https://github.com/poise/poise-python/issues/146 aswell.

Revision history for this message
Jamie Murphy (itjamie) said :
#5

Ive written a patch for this in https://github.com/ITJamie/poise-python-patched

poise-python maintainer has archived his code and is no longer supporting. feel free to use my fork @bill

Can you help with this problem?

Provide an answer of your own, or ask Bill MacAllister for more information if necessary.

To post a message you must log in.