emyl / vagrant-triggers

Allow the definition of arbitrary scripts that will run on the host before and/or after Vagrant commands.
MIT License
546 stars 35 forks source link

Windows 10 guest, run_remote failed on destroy #66

Closed rrzaripov closed 8 years ago

rrzaripov commented 8 years ago

Possible related to #55 and #64 but update to v0.5.3 not fixed this issue for me. I have no any problems with the Windows 7 and Debian Linux guests (vagrant-triggers v0.5.2), and only destroying the Windows 10 guest I'm get this error.

Part of Vagrantfile:

      config.trigger.before :destroy do
        begin
          run_remote "curl -s -H 'Accept: application/json' -d id=#{vm_name} -d action=unregister -k http://#{salt_master}:8000/hook/dev/service"
        rescue => e
          next
        end
      end

vagrant destroy -f output (sorry for unreadable error message):

> vagrant destroy -f
==> pacs-win10-210416-170247: Running triggers before destroy...
==> pacs-win10-210416-170247: Executing remote command "curl -s -H 'Accept: application/json' -d id=pacs-win10-210416-170247 -d action=unregister -k ht
000/hook/dev/service"...
==> pacs-win10-210416-170247: #< CLIXML

==> pacs-win10-210416-170247: <Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04"><S S="Error">Invoke-WebRequest : Ћвбгвбвў
а ¬Ґва  "SessionVariable". “Є ¦ЁвҐ Ї а ¬Ґва вЁЇ  "System.String" Ё Ї®ўв®_x000D__x000A_</S><S S="Error">аЁвҐ Ї®ЇлвЄг.
==> pacs-win10-210416-170247: _x000D__x000A_</S><S S="Error">бва®Є :1 §­ Є:46_x000D__x000A_</S><S S="Error">+ $ProgressPreference='SilentlyContinue'; c
applicati ..._x000D__x000A_</S><S S="Error">+                                              ~~_x000D__x000A_</S><S S="Error">    + CategoryInfo
 (:) [Invoke-WebRequest], ParameterBindingException_x000D__x000A_</S><S S="Error">    + FullyQualifiedErrorId : MissingArgument,Microsoft.PowerShell.Co
uestCommand_x000D__x000A_</S><S S="Error"> _x000D__x000A_</S></Objs>
==> pacs-win10-210416-170247: Remote command execution finished.
==> pacs-win10-210416-170247: Forcing shutdown of VM...
==> pacs-win10-210416-170247: Destroying VM and associated drives...
rrzaripov commented 8 years ago

Solution founded here:http://stackoverflow.com/a/30807818/753558 Not vagrant-triggers issue, sorry for this.