[SRU] rabbitmqadmin shows %%VSN%% as version

Bug #1773324 reported by Nick
26
This bug affects 2 people
Affects Status Importance Assigned to Milestone
rabbitmq-server (Debian)
Fix Released
Unknown
rabbitmq-server (Ubuntu)
Fix Released
High
Unassigned
Bionic
Fix Released
Medium
Dan Streetman
Cosmic
Won't Fix
Medium
Unassigned
Disco
Won't Fix
Medium
Unassigned
Eoan
Won't Fix
High
Unassigned
Focal
Fix Released
High
Unassigned

Bug Description

[Impact]
Version information is displayed by rabbitmq-server, preventing configuration management tools from deploying and maintaining the services properly.

[Test Case]
$ rabbitmqadmin --version
rabbitmqadmin %%VSN%%

[Regression Potential]
Very low. The patch simply adds a step to the makefile. Things to look for would be build-time related problems; none are expected.

[scope]

This is fixed in Debian by commit:
https://salsa.debian.org/openstack-team/third-party/rabbitmq-server/commit/9d13c83ecab526e46d01e4250d157f2085fa43b6

That is included in Debian starting in version 3.7.18-1, which is in Ubuntu starting in Focal. The version in Xenial does not include 'rabbitmqadmin' so this problem does not exist there.

This is needed only for Eoan and Bionic (but I will not patch Eoan, see other info below).

[other info]

Unfortunately, rabbitmq-server in Eoan was carried over from Disco, but one of its build dependencies, elixir, was upgraded in Eoan. The version of rabbitmq-server in Disco and Eoan internally sets a elixir upper version limit of 1.8.0, while it is version 1.9.1 in Eoan. So, rabbitmq-server is no longer (and never has been) buildable in Eoan. Since this is a minor issue and Eoan is EOL in several months, I think it is safer to skip this fix for Eoan and leave rabbitmq-server there untouched.

[Fix]
Upstream's release scripts substitute in the version string, but that logic isn't triggered during the regular debian package build. It's straightforward to fix by inserting an equivalent sed command to the makefile during our build.

This issue affects rabbitmq-server from Bionic forward, and will need carried in our own packaging. The fix may be worth forwarding to debian as well, once it's confirmed their package is affected as well.

For testing, a PPA with packages containing the fix is available at:
https://launchpad.net/~bryce/+archive/ubuntu/sru.1773324

[Discussion]

[Original Report]
When running 'rabbitmqadmin --version' it shows %%VSN%% as the version information on Ubuntu 18.04 and not the correct rabbitmq version. We are using puppet to install and configure rabbitmq server and the puppet-rabbitmq modules [1] are using the version information from that command internally. Currently they are failing in Ubuntu 18.04.

Used versions:

Distributor ID: Ubuntu
Description: Ubuntu 18.04 LTS
Release: 18.04
Codename: bionic
rabbitmq-server: 3.6.10-1

[1] https://github.com/voxpupuli/puppet-rabbitmq

ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: rabbitmq-server 3.6.10-1
ProcVersionSignature: Ubuntu 4.15.0-20.21-generic 4.15.17
Uname: Linux 4.15.0-20-generic x86_64
ApportVersion: 2.20.9-0ubuntu7
Architecture: amd64
Date: Fri May 25 09:46:18 2018
PackageArchitecture: all
SourcePackage: rabbitmq-server
UpgradeStatus: No upgrade log present (probably fresh install)
modified.conffile..etc.default.rabbitmq-server: [modified]
mtime.conffile..etc.default.rabbitmq-server: 2018-05-24T07:06:38.256492

Related branches

Revision history for this message
Nick (n6ck) wrote :
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Confirmed in artful, bionic and cosmic.

Changed in rabbitmq-server (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
tags: added: bitesize
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

All that's needed is a sed pass on deps/rabbitmq_management/bin/rabbitmqadmin, which has:
VERSION = '%%VSN%%'

Its makefile seems to be ready for that in the prepare-dist target:
prepare-dist::
        $(verbose) sed 's/%%VSN%%/$(PROJECT_VERSION)/' bin/rabbitmqadmin \
                > $(EZ_DIR)/priv/www/cli/rabbitmqadmin

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Still happens with disco:
root@disco-rabbit:~# rabbitmqadmin --version
rabbitmqadmin %%VSN%%

root@disco-rabbit:~# dpkg-query -W rabbitmq-server
rabbitmq-server 3.7.8-4ubuntu2

Revision history for this message
Alvin Joseph Tang (alvintang3) wrote :

Hi! I'd like to work on this bug. I am targeting fix for bionic.

This is my first bug and I'll give it my best. I've already created a package and able to change the version message using sed as mentioned in previous comment but the string is hard coded. How do I get the correct version of the package to use in place of %%VSN%%?

Thank you!

Changed in rabbitmq-server (Ubuntu):
assignee: nobody → Alvin Joseph Tang (alvintang3)
Revision history for this message
Bryce Harrington (bryce) wrote :

Hi Alvin, thanks for giving this issue some attention.

Often, projects will have some infrastructure in place for tracking their version. I would suggest start by reviewing their release directions, to see if they've documented where they set the number at release. Often there is a header/include file or a .in file somewhere, that gets processed and inserted where it's needed at build time. Or just do a grep through the source for %%VSN%% and see what references it.

If you don't find it quickly, let me know here or catch me on IRC and I'll help you look.

Changed in rabbitmq-server (Ubuntu Disco):
importance: Undecided → Medium
Changed in rabbitmq-server (Ubuntu Cosmic):
importance: Undecided → Medium
Changed in rabbitmq-server (Ubuntu Bionic):
importance: Undecided → Medium
Changed in rabbitmq-server (Ubuntu Disco):
status: New → Triaged
Changed in rabbitmq-server (Ubuntu Cosmic):
status: New → Triaged
Changed in rabbitmq-server (Ubuntu Bionic):
status: New → Triaged
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

See where the $(PROJECT_VERSION) makefile variable is defined, as that is used in the sed to replace the %string%, and go from there.

Revision history for this message
Alvin Joseph Tang (alvintang3) wrote :

Thanks Bryce and Andreas. I have this debdiff for Bionic. I built this using pbuilder-dist and it builds successfully. I also installed and tested and it works as intended. Please let me know your thoughts.

Revision history for this message
Bryce Harrington (bryce) wrote :

Hi Alvin,

Good progress! And thanks for documenting the patch. I would suggest a few changes:

* Instead of calling it 'mypatch.diff' give it a descriptive name, like 'fix-version-string.patch'

* In the patch metadata, make sure to replace all the stuff in <angle brackets>. For example, instead of:

Description: Replace %%VSN%% in rabbitmqadmin with version number
 <long description that can span multiple lines, optional>
Author: Alvin Joseph Tang, <email address hidden>
Origin: <upstream|backport|vendor|other>, <URL, required except if Author is present>
Bug: https://bugs.launchpad.net/ubuntu/+source/rabbitmq-server/+bug/1773324
Applied-Upstream: <version|URL|commit, identifies patches merged upstream, optional>
Reviewed-by: <name and email of a reviewer, optional>
Last-Update:

You could say something like:

Description: Replace %%VSN%% in rabbitmqadmin with version number
Author: Alvin Joseph Tang, <email address hidden>
Origin: backport
Bug: https://bugs.launchpad.net/ubuntu/+source/rabbitmq-server/+bug/1773324
Applied-Upstream: 3.6.10
Reviewed-by: Bryce Harrington <email address hidden>
Last-Update: 2019-06-05

tags: added: patch
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "debdiff" seems to be a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. If the attachment isn't a patch, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are member of the ~ubuntu-sponsors, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issue please contact him.]

Revision history for this message
Alvin Joseph Tang (alvintang3) wrote :

Thanks for the comments Bryce! I attached here the updated patch based on your comments.

Do I also build and test for other releases tagged in this bug?

Revision history for this message
Bryce Harrington (bryce) wrote :

Hi Alvin,

Looking really good.

Sorry for the confusion with the patch name, rather than 'fix-3.6.10.patch' I think you should call it, literally, 'fix-version-string.patch' since it is fixing the version string.

You can probably omit the line "This patch header follows DEP-3: http://dep.debian.net/deps/dep3/" from the patch header.

And yes, please do build and test the other releases. Possibly the same debdiff will apply to them all but sometimes there can be small discrepancies, so is good practice to test them.

Revision history for this message
Alvin Joseph Tang (alvintang3) wrote :

Thanks for the clarification Bryce! I updated the patch attached and tested it works also in Cosmic. Disco uses version 3.7.8 and is it correct I need to create a new patch for Disco since the documentation is for a different version?

Revision history for this message
Alvin Joseph Tang (alvintang3) wrote :

Re-uploading patch v3, I just corrected the date in last updated.

Revision history for this message
Alvin Joseph Tang (alvintang3) wrote :

I created a separate debdiff for Eoan and Disco since it uses rabbitmq-server 3.7.8 already. I was able to build and test it on both Disco and Eoan.

Robie Basak (racb)
tags: added: server-next
Revision history for this message
Bryce Harrington (bryce) wrote :

Thanks Alvin, those debdiffs look good, I'll try and work on getting merge proposals put together for them today.

Bryce Harrington (bryce)
summary: - rabbitmqadmin shows %%VSN%% as version
+ [SRU] rabbitmqadmin shows %%VSN%% as version
Bryce Harrington (bryce)
description: updated
Bryce Harrington (bryce)
Changed in rabbitmq-server (Ubuntu Bionic):
assignee: nobody → Alvin Joseph Tang (alvintang3)
Changed in rabbitmq-server (Ubuntu Cosmic):
assignee: nobody → Alvin Joseph Tang (alvintang3)
Changed in rabbitmq-server (Ubuntu Disco):
assignee: nobody → Alvin Joseph Tang (alvintang3)
Revision history for this message
Alvin Joseph Tang (alvintang3) wrote :

Thanks Bryce for all the help! Do I need to do anything else or just have to wait for now?

Revision history for this message
Bryce Harrington (bryce) wrote :

Yes, next will be waiting on some reviews and approvals. When it is approved by the SRU team, they will request a test to validate the fix.

Meanwhile, if you'd like to do more, you might look at some of the other rabbitmq-server bugs, if there's any of interest you can reproduce: https://bugs.launchpad.net/ubuntu/+source/rabbitmq-server/

description: updated
Revision history for this message
Bryce Harrington (bryce) wrote :

Hi Alvin,

One question has come up in triage that perhaps you could help address:

"The file deps/rabbitmq_management/Makefile already has a Makefile target called "prepare-dist" that does this sed. Why repeat it with "all"? Was upstream approached as to why "prepare-dist" is not being called, and whether this is a good fix?"

Revision history for this message
Alvin Joseph Tang (alvintang3) wrote :

Hi Bryce,

I looked into the Makefile and it seems that prepare-dist target is used when producing the erlang plugin archives (.ez files) and not when building the package itself. Based on the build server documentation[1], all is the default target that is why I used that fix. There's a difference between the sed commands though, the fix replaces the version inline the rabbitmqadmin file itself but for prepare-dist it's generating a new file.

Sorry just to be clear, upstream is the rabbitmq-server repository itself right? I haven't approach them about this problem and whether it's a good fix. I'll do that and get back to you.

[1] https://www.rabbitmq.com/build-server.html

Revision history for this message
Bryce Harrington (bryce) wrote :

Hi Alvin, just checking in to see if you've had a chance to raise this issue with upstream? I've found it a bit confusing myself what the exact upstream package is for this, but my guess is similar people work on all the various pieces and/or can point you in the right directions.

I'm not super familiar with rabbitmq, and am curious if rabbitmq-server corresponds to an actual tarball package provided by upstream, and if so why it would come configured with %%VSN%% as the version. If it's a repackage, then perhaps the script that generates the package could do the substitution.

Revision history for this message
Alvin Joseph Tang (alvintang3) wrote :

Hi Bryce,

Please see this thread in rabbitmq-server group about my inquiry: https://groups.google.com/forum/#!topic/rabbitmq-users/KW0VdnXMS-U

I haven't had the time to replicate yet what he mentioned here but it seems that rabbitmqadmin should be enabled using rabbitmq-plugin. I think we are using the wrong file in running rabbitmqadmin as mentioned in the thread. I'm not also familiar that much with rabbitmq-server.

Revision history for this message
Bryce Harrington (bryce) wrote :

Hi Alvin, have you had a chance to test out their packaging approach yet? I'm really curious why it would work where ours doesn't, and despite digging through it this morning am still perplexed.

I dug through their packaging to try and understand why it works where ours doesn't, but didn't spot anything obvious. I verified we're using the same orig.tar.xz archive as provided by them:

  3b2e7514a016a81859443723f6be514b ../upstream/rabbitmq-server-3.6.10.tar.xz
  3b2e7514a016a81859443723f6be514b ../bionic/rabbitmq-server_3.6.10.orig.tar.xz

But we can see the %%VSN%% is not substituted in the production of these archives:

  upstream/rabbitmq-server-3.6.10$ grep -sr %%VSN *
  deps/rabbitmq_management/Makefile: $(verbose) sed 's/%%VSN%%/$(PROJECT_VERSION)/' bin/rabbitmqadmin
 deps/rabbitmq_management/bin/rabbitmqadmin:VERSION = '%%VSN%%'

You can see this is still true in the 3.7.9 package:

   https://dl.bintray.com/rabbitmq/all/rabbitmq-server/3.7.9/

  rabbitmq-server-3.7.9$ grep %%VSN -sr .
  ./deps/rabbitmq_management/Makefile: $(verbose) sed 's/%%VSN%%/$(PROJECT_VERSION)/' bin/rabbitmqadmin \
  ./deps/rabbitmq_management/bin/rabbitmqadmin:VERSION = '%%VSN%%'

Normally, like with C++ projects, the 'dist' target is what you run to create the release tarball, so is only pertinent to upstream and not supposed to be used for debian packaging. From the name, I would expect this same to be true with a target named 'prepare-dist' as well. Indeed, digging through their makefiles I found this comment:

  # If the application's Makefile defines a `list-dist-deps` target, we
  # use it to populate the dependencies list. This is useful when the
  # application has also a `prepare-dist` target to modify the created
  # tree before we make an archive out of it.

That makes me think that their intention is indeed that prepare-dist is intended to run *prior* to making the archive (i.e. tarball) of it. But since rabbitmqadmin still shows %%VSN%% for version in the rabbitmqadmin script from the tarball posted on rabbitmq's website, I don't know if it's just a bug in the release process, or if I've misunderstood something.

I wondered if perhaps the `rabbitmq-plugins enable rabbitmq_management` they mention does a VSN substitution, however in reviewing that code I didn't see a step that does that.

It would be useful to know if upstream intends for the rabbitmqadmin in their release tarballs to have %%VSN%% as the value for VERSION, or if that should be showing the actual version number. Assuming the former, then question #2 is whether they intend the prepare-dist target to be used in the production of the release archive (e.g. like in a traditional 'make dist'), or if that is intended to be run by the packager/user (e.g. like as part of the 'make && make install' step).

I hope what I've written is sensible.

Revision history for this message
Bryce Harrington (bryce) wrote :

I've set the merge requests to WIP, as the reviewers don't want to proceed with this as is.

They suggest if the version must be set on our end, it may be more appropriate if the substitution is done in the debian/rules file than via a patch to the upstream makefile.

Revision history for this message
Bryce Harrington (bryce) wrote :
Changed in rabbitmq-server (Ubuntu Bionic):
assignee: Alvin Joseph Tang (alvintang3) → nobody
Changed in rabbitmq-server (Ubuntu Cosmic):
assignee: Alvin Joseph Tang (alvintang3) → nobody
Changed in rabbitmq-server (Ubuntu Disco):
assignee: Alvin Joseph Tang (alvintang3) → nobody
Changed in rabbitmq-server (Ubuntu Eoan):
assignee: Alvin Joseph Tang (alvintang3) → nobody
Changed in rabbitmq-server (Ubuntu Eoan):
assignee: nobody → Bryce Harrington (bryce)
Changed in rabbitmq-server (Ubuntu Cosmic):
status: Triaged → Won't Fix
Changed in rabbitmq-server (Ubuntu Eoan):
importance: Medium → High
Changed in rabbitmq-server (Debian):
status: Unknown → Fix Released
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

The fix taken is mixed with some py3 changes, but it eventually was in d/rules:

+override_dh_install:
+ dh_install
+ sed -i s/%%VSN%%/$(VERSION)/ $(CURDIR)/debian/rabbitmq-server/usr/bin/rabbitmqadmin

From:
https://salsa.debian.org/openstack-team/third-party/rabbitmq-server/-/commit/9d13c83ecab526e46d01e4250d157f2085fa43b6

Using the same change would make a later merge easier.
We can consider SRUs later, lets get this into Focal while we still can.

@Bryce - this one is still assigned to you - are you going to revamp that for a focal upload?

Dan Streetman (ddstreet)
Changed in rabbitmq-server (Ubuntu Focal):
status: Triaged → Fix Released
Dan Streetman (ddstreet)
description: updated
Changed in rabbitmq-server (Ubuntu Disco):
status: Triaged → Won't Fix
Dan Streetman (ddstreet)
description: updated
Changed in rabbitmq-server (Ubuntu Eoan):
status: Triaged → Won't Fix
Revision history for this message
Dan Streetman (ddstreet) wrote :

uploaded to bionic; won't fix eoan (see description)

Changed in rabbitmq-server (Ubuntu Bionic):
status: Triaged → In Progress
tags: added: ubuntu-sponsor-ddstreet
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

@Dan - while bryce is working on this it isn't fixed in Focal yet.
Therefore the SRU is still blocked IMHO.

Changed in rabbitmq-server (Ubuntu Focal):
status: Fix Released → In Progress
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Outch I should learn to order numbers :-)
3.7.18-1 << 3.8.2-0ubuntu1

Me reverts what I said in comment #28

Changed in rabbitmq-server (Ubuntu Focal):
status: In Progress → Fix Released
assignee: Bryce Harrington (bryce) → nobody
Changed in rabbitmq-server (Ubuntu Eoan):
assignee: Bryce Harrington (bryce) → nobody
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

That only leaves the question who is prepping the SRU for Bionic Bryce, Dan or ... ?
Please assign the bug task once you have sorted that out.

Revision history for this message
Dan Streetman (ddstreet) wrote :

Sorry, I didn't think Bryce was still working on this; SEG is starting to take over the ubuntu sponsors queue and this happened to be the oldest in the queue when I had a shift last week.

This is in the upload queue for Bionic already.

Changed in rabbitmq-server (Ubuntu Bionic):
assignee: nobody → Dan Streetman (ddstreet)
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Please test proposed package

Hello Nick, or anyone else affected,

Accepted rabbitmq-server into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/rabbitmq-server/3.6.10-1ubuntu0.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, what testing has been performed on the package 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 for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in rabbitmq-server (Ubuntu Bionic):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-bionic
Revision history for this message
Bryce Harrington (bryce) wrote :

Thanks Dan, this was far on back burner for me, happy to turn it over.

Revision history for this message
Albert Damen (albrt) wrote :

With Original package
rabbitmq-server:
  Installed: 3.6.10-1

~# rabbitmqadmin --version
rabbitmqadmin %%VSN%%

With upgraded package from proposed
rabbitmq-server:
  Installed: 3.6.10-1ubuntu0.1

~# rabbitmqadmin --version
rabbitmqadmin 3.6.10

I use rabbitmq as part of a small openstack test cluster. After the upgrade the cluster still worked, I could see elements in openstack dashboard and successfully started and deleted two instances.

tags: added: verification-done-bionic
removed: verification-needed-bionic
Dan Streetman (ddstreet)
tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package rabbitmq-server - 3.6.10-1ubuntu0.1

---------------
rabbitmq-server (3.6.10-1ubuntu0.1) bionic; urgency=medium

  * Fix display of version when doing rabbitmqadmin --version using
    backport of fix from Debian (LP: #1773324)

 -- Dan Streetman <email address hidden> Fri, 03 Apr 2020 08:04:11 -0400

Changed in rabbitmq-server (Ubuntu Bionic):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for rabbitmq-server has completed successfully and the package is now being 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.

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.