-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Failure at vagrant up - ElasticSearch/WinRM #63
Comments
Are you still having problems with the build? We've pushed a few fixes recently that may have resolved it. |
I'm getting same. Using
Full log for |
Hi everyone, I changed the sleep time from 5 to 30 seconds within the metasploitable3\scripts\installs\install_elasticsearch.bat file. I believe that the original 5 seconds is not enough time for some machines to start elasticsearch and run a successful GetResponse(). The specific line that I changed in metasploitable3\scripts\installs\install_elasticsearch.bat file was from this: to this: This is the first time I have ever commented on anything on GitHub, so hopefully this helps with this specific problem. This is what I am currently using, just in case anyone is wondering. |
Thanks. That fixed the problem. |
Nice fix, @a-garcia. Definitely sounds like that timer should be increased to have better support for more systems. Would you mind submitting a PR with the change? |
How much is enough for waiting time? Should it poll service until it's running and returning 200 for requests? |
@jbarnett-r7, I have attempted to submit the PR, please let me know if you don't see it. I haven't worked on a project in awhile so my git skills are a little rusty. Just kind of started tinkering with metasploitable :). @jikuja, that sounds like an efficient way of solving that issue. A blanket time frame may not be the most optimal solution. How about a try catch? An issue I see is if for some reason the service does not start for some reason, does the polling functionality eventually stop? I think either way there might have to be some kind of timing mechanism for the given scenarios. |
Issue Description
Failure occurred after executing vagrant up
Host System
Command Output
==> default: The service 'elasticsearch-service-x64' has been installed.
==> default:
==> default: C:\Windows\system32>sc config "elasticsearch-service-x64" start= auto
==> default:
==> default: [SC] ChangeServiceConfig SUCCESS
==> default: C:\Windows\system32>cmd /c ""C:\Program Files\elasticsearch-1.1.1\bin\service.bat" start"
==> default: The service 'elasticsearch-service-x64' has been started
==> default:
==> default: C:\Windows\system32>powershell -Command "Start-Sleep -s 5"
==> default: C:\Windows\system32>powershell -Command "$req = [System.Net.HttpWebRequest]::Create('http://localhost:9200/metasploitable3/'); $req.method = 'PUT'; $req.GetResponse()"
==> default: Exception calling "GetResponse" with "0" argument(s): "Unable to connect to the
==> default:
==> default: remote server"
==> default: At line:1 char:124
==> default: + $req = [System.Net.HttpWebRequest]::Create('http://localhost:9200/metasploita
==> default: ble3/'); $req.method = 'PUT'; $req.GetResponse <<<< ()
==> default: + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
==> default: + FullyQualifiedErrorId : DotNetMethodException
==> default:
==> default: C:\Windows\system32>powershell -Command "$body = [System.Text.Encoding]::ASCII.GetBytes('{"user":"kimchy", "post_date": "2009-11-15T14:12:12", "message": "Elasticsearch" }'); $req = [System.Net.HttpWebRequest]::Create('http://localhost:9200/metasploitable3/message/1'); $req.method = 'PUT'; $req.ContentType = 'application/x-www-form-urlencoded'; $stream = $req.GetRequestStream(); $stream.Write($body, 0, $body.Length); $stream.close(); $req.GetResponse()"
==> default: Exception calling "GetRequestStream" with "0" argument(s): "Unable to connect t
==> default:
==> default: o the remote server"
==> default: At line:1 char:338
==> default: + $body = [System.Text.Encoding]::ASCII.GetBytes('{"user":"kimchy", "post_date"
==> default: : "2009-11-15T14:12:12", "message": "Elasticsearch" }'); $req = [System.Net.Htt
==> default:
==> default: pWebRequest]::Create('http://localhost:9200/metasploitable3/message/1'); $req.m
==> default: ethod = 'PUT'; $req.ContentType = 'application/x-www-form-urlencoded'; $stream
==> default: = $req.GetRequestStream <<<< (); $stream.Write($body, 0, $body.Length); $stream
==> default:
==> default: .close(); $req.GetResponse()
==> default: + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
==> default: + FullyQualifiedErrorId : DotNetMethodException
==> default:
==> default: You cannot call a method on a null-valued expression.
==> default: At line:1 char:355
==> default: + $body = [System.Text.Encoding]::ASCII.GetBytes('{"user":"kimchy", "post_date"
==> default: : "2009-11-15T14:12:12", "message": "Elasticsearch" }'); $req = [System.Net.Htt
==> default: pWebRequest]::Create('http://localhost:9200/metasploitable3/message/1'); $req.m
==> default:
==> default: ethod = 'PUT'; $req.ContentType = 'application/x-www-form-urlencoded'; $stream
==> default: = $req.GetRequestStream(); $stream.Write <<<< ($body, 0, $body.Length); $stream
==> default: .close(); $req.GetResponse()
==> default:
==> default: + CategoryInfo : InvalidOperation: (Write:String) [], RuntimeExce
==> default: ption
==> default: + FullyQualifiedErrorId : InvokeMethodOnNull
==> default:
==> default: You cannot call a method on a null-valued expression.
==> default: At line:1 char:394
==> default: + $body = [System.Text.Encoding]::ASCII.GetBytes('{"user":"kimchy", "post_date"
==> default: : "2009-11-15T14:12:12", "message": "Elasticsearch" }'); $req = [System.Net.Htt
==> default: pWebRequest]::Create('http://localhost:9200/metasploitable3/message/1'); $req.m
==> default:
==> default: ethod = 'PUT'; $req.ContentType = 'application/x-www-form-urlencoded'; $stream
==> default: = $req.GetRequestStream(); $stream.Write($body, 0, $body.Length); $stream.close
==> default: <<<< (); $req.GetResponse()
==> default: + CategoryInfo : InvalidOperation: (close:String) [], RuntimeExce
==> default: ption
==> default:
==> default: + FullyQualifiedErrorId : InvokeMethodOnNull
==> default:
==> default: Exception calling "GetResponse" with "0" argument(s): "Unable to connect to the
==> default: remote server"
==> default: At line:1 char:414
==> default: + $body = [System.Text.Encoding]::ASCII.GetBytes('{"user":"kimchy", "post_date"
==> default: : "2009-11-15T14:12:12", "message": "Elasticsearch" }'); $req = [System.Net.Htt
==> default: pWebRequest]::Create('http://localhost:9200/metasploitable3/message/1'); $req.m
==> default: ethod = 'PUT'; $req.ContentType = 'application/x-www-form-urlencoded'; $stream
==> default: = $req.GetRequestStream(); $stream.Write($body, 0, $body.Length); $stream.close
==> default: (); $req.GetResponse <<<< ()
==> default: + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
==> default: + FullyQualifiedErrorId : DotNetMethodException
==> default:
The following WinRM command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
c:\tmp\vagrant-shell.bat
Stdout from the command:
Stderr from the command:
The text was updated successfully, but these errors were encountered: