[SRU] vagrant spits out ruby deprecation warnings on every call

Bug #1871685 reported by Hartmut Holzgraefe
50
This bug affects 8 people
Affects Status Importance Assigned to Milestone
vagrant (Ubuntu)
Fix Released
Low
Unassigned
Focal
Fix Released
Low
Unassigned

Bug Description

[Impact]

This issue is not critical but I believe it degrades a lot the user experience in a brand new LTS release. Every time one calls vagrant via CLI, Ruby 2.7 throws a bunch of warnings about some deprecated features, which for some (inexperienced?) users might seem a failure in a first look.

This was reported not just here as a bug report but also in Discourse:

https://discourse.ubuntu.com/t/workarounds-for-applications-which-are-broken-in-20-04lts/15474/5

[Test Case]

In a Focal LXD container:

$ apt install vagrant
$ vagrant
NOTE: Gem::Specification.default_specifications_dir is deprecated; use Gem.default_specifications_dir instead. It will be removed on or after 2020-02-01.
Gem::Specification.default_specifications_dir called from /usr/share/rubygems-integration/all/gems/vagrant-2.2.6/lib/vagrant/bundler.rb:428.
/usr/share/rubygems-integration/all/gems/vagrant-2.2.6/lib/vagrant/errors.rb:103: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/usr/share/rubygems-integration/all/gems/i18n-1.8.2/lib/i18n.rb:195: warning: The called method `t' is defined here
(eval):3: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/usr/share/rubygems-integration/all/gems/vagrant-2.2.6/lib/vagrant/ui.rb:223: warning: The called method `say' is defined here
Usage: vagrant [options] <command> [<args>]

    -v, --version Print the version and exit.
    -h, --help Print this help.

Common commands:
     box manages boxes: installation, removal, etc.
     cloud manages everything related to Vagrant Cloud
     destroy stops and deletes all traces of the vagrant machine
     global-status outputs status Vagrant environments for this user
     halt stops the vagrant machine
     help shows the help for a subcommand
     init initializes a new Vagrant environment by creating a Vagrantfile
     login
     package packages a running vagrant environment into a box
     plugin manages plugins: install, uninstall, update, etc.
     port displays information about guest port mappings
     powershell connects to machine via powershell remoting
     provision provisions the vagrant machine
     push deploys code in this environment to a configured destination
     rdp connects to machine via RDP
     reload restarts vagrant machine, loads new Vagrantfile configuration
     resume resume a suspended vagrant machine
     snapshot manages snapshots: saving, restoring, etc.
     ssh connects to machine via SSH
     ssh-config outputs OpenSSH valid configuration to connect to the machine
     status outputs status of the vagrant machine
     suspend suspends the machine
     up starts and provisions the vagrant environment
     upload upload to machine via communicator
     validate validates the Vagrantfile
     version prints current and latest Vagrant version
     winrm executes commands on a machine via WinRM
     winrm-config outputs WinRM configuration to connect to the machine

For help on any individual command run `vagrant COMMAND -h`

Additional subcommands are available, but are either more advanced
or not commonly used. To see all subcommands, run the command
`vagrant list-commands`.
$ vagrant init
NOTE: Gem::Specification.default_specifications_dir is deprecated; use Gem.default_specifications_dir instead. It will be removed on or after 2020-02-01.
Gem::Specification.default_specifications_dir called from /usr/share/rubygems-integration/all/gems/vagrant-2.2.6/lib/vagrant/bundler.rb:428.
/usr/share/rubygems-integration/all/gems/vagrant-2.2.6/lib/vagrant/errors.rb:103: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/usr/share/rubygems-integration/all/gems/i18n-1.8.2/lib/i18n.rb:195: warning: The called method `t' is defined here
(eval):3: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/usr/share/rubygems-integration/all/gems/vagrant-2.2.6/lib/vagrant/ui.rb:223: warning: The called method `say' is defined here
A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.

[Regression Potential]

I consider the potential for a regression low, the patches are working fine in Debian and they fix simple deprecated features in Ruby 2.7 (Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call). The proposed changes were already applied in multiple Ruby packages to fix the same issue, even upstream. However, those patches were backported to vagrant 2.2.6 from Debian which has vagrant version 2.2.7, so this might make room for some mistake.

==== Original description ====

When calling vagrant subcommands, or just vagrant itself without any argument to produce help output, every time the following block of ruby warnings appears:

