{"action":"created","issue":{"url":"https://api.github.com/repos/mefellows/vagrant-dsc/issues/21","repository_url":"https://api.github.com/repos/mefellows/vagrant-dsc","labels_url":"https://api.github.com/repos/mefellows/vagrant-dsc/issues/21/labels{/name}","comments_url":"https://api.github.com/repos/mefellows/vagrant-dsc/issues/21/comments","events_url":"https://api.github.com/repos/mefellows/vagrant-dsc/issues/21/events","html_url":"https://github.com/mefellows/vagrant-dsc/issues/21","id":161419897,"number":21,"title":"verify_shared_folders fails even when powershell returns exitcode=>0","user":{"login":"deluxebrain","id":1174124,"avatar_url":"https://avatars.githubusercontent.com/u/1174124?v=3","gravatar_id":"","url":"https://api.github.com/users/deluxebrain","html_url":"https://github.com/deluxebrain","followers_url":"https://api.github.com/users/deluxebrain/followers","following_url":"https://api.github.com/users/deluxebrain/following{/other_user}","gists_url":"https://api.github.com/users/deluxebrain/gists{/gist_id}","starred_url":"https://api.github.com/users/deluxebrain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deluxebrain/subscriptions","organizations_url":"https://api.github.com/users/deluxebrain/orgs","repos_url":"https://api.github.com/users/deluxebrain/repos","events_url":"https://api.github.com/users/deluxebrain/events{/privacy}","received_events_url":"https://api.github.com/users/deluxebrain/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mefellows/vagrant-dsc/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":25,"created_at":"2016-06-21T12:09:27Z","updated_at":"2016-07-28T17:45:00Z","closed_at":null,"body":"```vagrant up``` is failing for me with the following error:\r\n\r\n```Shared folders not properly configured. This is generally resolved by a 'vagrant halt && vagrant up'```\r\n\r\nRunning with ```--debug``` Im getting the following log entries:\r\n\r\n```INFO dsc: Checking for shared folder: /tmp/vagrant-dsc-6/dsc/manifests/```\r\n\r\nThis executes the following script:\r\n\r\n```shell\r\nDEBUG winrmshell: powershell executing:\r\n$ProgressPreference='SilentlyContinue';\r\n            $p = \"/tmp/vagrant-dsc-6/dsc/manifests/\"\r\n            if ((Test-Path $p) -and (get-item $p).PSIsContainer) {\r\n              exit 0\r\n            }\r\n            exit 1\r\n\r\nif ($?) { exit 0 } else { if($LASTEXITCODE) { exit $LASTEXITCODE } else { exit 1 } }\r\n```\r\n\r\nWhich in turns returns with a zero exit code:\r\n\r\n```shell\r\nDEBUG winrmshell: Output: {:data=>[{:stderr=>\"#< CLIXML\\r\\n\"}, {:stderr=>\"<Objs Version=\\\"1.1.0.1\\\" xmlns=\\\"http://schemas.microsoft.com/powershell/2004/04\\\"><Obj S=\\\"progress\\\" RefId=\\\"0\\\"><TN RefId=\\\"0\\\"><T>System.Management.Automation.PSCustomObject</T><T>System.Object</T></TN><MS><I64 N=\\\"SourceId\\\">1</I64><PR N=\\\"Record\\\"><AV>Preparing m\"}, {:stderr=>\"odules for first use.</AV><AI>0</AI><Nil /><PI>-1</PI><PC>-1</PC><T>Completed</T><SR>-1</SR><SD> </SD></PR></MS></Obj><Obj S=\\\"progress\\\" RefId=\\\"1\\\"><TNRef RefId=\\\"0\\\" /><MS><I64 N=\\\"SourceId\\\">2</I64><PR N=\\\"Record\\\"><AV>Preparing modules for first use.</AV><AI>0</AI><Nil /><PI>-1</PI><PC>-1</PC><T>Completed</T><SR>-1</SR><SD> </SD></PR></MS></Obj></Objs>\"}], :exitcode=>0}\r\n```\r\nHowever - this is then immediately followed by an error that states that the shared folders cannot be found:\r\n\r\n```shell\r\nERROR warden: Error occurred: Shared folders not properly configured. This is generally resolved by a 'vagrant halt && vagrant up'\r\n```\r\n\r\nI have manually verified that the shared folder as specified in the log file exists on the guest. I've also manually run the powershell script on the host and its returning ```true```.\r\n\r\nWorking through your (most excellent!) three-part blog series about DSC provisioning, the only differences I can see between my packer builds and your examples are the following:\r\n\r\n1. I've bumped the PowerShell version to **5** (by not specifying a version number in the ```choco install``` call).\r\n2. I'm not brining in the ```SEEK``` PowerShell modules as these appear to have all been mainlined into the official PowerShell repository at this stage.\r\n\r\nAny ideas?\r\n\r\nMany thanks."},"comment":{"url":"https://api.github.com/repos/mefellows/vagrant-dsc/issues/comments/235970410","html_url":"https://github.com/mefellows/vagrant-dsc/issues/21#issuecomment-235970410","issue_url":"https://api.github.com/repos/mefellows/vagrant-dsc/issues/21","id":235970410,"user":{"login":"dragon788","id":487774,"avatar_url":"https://avatars.githubusercontent.com/u/487774?v=3","gravatar_id":"","url":"https://api.github.com/users/dragon788","html_url":"https://github.com/dragon788","followers_url":"https://api.github.com/users/dragon788/followers","following_url":"https://api.github.com/users/dragon788/following{/other_user}","gists_url":"https://api.github.com/users/dragon788/gists{/gist_id}","starred_url":"https://api.github.com/users/dragon788/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dragon788/subscriptions","organizations_url":"https://api.github.com/users/dragon788/orgs","repos_url":"https://api.github.com/users/dragon788/repos","events_url":"https://api.github.com/users/dragon788/events{/privacy}","received_events_url":"https://api.github.com/users/dragon788/received_events","type":"User","site_admin":false},"created_at":"2016-07-28T17:45:00Z","updated_at":"2016-07-28T17:45:00Z","body":"And the plot thickens. It appears that removing the Chocolatey generated PowerShell profile actually works around this issue. We'll see if it blows up when there is another progress bar generated, but at the very least this works around the \"Preparing modules for first use\" that was popping up and breaking things. Chocolatey also has a note about fixing this by not adding a default profile if it isn't there. https://github.com/chocolatey/choco/issues/833"}}
{"actor":{"display_login":"dragon788"}}