Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop using vagrant-triggers for Vagrant >= 2.1.0 #49

Closed
l3ku opened this issue May 4, 2018 · 8 comments
Closed

Stop using vagrant-triggers for Vagrant >= 2.1.0 #49

l3ku opened this issue May 4, 2018 · 8 comments
Labels

Comments

@l3ku
Copy link

l3ku commented May 4, 2018

When attempting to run vagrant up on Vagrant version 2.1.0 with vagrant-triggers installed, the command produces a warning and fails as a result of an exception:

$ vagrant up
WARNING: Vagrant has detected the `vagrant-triggers` plugin. This plugin conflicts
with the internal triggers implementation. Please uninstall the `vagrant-triggers`
plugin and run the command again if you wish to use the core trigger feature. To
uninstall the plugin, run the command shown below:

  vagrant plugin uninstall vagrant-triggers

Note that the community plugin `vagrant-triggers` and the core trigger feature
in Vagrant do not have compatible syntax.

To disable this warning, set the environment variable `VAGRANT_USE_VAGRANT_TRIGGERS`.
Bringing machine 'wordpress-box' up with 'virtualbox' provider...
/opt/vagrant/embedded/gems/2.1.0/gems/vagrant-2.1.0/lib/vagrant/plugin/v2/config.rb:73:in `method_missing': undefined method `before_triggers' for #<VagrantPlugins::Triggers::Config::Trigger:0x0000000100baca38> (NoMethodError)
	from /opt/vagrant/embedded/gems/2.1.0/gems/vagrant-2.1.0/lib/vagrant/plugin/v2/trigger.rb:40:in `fire_triggers'
	from /opt/vagrant/embedded/gems/2.1.0/gems/vagrant-2.1.0/lib/vagrant/machine.rb:164:in `action'
	from /opt/vagrant/embedded/gems/2.1.0/gems/vagrant-2.1.0/lib/vagrant/batch_action.rb:82:in `block (2 levels) in run'

According to https://www.vagrantup.com/docs/triggers/, it seems that Vagrant has its own trigger mechanism which conflicts with the vagrant-triggers plugin. We should probably move away from external plugins and investigate if we could start using Vagrant's own mechanism for newer Vagrant versions, and eventually deprecate the vagrant-triggers plugin.

@l3ku
Copy link
Author

l3ku commented May 18, 2018

Related: should we add a constraint to the Vagrantfile our WordPress layout to restrict usage with version >= 2.1.0 of Vagrant? Currently we require at least version 1.7.4, but there is no upper limit. As a result, if a developer follows the instructions at https://seravo.com/docs/development/how-to-install/ and attempts to run vagrant with our WP layout, he/she will face the error stated above.

@Aaronkala
Copy link

Is there any way to bypass this issue? Or should I just downgrade vagrant to an older version (< 2.1.0)?

@l3ku
Copy link
Author

l3ku commented Jul 17, 2018

Hi! As a temporal workaround, you could try setting the suggested VAGRANT_USE_VAGRANT_TRIGGERS environment variable to disable the warning and see if that works for you. However, I myself have still kept to using an earlier Vagrant version (2.0.2) running on OSX.

@ottok
Copy link
Contributor

ottok commented Sep 11, 2018

The current work-around is to install a Vagrant version older than 2.10. You can find 2.0.4 at https://releases.hashicorp.com/vagrant/2.0.4/

@ottok ottok added the bug label Sep 11, 2018
@ottok
Copy link
Contributor

ottok commented Sep 11, 2018

See duplicate of this at Seravo/wordpress#88

@ottok
Copy link
Contributor

ottok commented Sep 11, 2018

This will be fixed as part of a currently on-going refactoring of the whole Vagrant bootstrap process. In the mean time added this note to docs: Seravo/docs@70bb7ec

@elguitar
Copy link
Contributor

Vagrant 2.0.4 doesn't support Virtualbox version 6.0 and Virtualbox 6.0 is the packaged version in Ubuntu 19.04 and Fedora 30.

This means that using wp-palvelu-vagrant on new distro releases even more trickery could be needed in order to make it work.

@l3ku
Copy link
Author

l3ku commented Oct 21, 2019

This was fixed in Seravo/wordpress@a6bf061. Updating the Vagrantfile to the newest version should fix the trigger-related problems with Vagrant version 2.1.0 or later.

@l3ku l3ku closed this as completed Oct 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants