package vim-pathogen 2.4-5 failed to install/upgrade: there is no script in the new version of the package - giving up

Bug #2078541 reported by Draik
24
This bug affects 4 people
Affects Status Importance Assigned to Milestone
vim-addon-manager (Ubuntu)
Fix Released
Undecided
Unassigned
Jammy
In Progress
Undecided
Unassigned

Bug Description

[ Impact ]

 * The code in vim-addon-manager is ok with ruby3.0 as in Jammy.
   But on the upgrade to Noble the ruby3.2 there will execute
   some of the pre-removal and that hits an issue due to a
   now removed method.

 * The fix for that is upstream (native package in Debian)
   And was available [1].
   We instead could go into a solution based on ensuring upgrade
   dependencies and ordering so that pre-rm would still run with
   the old ruby. But that could cause circular dependencies,
   would be way more complex to test and would still break
   if people use new ruby versions from off-archive.

[1]: https://salsa.debian.org/vim-team/vim-addon-manager/-/commit/e4034fc5907c6af0f2e2e08baa85a015e7302447

[ Test Plan ]

 * There might be more complex ways to test, but I found the way I
   encountered the issue the best to test - which is upgrading from
   Jammy to Noble
 * 1. get a clean Jammy system e.g. a LXD guest
 * 2. install vim-addon-manager and an addon
    $ apt install vim-addon-manager vim-airline
 * 3. upgrade to Noble
    $ do-release-upgrade

# bad case:
- breaks at upgrading vim-addon-manager

...

Preparing to unpack .../194-vim-airline_0.11-2_all.deb ...
Info: removing installed addon 'airline' from /var/lib/vim/addons
/usr/lib/ruby/vendor_ruby/vim/addon_manager.rb:59:in `remove': ESC[1mundefined method `exists?' for File:Class (ESC[1;4mNoMethodErrorESC[mESC[1m)ESC[m

ESC[1m if File.exists? tagfileESC[m
ESC[1m ^^^^^^^^ESC[m
ESC[1mDid you mean? exist?ESC[m
        from /usr/bin/vim-addon-manager:282:in `<main>'
dpkg: warning: old vim-airline package pre-removal script subprocess returned error exit status 1
dpkg: trying script from the new package instead ...
dpkg: error processing archive /tmp/apt-dpkg-install-0unHVH/194-vim-airline_0.11-2_all.deb (--unpack):
 there is no script in the new version of the package - giving up

# good case:
- release upgrade completes successfully

...
System upgrade is complete.

Restart required

To finish the upgrade, a restart is required.
If you select 'y' the system will be restarted.

Continue [yN] y

[ Where problems could occur ]

 * Exist and Exists used to do the same since the deprecation in 2013.
   What comes to mind is a ruby so old it does not know about the new yet.
   But that isn't a real new issue as other code in vim-addon-manager
   already uses the new "Exist" - so that would fail already.

 * Another source of issues might be if the change was wrong, but since
   it is functionally equivalent it is essentially a search and replace
   which isn't the most complex change.

[ Other Info ]

 * This isn't new at all, the deprecation is of Ruby2.1 (2013) and
   had to happen at some point.

 * In terms of severity this isn't the most evil bug that ever existed.
   After all just re-running dist-upgrade does resolve it as the code in
   noble is fine then.
   But it breaks developers that use heavy mods in vim, which is a large
   user group that we'd like to not break on upgrades. Furthermore any
   "fall out of release upgrade" is a rather negative impact IMHO.
   And finally the initial error message is a bit misleading (comes from
   no pre-rm being there anymore, but the problem is as outlined old
   code vs new language runtime).

----

1 - Ubuntu Version
Description: Ubuntu 22.04.4 LTS
Release: 22.04

2 - Package name and version
vim-pathogen:
  Installed: 2.4-5
  Candidate: 2.4-5
  Version table:
 *** 2.4-5 500
        500 http://us.archive.ubuntu.com/ubuntu jammy/universe amd64 Packages
        500 http://us.archive.ubuntu.com/ubuntu jammy/universe i386 Packages
        100 /var/lib/dpkg/status

3 & 4 - expectation and reality
Upgrading 22.04 LTS to 24.04 LTS via do-release-upgrade, expecting an upgrade or left alone during the process

ProblemType: Package
DistroRelease: Ubuntu 24.04
Package: vim-pathogen 2.4-5
ProcVersionSignature: Ubuntu 5.15.0-119.129-generic 5.15.160
Uname: Linux 5.15.0-119-generic x86_64
ApportVersion: 2.28.1-0ubuntu3.1
Architecture: amd64
CasperMD5CheckResult: unknown
Date: Fri Aug 30 21:52:28 2024
ErrorMessage: there is no script in the new version of the package - giving up
InstallationDate: Installed on 2016-11-08 (2853 days ago)
InstallationMedia: Ubuntu 16.10 "Yakkety Yak" - Release amd64 (20161012.2)
PackageArchitecture: all
Python3Details: /usr/bin/python3.12, Python 3.12.3, python3-minimal, 3.12.3-0ubuntu2
PythonDetails: /usr/bin/python3.12, Python 3.12.3, python-is-python3, 3.11.4-1
RebootRequiredPkgs: Error: path contained symlinks.
RelatedPackageVersions:
 dpkg 1.22.6ubuntu6.1
 apt 2.7.14build2
SourcePackage: vim-pathogen
Title: package vim-pathogen 2.4-5 failed to install/upgrade: there is no script in the new version of the package - giving up
UpgradeStatus: Upgraded to noble on 2024-08-31 (0 days ago)
modified.conffile..etc.apport.report-ignore.README.denylist: [deleted]

Related branches

Revision history for this message
Draik (draik) wrote :
tags: removed: need-duplicate-check
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in vim-pathogen (Ubuntu):
status: New → Confirmed
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

FYI: Since this broke upgrading Jammy->Noble I ran yet another dist-upgrade and it worked just fine.

Not good for debugging, but at least easy to get over AFAICS

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

From the logs, what seems to be the interesting section:

Preparing to unpack .../439-vim-airline_0.11-2_all.deb ...
Info: removing installed addon 'airline' from /var/lib/vim/addons
/usr/lib/ruby/vendor_ruby/vim/addon_manager.rb:59:in `remove': undefined method `exists?' for File:Class (NoMethodError)

 if File.exists? tagfile
 ^^^^^^^^
Did you mean? exist?
 from /usr/bin/vim-addon-manager:282:in `<main>'
dpkg: warning: old vim-airline package pre-removal script subprocess returned error exit status 1
dpkg: trying script from the new package instead ...
dpkg: error processing archive /tmp/apt-dpkg-install-IWnHot/439-vim-airline_0.11-2_all.deb (--unpack):
 there is no script in the new version of the package - giving up

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Repro in fresh Jammy LXD container:

root@j:~# apt install vim-addon-manager vim-airline
root@j:~# do-release-upgrade
...

Preparing to unpack .../194-vim-airline_0.11-2_all.deb ...
Info: removing installed addon 'airline' from /var/lib/vim/addons
/usr/lib/ruby/vendor_ruby/vim/addon_manager.rb:59:in `remove': ESC[1mundefined method `exists?' for File:Class (ESC[1;4mNoMethodErrorESC[mESC[1m)ESC[m

ESC[1m if File.exists? tagfileESC[m
ESC[1m ^^^^^^^^ESC[m
ESC[1mDid you mean? exist?ESC[m
        from /usr/bin/vim-addon-manager:282:in `<main>'
dpkg: warning: old vim-airline package pre-removal script subprocess returned error exit status 1
dpkg: trying script from the new package instead ...
dpkg: error processing archive /tmp/apt-dpkg-install-0unHVH/194-vim-airline_0.11-2_all.deb (--unpack):
 there is no script in the new version of the package - giving up

== DuplicateSignature =================================
package:vim-airline:0.11-1
Preparing to unpack .../194-vim-airline_0.11-2_all.deb ...
Info: removing installed addon 'airline' from /var/lib/vim/addons
/usr/lib/ruby/vendor_ruby/vim/addon_manager.rb:59:in `remove': ESC[1mundefined method `exists?' for File:Class (ESC[1;4mNoMethodErrorESC[mESC[1m)ESC[m

ESC[1m if File.exists? tagfileESC[m
ESC[1m ^^^^^^^^ESC[m
ESC[1mDid you mean? exist?ESC[m
        from /usr/bin/vim-addon-manager:282:in `<main>'
dpkg: warning: old vim-airline package pre-removal script subprocess returned error exit status 1
dpkg: trying script from the new package instead ...
dpkg: error processing archive /tmp/apt-dpkg-install-0unHVH/194-vim-airline_0.11-2_all.deb (--unpack):
 there is no script in the new version of the package - giving up

vim-pathogen only accidentally was in there in my error messages, this is in vim-addon-manager.
Changing bug task

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

We can check the code:
root@j:~# grep File.exist /usr/lib/ruby/vendor_ruby/vim/addon_manager.rb
      if File.exists? tagfile
      if File.exist? override_file
        FileUtils.rm override_file if File.exist? override_file

As suggested by the error, "exists" is likely wrong and "exist" is good.

This has been deprecated for ages and now finally removed:
- https://bugs.ruby-lang.org/issues/17391

There is a fix in newer releases already.
- https://salsa.debian.org/vim-team/vim-addon-manager/-/commit/e4034fc5907c6af0f2e2e08baa85a015e7302447

That was done for newer Ruby3.2, but the way this works on upgrades means that we might execute the old code with the new Ruby.

Instead of going for complex pkg ordering changes we could just apply the same change to Jammy so that upgraders do not hit that making them fall out of do-release-upgrade.

affects: vim-pathogen (Ubuntu) → vim-addon-manager (Ubuntu)
Changed in vim-addon-manager (Ubuntu Jammy):
status: New → Triaged
Changed in vim-addon-manager (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Also the same Delta is all the delta we have:

$ git show pkg/ubuntu/devel:debian/changelog
vim-addon-manager (0.5.10ubuntu1) noble; urgency=medium

  * Fix FTBFS with Ruby 3.2: replace File.exists? with File.exist?

 -- Lucas Kanashiro <email address hidden> Wed, 21 Feb 2024 18:21:07 -0300

But there is more to be had in new versions:

vim-addon-manager (0.5.11) unstable; urgency=medium

  [ Lucas Kanashiro ]
  * Replace File.exists? calls with File.exist?

  [ James McCoy ]
  * Switch "ruby | ruby-interpreter" Depends to ${ruby:Depends}
  * Upgrade to debhelper-compat 13
  * Declare compliance with Policy 4.6.2, no changes required
  * Add executables to gemspec so dh_ruby detects them

 -- James McCoy <email address hidden> Sun, 25 Feb 2024 16:53:35 -0500

So for Plucky this should be a sync

Revision history for this message
Christian Ehrhardt  (paelzer) wrote (last edit ):

For Plucky https://launchpad.net/ubuntu/+source/vim-addon-manager/0.5.11 is here now.

Due to
New changes:
vim-addon-manager (0.5.11) unstable; urgency=medium

  [ Lucas Kanashiro ]
  * Replace File.exists? calls with File.exist?

  [ James McCoy ]
  * Switch "ruby | ruby-interpreter" Depends to ${ruby:Depends}
  * Upgrade to debhelper-compat 13
  * Declare compliance with Policy 4.6.2, no changes required
  * Add executables to gemspec so dh_ruby detects them

 -- James McCoy <email address hidden> Sun, 25 Feb 2024 16:53:35 -0500
Sync this package [y|N]? y

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :
Changed in vim-addon-manager (Ubuntu Jammy):
status: Triaged → In Progress
description: updated
description: updated
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Review and Tests complete, uploaded to unapproved queue for an SRU.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

The sync looks good - from excuses:

Migration status for vim-addon-manager (0.5.10ubuntu1 to 0.5.11): Will attempt migration (Any information below is purely informational)

SRU waits for someone to pick it up from unapproved, which is fine to delay as it isn't urgent.

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.