[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
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Ubuntu Cloud Archive
Fix Released
Medium
Unassigned
Queens
Fix Released
Medium
Unassigned
Rocky
Fix Released
Medium
Unassigned
gnocchi (Ubuntu)
Fix Released
Medium
Unassigned
Bionic
Fix Released
Medium
Unassigned
Cosmic
Fix Released
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.

Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in gnocchi (Ubuntu):
status: New → Confirmed
Revision history for this message
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

Revision history for this message
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?

Revision history for this message
György Szombathelyi (gyurco) wrote :

...or uwsgi can run gnocchi with Python3.

Revision history for this message
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,

Revision history for this message
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).

Revision history for this message
pablobrunetti (pablobrunetti) wrote :

Hello,

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

Thanks.

Revision history for this message
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

Revision history for this message
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).

Revision history for this message
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
Revision history for this message
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?

Revision history for this message
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.

Revision history for this message
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
Revision history for this message
Corey Bryant (corey.bryant) wrote :
description: updated
description: updated
Changed in cloud-archive:
status: Triaged → Fix Committed
Revision history for this message
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
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

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
Revision history for this message
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
Revision history for this message
pablobrunetti (pablobrunetti) wrote :

This new package works in Ubuntu 16.04(Xenial)?
I tested this new package, but an error occurred.

2018-07-19 14:24:20.189154 mod_wsgi (pid=17181): Target WSGI script '/usr/bin/gnocchi-api' cannot be loaded as Python module.
2018-07-19 14:24:20.189172 mod_wsgi (pid=17181): Exception occurred processing WSGI script '/usr/bin/gnocchi-api'.
2018-07-19 14:24:20.189196 Traceback (most recent call last):
2018-07-19 14:24:20.189217 File "/usr/bin/gnocchi-api", line 20, in <module>
2018-07-19 14:24:20.189250 from gnocchi.cli import api
2018-07-19 14:24:20.189271 ImportError: No module named gnocchi.cli

Revision history for this message
Corey Bryant (corey.bryant) wrote :

Pablo, this bug is specifically for 18.04+ (Bionic and above).

Revision history for this message
pablobrunetti (pablobrunetti) wrote :

Thanks Corey Bryant

Revision history for this message
Corey Bryant (corey.bryant) wrote :

Pablo or anyone else affected, the fix for this bug is also available in the queens-proposed cloud archive but the bug wasn't auto-updated for some reason. Marked as fix-commited for queens cloud archive.

Revision history for this message
Corey Bryant (corey.bryant) wrote :

Any help verifying this bug would be very much appreciated! Thanks.

Revision history for this message
Corey Bryant (corey.bryant) wrote :

Pablo, I misspoke earlier. This is available on xenial via the queens cloud-archive.

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

Revision history for this message
James Page (james-page) wrote :

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

 gnocchi (4.2.4-0ubuntu3~cloud0) bionic-rocky; urgency=medium
 .
   * New update for the Ubuntu Cloud Archive.
 .
 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.

Changed in cloud-archive:
status: Fix Committed → Fix Released
status: Fix Committed → Fix Released
Revision history for this message
Chiawei Xie (dommgifer) wrote :

I use ubuntu 18.04.1

But install gnocchi-api ,

still remove cinder-api, keystone, libapache2-mod-wsgi and nova-placement-api.

Revision history for this message
Corey Bryant (corey.bryant) wrote :

I was hoping someone beside me would verify this bug, but it's been sitting stagnant for a while now.

I've verified the new package version successfully installs py3 by default and py2 alternatives when explicitly specified on bionic-proposed and queens-proposed.

Test results: https://paste.ubuntu.com/p/k8QJmYcnVj/

tags: added: verification-done verification-done-bionic verification-queens-done
removed: verification-needed verification-needed-bionic verification-queens-needed
Revision history for this message
Chris Halse Rogers (raof) wrote :

We're quite happy for uploaders to verify their own uploads, particularly if it's been waiting more than a week!

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gnocchi - 4.2.4-0ubuntu1.1

---------------
gnocchi (4.2.4-0ubuntu1.1) bionic; 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 22:08:16 -0400

Changed in gnocchi (Ubuntu Bionic):
status: Fix Committed → Fix Released
Revision history for this message
Chris Halse Rogers (raof) wrote : Update Released

The verification of the Stable Release Update for gnocchi has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Corey Bryant (corey.bryant) wrote :

The verification of the Stable Release Update for gnocchi has completed successfully and the package has now been released to -updates. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Corey Bryant (corey.bryant) wrote :

This bug was fixed in the package gnocchi - 4.2.4-0ubuntu1.1~cloud0
---------------

 gnocchi (4.2.4-0ubuntu1.1~cloud0) xenial-queens; urgency=medium
 .
   * New update for the Ubuntu Cloud Archive.
 .
 gnocchi (4.2.4-0ubuntu1.1) bionic; 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.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.