$ vagrant
NOTE: Gem::Specification.default_specifications_dir is deprecated; use Gem.default_specifications_dir instead. It will be removed on or after 2020-02-01.
Gem::Specification.default_specifications_dir called from /usr/share/rubygems-integration/all/gems/vagrant-2.2.6/lib/vagrant/bundler.rb:428.
NOTE: Gem::Specification.default_specifications_dir is deprecated; use Gem.default_specifications_dir instead. It will be removed on or after 2020-02-01.
Gem::Specification.default_specifications_dir called from /usr/share/rubygems-integration/all/gems/vagrant-2.2.6/lib/vagrant/bundler.rb:428.
/usr/share/rubygems-integration/all/gems/vagrant-2.2.6/lib/vagrant/errors.rb:103: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/usr/share/rubygems-integration/all/gems/i18n-1.8.2/lib/i18n.rb:195: warning: The called method `t' is defined here
/usr/share/rubygems-integration/all/gems/vagrant-2.2.6/plugins/kernel_v2/config/vm.rb:354: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/usr/share/rubygems-integration/all/gems/vagrant-2.2.6/plugins/kernel_v2/config/vm_provisioner.rb:92: warning: The called method `add_config' is defined here
(eval):3: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/usr/share/rubygems-integration/all/gems/vagrant-2.2.6/lib/vagrant/ui.rb:223: warning: The called method `say' is defined here
[... actual output starts here ...]

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: vagrant 2.2.6+dfsg-2ubuntu1
ProcVersionSignature: Ubuntu 5.4.0-21.25-generic 5.4.27
Uname: Linux 5.4.0-21-generic x86_64
NonfreeKernelModules: nvidia_modeset nvidia
ApportVersion: 2.20.11-0ubuntu25
Architecture: amd64
CurrentDesktop: MATE
Date: Wed Apr 8 20:20:25 2020
InstallationDate: Installed on 2020-04-06 (2 days ago)
InstallationMedia: Ubuntu-Server 20.04 LTS "Focal Fossa" - Beta amd64 (20200402)
PackageArchitecture: all
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 LANG=C.UTF-8
 SHELL=/bin/bash
SourcePackage: vagrant
UpgradeStatus: No upgrade log present (probably fresh install)

Related branches

Revision history for this message
Hartmut Holzgraefe (hartmut-php) wrote :
Revision history for this message
Trent Lloyd (lathiat) wrote :

This has been fixed in a new Debian Release (2.2.7+dfsg-1). Tested a package built on Focal and these warnings go away.

Specifically they added two patches:
0006-Fix-warnings-for-ruby-2.7.patch
0007-Fix-more-warnings-under-ruby-2.7.patch

Since this is in universe but a popular too, hoping we can sneak in a Debian sync for Focal with the new version as well to fix this otherwise I can look to submit a patch for the warnings specifically.

Revision history for this message
Trent Lloyd (lathiat) wrote :

I was wrong this package requires a merge due to a small delta on the upstream Debian package. So I will have to prepare a patch.

Revision history for this message
Trent Lloyd (lathiat) wrote :
Revision history for this message
Trent Lloyd (lathiat) wrote :
Revision history for this message
Trent Lloyd (lathiat) wrote :

Please sponsor this upload of a merge of Vagrant 2.2.7+dfsg-1 from Debian. It is a minor upstream version bump (2.2.6 -> 2.2.7) plus contains new patches from Debian to fix multiple Ruby 2.7 deprecation warnings on every command invocation.

Two debdiffs attached:
partial merge debdiff showing only the delta to current debian version (lp1871685_merge-only_2.2.7+dfsg-1_2.2.7+dfsg-1ubuntu1.debdiff)
full merge debdiff from old ubuntu version to new ubuntu version (lp1871685_complete-merge_2.2.6+dfsg-2ubuntu1_2.2.7+dfsg-1ubuntu1.debdiff)

This is a direct merge of the previous merge, which is simply to disable the autopkgtest as it is long time known flakey on Ubuntu infrastructure.

It would be ideal to get this merge through ahead of Focal release to continue having no delta to Debian upstream. This package is in universe.

Changed in vagrant (Ubuntu):
status: New → Confirmed
importance: Undecided → Low
Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote :

Some users are complaining about those warnings after Focal release, for instance here:

https://discourse.ubuntu.com/t/workarounds-for-applications-which-are-broken-in-20-04lts/15474/5

I tried it myself and all those Ruby 2.7 related warning messages are really annoying. IMO we should release a fix for this ASAP to not ruin our users' experience.

In order to incorporate minimal changes I backported the two patches from Debian to version 2.2.6 instead of merging the version 2.2.7. It should allow the SRU team review it faster than a full merge.

Here is a MP for it containing more information:

https://code.launchpad.net/~lucaskanashiro/ubuntu/+source/vagrant/+git/vagrant/+merge/382953

I'll update the bug description, adding the SRU template.

description: updated
tags: added: verification-needed-focal
tags: added: verification-needed
Changed in vagrant (Ubuntu):
status: Confirmed → In Progress
summary: - vagrant spits out ruby deprecation warnings on every call
+ [SRU] vagrant spits out ruby deprecation warnings on every call
Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote :

Using vagrant from this PPA containing the proposed changes the issue is fixed:

https://launchpad.net/~lucaskanashiro/+archive/ubuntu/focal-vagrant-sru/+packages

Reproducing the described test case:

$ apt install vagrant
$ vagrant
Usage: vagrant [options] <command> [<args>]

    -v, --version Print the version and exit.
    -h, --help Print this help.

Common commands:
     box manages boxes: installation, removal, etc.
     cloud manages everything related to Vagrant Cloud
     destroy stops and deletes all traces of the vagrant machine
     global-status outputs status Vagrant environments for this user
     halt stops the vagrant machine
     help shows the help for a subcommand
     init initializes a new Vagrant environment by creating a Vagrantfile
     login
     package packages a running vagrant environment into a box
     plugin manages plugins: install, uninstall, update, etc.
     port displays information about guest port mappings
     powershell connects to machine via powershell remoting
     provision provisions the vagrant machine
     push deploys code in this environment to a configured destination
     rdp connects to machine via RDP
     reload restarts vagrant machine, loads new Vagrantfile configuration
     resume resume a suspended vagrant machine
     snapshot manages snapshots: saving, restoring, etc.
     ssh connects to machine via SSH
     ssh-config outputs OpenSSH valid configuration to connect to the machine
     status outputs status of the vagrant machine
     suspend suspends the machine
     up starts and provisions the vagrant environment
     upload upload to machine via communicator
     validate validates the Vagrantfile
     version prints current and latest Vagrant version
     winrm executes commands on a machine via WinRM
     winrm-config outputs WinRM configuration to connect to the machine

For help on any individual command run `vagrant COMMAND -h`

Additional subcommands are available, but are either more advanced
or not commonly used. To see all subcommands, run the command
`vagrant list-commands`.

$ vagrant init
A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.

tags: added: verification-done-focal
removed: verification-needed verification-needed-focal
Revision history for this message
Trent Lloyd (lathiat) wrote :

Hi Lucas,

Thanks for the patch updates. When I first submitted this we could have snuck through before release without an SRU but the patch backport now makes sense.

Mathew Hodson (mhodson)
Changed in vagrant (Ubuntu Focal):
importance: Undecided → Low
status: New → Triaged
Changed in vagrant (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Chris Halse Rogers (raof) wrote : Please test proposed package

Hello Hartmut, or anyone else affected,

Accepted vagrant into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/vagrant/2.2.6+dfsg-2ubuntu2 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-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. 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 vagrant (Ubuntu Focal):
status: Triaged → Fix Committed
tags: added: verification-needed verification-needed-focal
removed: verification-done-focal
Revision history for this message
Lothar Braun (constcast) wrote :

I have installed the update from focal-proposed. The update fixes most warnings, but I found at least two warnings that are still present in the output:

$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'ubuntu/focal64'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'ubuntu/focal64' version '20200505.0.0' is up to date...
==> default: Setting the name of the VM: vagrant_sys
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
/usr/share/rubygems-integration/all/gems/vagrant-2.2.6/plugins/providers/virtualbox/action/forward_ports.rb:50: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/usr/share/rubygems-integration/all/gems/i18n-1.8.2/lib/i18n.rb:195: warning: The called method `t' is defined here
    default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...

