{"action":"created","issue":{"url":"https://api.github.com/repos/chef/chef/issues/3423","repository_url":"https://api.github.com/repos/chef/chef","labels_url":"https://api.github.com/repos/chef/chef/issues/3423/labels{/name}","comments_url":"https://api.github.com/repos/chef/chef/issues/3423/comments","events_url":"https://api.github.com/repos/chef/chef/issues/3423/events","html_url":"https://github.com/chef/chef/issues/3423","id":80532459,"number":3423,"title":"Resource 'execute' hangs on Windows for some executable files","user":{"login":"olivierlemasle","id":628140,"avatar_url":"https://avatars.githubusercontent.com/u/628140?v=3","gravatar_id":"","url":"https://api.github.com/users/olivierlemasle","html_url":"https://github.com/olivierlemasle","followers_url":"https://api.github.com/users/olivierlemasle/followers","following_url":"https://api.github.com/users/olivierlemasle/following{/other_user}","gists_url":"https://api.github.com/users/olivierlemasle/gists{/gist_id}","starred_url":"https://api.github.com/users/olivierlemasle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olivierlemasle/subscriptions","organizations_url":"https://api.github.com/users/olivierlemasle/orgs","repos_url":"https://api.github.com/users/olivierlemasle/repos","events_url":"https://api.github.com/users/olivierlemasle/events{/privacy}","received_events_url":"https://api.github.com/users/olivierlemasle/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-05-25T13:11:00Z","updated_at":"2016-04-08T07:38:48Z","closed_at":"2015-06-14T17:55:34Z","body":"I use Chef Solo 12.3.0.\r\nI try to run the \"ASP .NET MVC 4\" installer on Windows 2008 R1 (64-bit), but the command never returns.\r\n\r\nI'm not using the `windows` cookbook.\r\nMy recipe contains the following code:\r\n\r\n```ruby\r\nremote_file \"#{Chef::Config[:file_cache_path]}/AspNetMVC4Setup.exe\" do\r\n  source 'http://download.microsoft.com/download/2/F/6/2F63CCD8-9288-4CC8-B58C-81D109F8F5A3/AspNetMVC4Setup.exe'\r\n  checksum '66dbb6573ab653f8a722821155e9572db42226e8d187fd4a814f101d8bcba67e'\r\nend\r\nexecute 'AspNetMVC4Setup.exe /q' do\r\n  cwd Chef::Config[:file_cache_path]\r\nend\r\n```\r\nThe installation is ok, but the process hangs, and the end of the rest of the recipe is not executed (actually Chef freezes).\r\n\r\nLogs end with:\r\n\r\n```\r\n==> web: [2015-05-25T05:59:55-07:00] DEBUG: Creating directory C:/var/chef/cache/remote_file\r\n==> web: [2015-05-25T05:59:56-07:00] DEBUG: touching /var/chef/cache/AspNetMVC4Setup.exe to create it\r\n==> web: \r\n==> web: [2015-05-25T05:59:56-07:00] INFO: remote_file[/var/chef/cache/AspNetMVC4Setup.exe] created file /var/chef/cache/AspNetMVC4Setup.exe\r\n==> web: [2015-05-25T05:59:56-07:00] DEBUG: calculating checksum of C:/Users/vagrant/AppData/Local/Temp/chef-rest20150525-2268-icimbk to compare with \r\n==> web: [2015-05-25T05:59:56-07:00] INFO: remote_file[/var/chef/cache/AspNetMVC4Setup.exe] updated file contents /var/chef/cache/AspNetMVC4Setup.exe\r\n==> web: [2015-05-25T05:59:58-07:00] DEBUG: selinux utilities can not be found. Skipping selinux permission fixup.\r\n==> web: \r\n==> web: [2015-05-25T05:59:58-07:00] INFO: Processing execute[AspNetMVC4Setup.exe /q] action run (amysta::web line 29)\r\n==> web: [2015-05-25T05:59:58-07:00] DEBUG: providers for generic execute resource enabled on node include: [Chef::Provider::Execute]\r\n==> web: [2015-05-25T05:59:58-07:00] DEBUG: providers that refused resource execute[AspNetMVC4Setup.exe /q] were: []\r\n==> web: [2015-05-25T05:59:58-07:00] DEBUG: providers that support resource execute[AspNetMVC4Setup.exe /q] include: [Chef::Provider::Execute]\r\n==> web: [2015-05-25T05:59:58-07:00] DEBUG: providers that survived replacement include: [Chef::Provider::Execute]\r\n```\r\n\r\nBut if I try manually (i.e. in a `cmd` console, with the same user account), the same command:\r\n\r\n    AspNetMVC4Setup.exe /q\r\n\r\nit returns (with exit code 0) in a few seconds.\r\n\r\nActually, my first attempt was to use the `windows` cookbook, with the code:\r\n\r\n```ruby\r\nwindows_package 'Microsoft ASP.NET MVC 4' do\r\n  source 'http://download.microsoft.com/download/2/F/6/2F63CCD8-9288-4CC8-B58C-81D109F8F5A3/AspNetMVC4Setup.exe'\r\n  installer_type :custom\r\n  options \"/q\"\r\nend\r\n```\r\nIt executed the command\r\n\r\n    start \"\" /wait \"\\var\\chef\\cache\\AspNetMVC4Setup.exe\" /q & exit %%ERRORCODE%%\r\n\r\nBut there was exactly the same problem: it never returned when the command was passed by Chef; it returned in a few seconds when I tried manually in a `cmd` console.\r\n\r\nWhere is the difference?\r\nIs there something to do with running a 32-bit Chef on a 64-bit Windows Server?"},"comment":{"url":"https://api.github.com/repos/chef/chef/issues/comments/207276815","html_url":"https://github.com/chef/chef/issues/3423#issuecomment-207276815","issue_url":"https://api.github.com/repos/chef/chef/issues/3423","id":207276815,"user":{"login":"olivierlemasle","id":628140,"avatar_url":"https://avatars.githubusercontent.com/u/628140?v=3","gravatar_id":"","url":"https://api.github.com/users/olivierlemasle","html_url":"https://github.com/olivierlemasle","followers_url":"https://api.github.com/users/olivierlemasle/followers","following_url":"https://api.github.com/users/olivierlemasle/following{/other_user}","gists_url":"https://api.github.com/users/olivierlemasle/gists{/gist_id}","starred_url":"https://api.github.com/users/olivierlemasle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olivierlemasle/subscriptions","organizations_url":"https://api.github.com/users/olivierlemasle/orgs","repos_url":"https://api.github.com/users/olivierlemasle/repos","events_url":"https://api.github.com/users/olivierlemasle/events{/privacy}","received_events_url":"https://api.github.com/users/olivierlemasle/received_events","type":"User","site_admin":false},"created_at":"2016-04-08T07:38:48Z","updated_at":"2016-04-08T07:38:48Z","body":"@sneal @bsamek FWIW, in my case, the issue was related to https://github.com/mitchellh/vagrant/blob/master/plugins/communicators/winrm/scripts/elevated_shell.ps1.erb\r\nI can't remember the details (and I did not find the root cause anyway) but I did not reproduce the issue when using Chef directly."}}