[SRU] gnocchi-api in Bionic uses python3, and libapache2-mod-wsgi-py3 conflicts with the python 2 version

Bug #1746992 reported by György Szombathelyi on 2018-02-02
24
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Ubuntu Cloud Archive
Status tracked in Rocky
Queens
Medium
Unassigned
Rocky
Medium
Unassigned
gnocchi (Ubuntu)
Status tracked in Cosmic
Bionic
Medium
Unassigned
Cosmic
Medium
Unassigned

Bug Description

Since the two wsgi modules are conflicting, installing gnocchi-api breaks other OpenStack services.

[Impact]
Installation of gnocchi-api (which is currently py3 only) on the same machine as other OpenStack services that are py2 only causes conflicts. libapache2-mod-wsgi-py3 and libapache2-mod-wsgi conflict with each other.

[Test Case]
Ensure cinder-api (py2 only atm) and gnocchi-api (with new py2 alternatives) can be installed on the same machine.

[Regression Potential]
Low. This doesn't make any changes to the existing py3 version of gnocchi-api. It only adds alternatives that enable a py2 version of gnocchi-api.

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gnocchi (Ubuntu):
status: New → Confirmed
Corey Bryant (corey.bryant) wrote :

Hi Gyorgy,

Thanks for reporting this. Does this only occur when you co-locate APIs for other services with gnocchi's API?

Thanks,
Corey

György Szombathelyi (gyurco) wrote :

Yes, it conflicts only with keystone, cinder, the placement-api (the ones which runs under Apache with mod_wsgi, the Python2 version). However, not installing gnocchi-api solves the issue, since python-gnocchi contains all things which needed to run with mod_wsgi (Python 2), just had to install the apache site config manually, so co-location is possible.
But maybe gnocchi-api can be switched back to Python2 until all OpenStack packages can use Python3?

György Szombathelyi (gyurco) wrote :

...or uwsgi can run gnocchi with Python3.

kobayashi (abok-1k) wrote :

Hello,

I have same issue for OpenStack queens. Is there any workaround?
gnocchi-api depends on libapache2-mod-wsgi-py3, while some OpenStack packages such as keystone, cinder, and dashboard depend on libapache2-mod-wsgi.

Thanks,

György Szombathelyi (gyurco) wrote :

My workaround is to not install gnocchi-api, only python-gnocchi, and create the apache site config manually (which is the only relevant thing in the gnocchi-api package).

pablobrunetti (pablobrunetti) wrote :

Hello,

I had the same problem. Does anyone know when this issue will be fixed?

Thanks.

Thiago Martins (martinx) wrote :

Same problem here! :-/

The gnocchi-api package looks bad.

It doesn't even contain the "/usr/bin/gnocchi-api"! Only an apache config file...

Looks trivial to fix this problem.

No idea why the "/usr/bin/gnocchi-api" comes from "python-gnocchi" package...

What's happening to Debian/Ubuntu?! :-O

Or is it Gnocchi that it is "crazy"... lol

:-P

Jeremy Stanley (fungi) wrote :

https://packages.ubuntu.com/bionic/gnocchi-api seems to indicate it's coming straight through an import from Debian, where the current OpenStack ecosystem is packaged to use only Python 3.x. This probably makes it incompatible with the official Ubuntu OpenStack packaging which still relies on Python 2.7. If I were to guess, Gnocchi isn't included due to it not officially being part of OpenStack any longer (the developers decided to move out of OpenStack and form their own community around Gnocchi in March of 2017).

Corey Bryant (corey.bryant) wrote :

Correct, gnocchi-api only supports py3 for now in bionic/queens and above.

Jeremy, that's true but we plan to enable py2 by default for any packages that we share with Debian in Cosmic to prevent issues like this bug. Most OpenStack packages in Ubuntu have not yet received py3 support. That is a focus for the cosmic cycle. Where possible the plan is to install py2 by default and py3 as an alternative.