...
==> default: Mounting shared folders...
default: /vagrant => /data/vagrant
/usr/share/rubygems-integration/all/gems/vagrant-2.2.6/bin/vagrant:200: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
(eval):1: warning: The called method `error' is defined here

Revision history for this message
Luis Alberto Pabón (copong) wrote :

I might be doing something wrong, but focal-proposed isn't bringing in 2.2.6+dfsg-2ubuntu2 and the launchpad link above only contains the package sources and ubuntu build files. Am I too soon?

Revision history for this message
Lothar Braun (constcast) wrote :

The package does appear in focal-proposed. Did you enable universe for focal-propsed?

Revision history for this message
Luis Alberto Pabón (copong) wrote :

Looks like it's been added to the deb repo within the last hour or so, I did another apt update and got another 3 packages to upgrade including vagrant. Will report back.

Revision history for this message
Luis Alberto Pabón (copong) wrote :

Thank you for the work. Patches seem not quite complete as you mentioned:

##########
~ vagrant provision
==> default: Running provisioner: shell...
    default: Running: inline script
/usr/share/rubygems-integration/all/gems/vagrant-2.2.6/plugins/provisioners/shell/provisioner.rb:56: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
(eval):1: warning: The called method `detail' is defined here

[...]

##########
~ vagrant up (or reload)
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'ubuntu/bionic64' version '20200317.0.0' is up to date...
[...]
==> default: Forwarding ports...
/usr/share/rubygems-integration/all/gems/vagrant-2.2.6/plugins/providers/virtualbox/action/forward_ports.rb:50: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/usr/share/rubygems-integration/all/gems/i18n-1.8.2/lib/i18n.rb:195: warning: The called method `t' is defined here

##########

Revision history for this message
Luis Alberto Pabón (copong) wrote :

This one is different. Do a vagrant up from destroy, then ctrl+c straight away

########
~ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'ubuntu/focal64'...
^C==> default: Waiting for cleanup before exiting...
/usr/share/rubygems-integration/all/gems/vagrant-2.2.6/bin/vagrant:200: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call

Revision history for this message
Jeff Abrahamson (jeff-purple) wrote :

I see a fix has been committed a while back. How long until we might expect to see the fix in LTS?

If it will still be a while, is there a proposed work-around or local fix? (Sorry, I'm sure the answer to that is entirely evident to some.)

Revision history for this message
Kiruahxh (kiruahxh) wrote :

I'm waiting for it too, is there a planned release date ?

Revision history for this message
Eric Desrochers (slashd) wrote :

For the package to get promoted from focal-proposed to focal-updates, one needs to change the tag from 'verification-needed-focal' to 'verification-done-focal' and leave a comment with the outcome of the -proposed package testing.

Once one does that, the vagrant package will turn green in pending sru page:
https://people.canonical.com/~ubuntu-archive/pending-sru.html

and will be eligigle for release (approve by SRU verification team)

Revision history for this message
Eric Desrochers (slashd) wrote :
Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote :

Sorry for the delay, and also thanks for the feedback you provided!

I talked to the Debian maintainer and the warnings you mention were tackled and the upstream PR was updated accordingly:

https://github.com/hashicorp/vagrant/pull/11459

I applied the new changes locally and I was able to run some basic commands with no issue (vagrant init, up, provision, ssh and destroy). I uploaded this new version to the same PPA I mentioned previously:

https://launchpad.net/~lucaskanashiro/+archive/ubuntu/focal-vagrant-sru

Could you please try this new vesion (2.2.6+dfsg-2ubuntu3~ppa1) and provide some feedback?

Revision history for this message
Luis Alberto Pabón (copong) wrote :

I can confirm I see none of the warnings I mentioned earlier with 2.2.6+dfsg-2ubuntu3~ppa1 or any new ones either. Thank you!

Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote :

Thank you Luis! The MP I submitted with those changes was also reviewed and accepted, I am uploading the package now and let's wait for the SRU team.

Revision history for this message
Kiruahxh (kiruahxh) wrote :

Could you release this fix please ? I update the distro (20.04) every morning but I still read these annoying warning messages...

Revision history for this message
Luis Alberto Pabón (copong) wrote :

You can manually download it from here https://launchpad.net/~lucaskanashiro/+archive/ubuntu/focal-vagrant-sru/+packages if you don't want to add the PPA nor wait for proper release.

Revision history for this message
Robie Basak (racb) wrote :

Hello Hartmut, or anyone else affected,

Accepted vagrant into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/vagrant/2.2.6+dfsg-2ubuntu3 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-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. 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.

Revision history for this message
Lothar Braun (constcast) wrote :

I have installed 2.2.6+dfsg-2ubuntu3 from proposed. The update fixes all warnings that I had encountered previously .

tags: added: verification-done-focal
removed: verification-needed-focal
Revision history for this message
Luis Alberto Pabón (copong) wrote :

Same as Lothar here.

Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for vagrant 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.

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

This bug was fixed in the package vagrant - 2.2.6+dfsg-2ubuntu3

---------------
vagrant (2.2.6+dfsg-2ubuntu3) focal; urgency=medium

  * d/p/0009-Fix-more-warnings-under-ruby-2.7.patch: update patch fixing more
    warnings about using the last argument of a method call as keyword
    parameters (LP: #1871685).

 -- Lucas Kanashiro <email address hidden> Wed, 24 Jun 2020 17:00:46 -0300

Changed in vagrant (Ubuntu Focal):
status: Fix Committed → Fix Released
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.