telcat / vagrant-proxmox

Use Vagrant to manage Proxmox virtual machines
MIT License
374 stars 113 forks source link

vagrant-proxmox install error (rest-client version conflict) #40

Open kerbachi opened 7 years ago

kerbachi commented 7 years ago

Can't install vagrant-proxmox on Linux kernel 4.4.0-77 (Mint 18.1), vagrant version=1.9.7

`m@server ~ $ vagrant plugin install vagrant-proxmox Installing the 'vagrant-proxmox' plugin. This can take a few minutes... Bundler, the underlying system Vagrant uses to install plugins, reported an error. The error is shown below. These errors are usually caused by misconfigured plugin installations or transient network issues. The error from Bundler is:

conflicting dependencies rest-client (\~> 1.6.7) and rest-client (= 2.0.2) Activated rest-client-2.0.2 which does not match conflicting dependency (~> 1.6.7)

Conflicting dependency chains: rest-client (= 2.0.2), 2.0.2 activated

versus: vagrant-proxmox (> 0), 0.0.2 activated, depends on rest-client (~> 1.6.7)

`

`m@server ~ $ gem -v 2.5.1

m@server ~ $ gem list

LOCAL GEMS

bigdecimal (1.2.8) bundler (1.11.2) did_you_mean (1.0.0) gist (4.5.0) io-console (0.4.5) json (1.8.3) minitest (5.8.4) molinillo (0.4.3) net-http-persistent (2.9.4) net-telnet (0.1.1) power_assert (0.2.7) psych (2.0.17) rake (10.5.0) rdoc (4.2.1) test-unit (3.1.7) thor (0.19.1) `

Any one had this error?

mdeschu commented 7 years ago

I am running on Proxmox 5.0 with Vagrant 1.9.7 I had this issue as well with both this repo and https://github.com/GastonGonzalez/vagrant-proxmox I'm still working on it. I clone that one and changed vagrant-proxmox.gemspec to use rest-client 2.0.2 and got it to install. Unfortunately that caused issues in proxmox/connection.rb when running vagrant up

ERROR vagrant: /home/oem/.vagrant.d/gems/2.3.4/gems/vagrant-proxmox-0.0.10/lib/vagrant-proxmox/action/connect_proxmox.rb:25:in rescue in call'
/home/oem/.vagrant.d/gems/2.3.4/gems/vagrant-proxmox-0.0.10/lib/vagrant-proxmox/action/connect_proxmox.rb:15:in call'
...
undefined method empty? for nil:NilClass
Unable to communicate with proxmox server:
undefined method empty? for nil:NilClass

I noticed in lib/vagrant-proxmox/proxmox/connection.rb at the top was defined RestClient make_headers stuff. Commenting that out got the REST call to /api2/json/access/ticket to work but I hit another road block when getting to the REST call to GET /api2/json/nodes

Cause: VagrantPlugins::Proxmox::ApiError::UnauthorizedError>
ERROR vagrant: Unable to communicate with proxmox server:
Unable to create the virtual machine!
Cause: VagrantPlugins::Proxmox::ApiError::UnauthorizedError

Which I can only assume is due to the commenting of the RestClient make_header override in connection.rb as that appears to be dealing with the authorization cookies.

It's possible I'm going down the wrong rabbit hole here as I'm in unfamiliar territory withRestClient/Vagrant APIs and the solution is simpler than I'm making it out to be. I don't have much more time this week to look into it unfortunately. I could speed up my debugging if I knew how to print to the console from a vagrant plugin as easy as a printf or puts.

As usual I always spoke too soon. I was on the right track but I just checked out GastonGonzalez/vagrant-proxmox branch "vagrant-1.9.4" and that will build and install with rest-client > 2.0 . Unfortunately I still got a 400 bad request error now when doing POST /api2/json/nodes/pve/qemu ... ugh I may have to setup stunnel as suggested or trying a simpler vagrantfile. I was really trying to avoid delving down that rabbit hole.

kerbachi commented 7 years ago

Thank you,

Is there any fixes for that? Any one having the same issue?

linuxmaniac commented 7 years ago

Same here

$ vagrant plugin install vagrant-proxmox
Installing the 'vagrant-proxmox' plugin. This can take a few minutes...
/usr/lib/ruby/2.3.0/rubygems/specification.rb:2287:in `raise_if_conflicts': Unable to activate vagrant-proxmox-0.0.10, because rest-client-1.8.0 conflicts with rest-client (~> 1.6.7) (Gem::ConflictError)
    from /usr/lib/ruby/2.3.0/rubygems/specification.rb:1408:in `activate'
    from /usr/share/rubygems-integration/all/gems/vagrant-1.9.1/lib/vagrant/bundler.rb:323:in `block in activate_solution'
    from /usr/share/rubygems-integration/all/gems/vagrant-1.9.1/lib/vagrant/bundler.rb:320:in `each'
    from /usr/share/rubygems-integration/all/gems/vagrant-1.9.1/lib/vagrant/bundler.rb:320:in `activate_solution'
    from /usr/share/rubygems-integration/all/gems/vagrant-1.9.1/lib/vagrant/bundler.rb:248:in `internal_install'
    from /usr/share/rubygems-integration/all/gems/vagrant-1.9.1/lib/vagrant/bundler.rb:98:in `install'
    from /usr/share/rubygems-integration/all/gems/vagrant-1.9.1/lib/vagrant/plugin/manager.rb:62:in `block in install_plugin'
    from /usr/share/rubygems-integration/all/gems/vagrant-1.9.1/lib/vagrant/plugin/manager.rb:72:in `install_plugin'
    from /usr/share/rubygems-integration/all/gems/vagrant-1.9.1/plugins/commands/plugin/action/install_gem.rb:37:in `call'
    from /usr/share/rubygems-integration/all/gems/vagrant-1.9.1/lib/vagrant/action/warden.rb:34:in `call'
    from /usr/share/rubygems-integration/all/gems/vagrant-1.9.1/lib/vagrant/action/builder.rb:116:in `call'
    from /usr/share/rubygems-integration/all/gems/vagrant-1.9.1/lib/vagrant/action/runner.rb:66:in `block in run'
    from /usr/share/rubygems-integration/all/gems/vagrant-1.9.1/lib/vagrant/util/busy.rb:19:in `busy'
    from /usr/share/rubygems-integration/all/gems/vagrant-1.9.1/lib/vagrant/action/runner.rb:66:in `run'
    from /usr/share/rubygems-integration/all/gems/vagrant-1.9.1/plugins/commands/plugin/command/base.rb:14:in `action'
    from /usr/share/rubygems-integration/all/gems/vagrant-1.9.1/plugins/commands/plugin/command/install.rb:32:in `block in execute'
    from /usr/share/rubygems-integration/all/gems/vagrant-1.9.1/plugins/commands/plugin/command/install.rb:31:in `each'
    from /usr/share/rubygems-integration/all/gems/vagrant-1.9.1/plugins/commands/plugin/command/install.rb:31:in `execute'
    from /usr/share/rubygems-integration/all/gems/vagrant-1.9.1/plugins/commands/plugin/command/root.rb:66:in `execute'
    from /usr/share/rubygems-integration/all/gems/vagrant-1.9.1/lib/vagrant/cli.rb:42:in `execute'
    from /usr/share/rubygems-integration/all/gems/vagrant-1.9.1/lib/vagrant/environment.rb:274:in `cli'
    from /usr/share/rubygems-integration/all/gems/vagrant-1.9.1/bin/vagrant:122:in `<top (required)>'
    from /usr/bin/vagrant:22:in `load'
    from /usr/bin/vagrant:22:in `<main>'

This is a Debian stretch with vagrant 1.9.1+dfsg-1

g3rhard commented 7 years ago

The same thing:

$ vagrant plugin install vagrant-proxmox
Installing the 'vagrant-proxmox' plugin. This can take a few minutes...
/usr/lib/ruby/2.3.0/rubygems/specification.rb:2287:in `raise_if_conflicts': Unable to activate vagrant-proxmox-0.0.10, because rest-client-1.8.0 conflicts with rest-client (~> 1.6.7) (Gem::ConflictError)
        from /usr/lib/ruby/2.3.0/rubygems/specification.rb:1408:in `activate'
        from /usr/share/rubygems-integration/all/gems/vagrant-1.9.1/lib/vagrant/bundler.rb:323:in `block in activate_solution'
        from /usr/share/rubygems-integration/all/gems/vagrant-1.9.1/lib/vagrant/bundler.rb:320:in `each'
        from /usr/share/rubygems-integration/all/gems/vagrant-1.9.1/lib/vagrant/bundler.rb:320:in `activate_solution'
        from /usr/share/rubygems-integration/all/gems/vagrant-1.9.1/lib/vagrant/bundler.rb:248:in `internal_install'
        from /usr/share/rubygems-integration/all/gems/vagrant-1.9.1/lib/vagrant/bundler.rb:98:in `install'
        from /usr/share/rubygems-integration/all/gems/vagrant-1.9.1/lib/vagrant/plugin/manager.rb:62:in `block in install_plugin'
        from /usr/share/rubygems-integration/all/gems/vagrant-1.9.1/lib/vagrant/plugin/manager.rb:72:in `install_plugin'
        from /usr/share/rubygems-integration/all/gems/vagrant-1.9.1/plugins/commands/plugin/action/install_gem.rb:37:in `call'
        from /usr/share/rubygems-integration/all/gems/vagrant-1.9.1/lib/vagrant/action/warden.rb:34:in `call'
        from /usr/share/rubygems-integration/all/gems/vagrant-1.9.1/lib/vagrant/action/builder.rb:116:in `call'
        from /usr/share/rubygems-integration/all/gems/vagrant-1.9.1/lib/vagrant/action/runner.rb:66:in `block in run'
        from /usr/share/rubygems-integration/all/gems/vagrant-1.9.1/lib/vagrant/util/busy.rb:19:in `busy'
        from /usr/share/rubygems-integration/all/gems/vagrant-1.9.1/lib/vagrant/action/runner.rb:66:in `run'
        from /usr/share/rubygems-integration/all/gems/vagrant-1.9.1/plugins/commands/plugin/command/base.rb:14:in `action'
        from /usr/share/rubygems-integration/all/gems/vagrant-1.9.1/plugins/commands/plugin/command/install.rb:32:in `block in execute'
        from /usr/share/rubygems-integration/all/gems/vagrant-1.9.1/plugins/commands/plugin/command/install.rb:31:in `each'
        from /usr/share/rubygems-integration/all/gems/vagrant-1.9.1/plugins/commands/plugin/command/install.rb:31:in `execute'
        from /usr/share/rubygems-integration/all/gems/vagrant-1.9.1/plugins/commands/plugin/command/root.rb:66:in `execute'
        from /usr/share/rubygems-integration/all/gems/vagrant-1.9.1/lib/vagrant/cli.rb:42:in `execute'
        from /usr/share/rubygems-integration/all/gems/vagrant-1.9.1/lib/vagrant/environment.rb:274:in `cli'
        from /usr/share/rubygems-integration/all/gems/vagrant-1.9.1/bin/vagrant:122:in `<top (required)>'
        from /usr/bin/vagrant:22:in `load'
        from /usr/bin/vagrant:22:in `<main>'
denysvitali commented 7 years ago

Try this.
Download the .gem file, place it where you want, then do vagrant plugins install vagrant-proxmox-0.0.11.gem and test it.

I currently have tested it against the included tests, and seems to be working fine, I'll now test it with a real ProxMox Server and report back.
If everything looks good to you guys, I'll make a PR to upstream my changes

linuxmaniac commented 6 years ago

@denysvitali

vseva@slim:~$ vagrant plugin install Downloads/vagrant-proxmox-0.0.11.gem
Installing the 'Downloads/vagrant-proxmox-0.0.11.gem' plugin. This can take a few minutes...
Bundler, the underlying system Vagrant uses to install plugins,
reported an error. The error is shown below. These errors are usually
caused by misconfigured plugin installations or transient network
issues. The error from Bundler is:

conflicting dependencies json (= 1.8.3) and json (= 2.1.0)
  Activated json-2.1.0
  which does not match conflicting dependency (= 1.8.3)

  Conflicting dependency chains:
    json (= 2.1.0), 2.1.0 activated

  versus:
    json (= 1.8.3)

  Gems matching json (= 1.8.3):
    json-1.8.3

now I'm at Debian buster with vagrant 1.9.8+dfsg-1

Same thing for https://github.com/denysvitali/vagrant-proxmox/releases/tag/v0.0.12 version

vseva@slim:~$ vagrant plugin install /tmp/vagrant-proxmox-0.0.12.gem
Installing the '/tmp/vagrant-proxmox-0.0.12.gem' plugin. This can take a few minutes...
Bundler, the underlying system Vagrant uses to install plugins,
reported an error. The error is shown below. These errors are usually
caused by misconfigured plugin installations or transient network
issues. The error from Bundler is:

conflicting dependencies json (= 1.8.3) and json (= 2.1.0)
  Activated json-2.1.0
  which does not match conflicting dependency (= 1.8.3)

  Conflicting dependency chains:
    json (= 2.1.0), 2.1.0 activated

  versus:
    json (= 1.8.3)

  Gems matching json (= 1.8.3):
    json-1.8.3
g3rhard commented 6 years ago

@denysvitali

Thank you in advance, I find the time for this plugin and build them )) But I have a problem - and i think, problem with selfsigned SSL cert

root@pve:~/testboxt# vagrant up
Bringing machine 'box' up with 'proxmox' provider...
==> box: translation missing: en.vagrant_proxmox.cloning_vm
Unable to communicate with proxmox server:

translation missing: en.vagrant_proxmox.errors.vm_clone_error

Vagrant file:

Vagrant.configure('2') do |config|

    config.vm.provider :proxmox do |proxmox|
        proxmox.endpoint = 'https://pve_host:8006/api2/json'
        proxmox.user_name = 'root@pam'
        proxmox.password = 'mypassword'
        proxmox.vm_id_range = 900..910
        proxmox.vm_type = :qemu
        proxmox.vm_name_prefix = 'vagrant_'
        proxmox.qemu_os = :l26
        proxmox.qemu_disk_size = '5G'
        proxmox.qemu_storage = 'local'
        #proxmox.qemu_iso_file = '/home/user/system.iso'
        proxmox.vm_name_prefix = 'vagrant_test_'
        proxmox.qemu_cores = 1
        proxmox.qemu_sockets = 1
        proxmox.qemu_nic_model = 'virtio'
        proxmox.qemu_bridge = 'vmbr0'
        proxmox.vm_memory = 512
    end

    config.vm.define :box, primary: true do |box|
        box.vm.box = 'dummy'
        box.vm.network :public_network, ip: 'free_ip_from_my_network', macaddress: 'ff:aa:cc:dd:bb:ee'
    end

end

vagrant up --debug: https://pastebin.com/mt6LDNqW

lausser commented 6 years ago

Hi, after a 10-hour-nightmare installing vagrant and this plugin on a Debian buster, i could at least boot a vm. My two Cents: As root, run gem install rest-client -v 1.6.7 gem uninstall rest-client -v 2.0.2 gem uninstall -i /usr/share/rubygems-integration/all rest-client

Another maybe useful Thing: VAGRANT_DISABLE_STRICT_DEPENDENCY_ENFORCEMENT=1 vagrant plugin install vagrant-proxmox

vikas027 commented 5 years ago

I have tried everything listed out in this thread, nothing worked for me with the latest versions of vagrant and proxmox. I wish this repository was maintained actively.

x0341 commented 4 years ago

same error .... no fixes yet ?

charles-josiah commented 4 years ago

Please helpppp... Same error too... vagrant plugin install vagrant-proxmox-0.0.12.gem Installing the 'vagrant-proxmox-0.0.12.gem' plugin. This can take a few minutes... Vagrant failed to properly resolve required dependencies. These errors can commonly be caused by misconfigured plugin installations or transient network issues. The reported error is:

conflicting dependencies i18n (>= 0.6.4, ~> 0.6) and i18n (= 1.8.2) Activated i18n-1.8.2 which does not match conflicting dependency (>= 0.6.4, ~> 0.6)

Conflicting dependency chains: i18n (= 1.8.2), 1.8.2 activated

versus: vagrant-proxmox (= 0.0.12), 0.0.12 activated, depends on activesupport (~> 4.0.0), 4.0.0 activated, depends on i18n (>= 0.6.4, ~> 0.6)

jbartak commented 4 years ago

Same error too :( Please fix

jagyugyaerik commented 3 years ago

Same error too

takobaba commented 3 years ago

Same here

ROBERTPASCAL commented 3 years ago

same error cannot install plugin vagrant-proxmox

fargusplumdoodle commented 3 years ago

This would be really nice if it were fixed! I am also having this error

Tiller431 commented 3 years ago

This is still an issue....

CptLeoxo commented 2 weeks ago

I had the same problem with i18n. I found it's global placement, then deleted it. After I installed the version that I needed, which was 0.6.4, and it works.