That's not the case for gnocchi-api, obviously, as it only installs py3 which conflicts with other python packages if and only if you're installing on the same system as other py2 services. Most modern production deployments isolate services in one way or another (e.g. containers such as LXD or docker or VMs).

With that said, we can probably add py2 alternative packages to the Depends for gnocchi-api allowing py2 installs. But this is not a high priorty bug as there is a clear work-around. Also I seem to remember gnocchi-api was forced to move to py3 for a reason, but I'm not remembering why atm.

Changed in gnocchi (Ubuntu):
status: Confirmed → Triaged
importance: Undecided → Medium
Changed in gnocchi (Ubuntu Bionic):
status: New → Triaged
importance: Undecided → Medium
Thiago Martins (martinx) wrote :

What about making "gnocchi-api" to depends on "python-gnocchi", instead of "python3-gnocchi"?

I just installed it (python-gnocchi) here! But I didn't tested it yet (missing correct config files).

So, if Gnocchi _only_ works with Python 3, why there is this "python-gnocchi" that is based on Python 2?

Corey Bryant (corey.bryant) wrote :

I've just uploaded gnocchi 4.2.4-0ubuntu3 to cosmic (rocky) and gnocchi gnocchi 4.2.4-0ubuntu3 to the bionic (queens) unapproved queue where it is awaiting review by the SRU team.

The new new package versions are still py3 by default. If you install gnocchi-api, by default it will install libapache2-mod-wsgi-py3 and python3-gnocchi. However, with the new versions, if you install libapache2-mod-wsgi and python-gnocchi prior to installing gnocchi-api, you'll get py2 support.

Please help us test this! Thanks.

Corey Bryant (corey.bryant) wrote :

Sorry, the bionic version is 4.2.4-0ubuntu1.1

summary: - gnocchi-api in Bionic uses python3, and libapache2-mod-wsgi-py3
+ [SRU] gnocchi-api in Bionic uses python3, and libapache2-mod-wsgi-py3
conflicts with the python 2 version
Corey Bryant (corey.bryant) wrote :
description: updated
description: updated
Changed in cloud-archive:
status: Triaged → Fix Committed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gnocchi - 4.2.4-0ubuntu3

---------------
gnocchi (4.2.4-0ubuntu3) cosmic; urgency=medium

  * Enable alternative python2 dependencies for gnocchi-api (LP: #1746992):
    - d/control: gnocchi-api depends on libapache2-mod-wsgi-py3 by default and
      libapache2-mod-wsgi as an alternative. gnocchi-api also depends on
      gnocchi-common, which depends on python3-gnocchi by default and
      python-gnocchi as an alternative.
    - d/control: move all other python run-time dependencies to
      python(3)-gnocchi packages.
    - d/control: Add Conflicts to python(3)-gnocchi binary to ensure both
      can't be installed at the same time.
    - d/control, d/tests/*: Enable autopkgtest-pkg-python testsuite and drop
      obsolete XS-Testsuite: autopkgtest header.
    - d/tests/*: Add Python 2/3 autopkgtests for gnocchi daemons and shebangs.

 -- Corey Bryant <email address hidden> Thu, 07 Jun 2018 13:22:19 -0400

Changed in gnocchi (Ubuntu Cosmic):
status: Triaged → Fix Released

Hello György, or anyone else affected,

Accepted gnocchi into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/gnocchi/4.2.4-0ubuntu1.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in gnocchi (Ubuntu Bionic):
status: Triaged → Fix Committed
tags: added: verification-needed verification-needed-bionic
Corey Bryant (corey.bryant) wrote :

Hello György, or anyone else affected,

Accepted gnocchi into queens-proposed. The package will build now and be available in the Ubuntu Cloud Archive in a few hours, and then in the -proposed repository.

Please help us by testing this new package. To enable the -proposed repository:

  sudo add-apt-repository cloud-archive:queens-proposed
  sudo apt-get update

Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-queens-needed to verification-queens-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-queens-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

tags: added: verification-queens-needed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers