How do I fix error with using SAML in Hue application - saml

I got a problem for using saml function in hue application.
I did every thing what I need to do in following this : https://docs.gethue.com/latest/administrator/configuration/server/#saml
env
os : ubuntu
hue : 4.5.0
step 1. install below
git gcc python-dev swig openssl xmlsec1 libxmlsec1-openssl
step 2. copy metadata from Idp to local
step 3. make a private key and certification with openssl
step 4. set configuration ini file
[[auth]]
backend=libsaml.backend.SAML2Backend
[libsaml]
xmlsec_binary=/usr/bin/xmlsec1
metadata_file=/opt/cloudera/security/saml/idp-openam-metadata.xml
key_file=/opt/cloudera/security/saml/host.key
cert_file=/opt/cloudera/security/saml/host.pem username_source=nameid
entity_id=https://myhuedomainname.com/saml2/metadata
step 5. get hue metadata and register it at Idp
I got my hue metadata at : https://myhuedomainname.com/saml2/metadata
and I registered it at Idp that our company use.
I think I did everything right.
but when I access to https://myhuedomainname.com,
my browser is redirected to :https://myhuedomainname.com/saml2/login/?next=/
then I got error that I cannot solved
it is empty screen that is redirected to same url again and again.
in browser console, I got this error
i18n.js:17 Uncaught ReferenceError: HUE_I18n is not defined
at I18n (i18n.js:17)
at Module../desktop/core/src/desktop/js/jquery/plugins/jquery.filechooser.js
(hue-bundle-facb48d1fb2c72ee1343.js:sourcemap:47211)
at webpack_require (hue-bundle-facb48d1fb2c72ee1343.js:sourcemap:104)
at Module../desktop/core/src/desktop/js/jquery/jquery.common.js (hue-bundle-facb48d1fb2c72ee1343.js:sourcemap:46742)
at webpack_require (hue-bundle-facb48d1fb2c72ee1343.js:sourcemap:104)
at Module../desktop/core/src/desktop/js/hue.js (hue-bundle-facb48d1fb2c72ee1343.js:sourcemap:46485)
at webpack_require (hue-bundle-facb48d1fb2c72ee1343.js:sourcemap:104)
at Object.0 (hue-bundle-facb48d1fb2c72ee1343.js:sourcemap:104841)
at webpack_require (hue-bundle-facb48d1fb2c72ee1343.js:sourcemap:104)
at checkDeferredModules (hue-bundle-facb48d1fb2c72ee1343.js:sourcemap:65)
I18n # i18n.js:17
./desktop/core/src/desktop/js/jquery/plugins/jquery.filechooser.js #
hue-bundle-facb48d1fb2c72ee1343.js:sourcemap:47211
webpack_require # hue-bundle-facb48d1fb2c72ee1343.js:sourcemap:104 ./desktop/core/src/desktop/js/jquery/jquery.common.js #
hue-bundle-facb48d1fb2c72ee1343.js:sourcemap:46742
webpack_require # hue-bundle-facb48d1fb2c72ee1343.js:sourcemap:104 ./desktop/core/src/desktop/js/hue.js #
hue-bundle-facb48d1fb2c72ee1343.js:sourcemap:46485
webpack_require # hue-bundle-facb48d1fb2c72ee1343.js:sourcemap:104 0 # hue-bundle-facb48d1fb2c72ee1343.js:sourcemap:104841
webpack_require # hue-bundle-facb48d1fb2c72ee1343.js:sourcemap:104 checkDeferredModules # hue-bundle-facb48d1fb2c72ee1343.js:sourcemap:65
(anonymous) # hue-bundle-facb48d1fb2c72ee1343.js:sourcemap:241
(anonymous) # hue-bundle-facb48d1fb2c72ee1343.js:sourcemap:244
bootstrap-tooltip.js:326 Uncaught TypeError: Cannot read property 'fn'
of undefined
at bootstrap-tooltip.js:326
at bootstrap-tooltip.js:361 (anonymous) # bootstrap-tooltip.js:326 (anonymous) # bootstrap-tooltip.js:361
bootstrap-typeahead-touchscreen.js:317 Uncaught TypeError: Cannot read
property 'fn' of undefined
at bootstrap-typeahead-touchscreen.js:317
at bootstrap-typeahead-touchscreen.js:358 (anonymous) # bootstrap-typeahead-touchscreen.js:317 (anonymous) #
bootstrap-typeahead-touchscreen.js:358
bootstrap-better-typeahead.min.js:12 Uncaught TypeError: Cannot read
property 'extend' of undefined
at bootstrap-better-typeahead.min.js:12
at bootstrap-better-typeahead.min.js:12 (anonymous) # bootstrap-better-typeahead.min.js:12 (anonymous) #
bootstrap-better-typeahead.min.js:12
popover-extra-placements.js:113 Uncaught ReferenceError: jQuery is not
defined
at popover-extra-placements.js:113 (anonymous) # popover-extra-placements.js:113
?next=/:123 Uncaught ReferenceError: Dropzone is not defined
at ?next=/:123 (anonymous) # ?next=/:123
below is the logs of hue
[23/Sep/2019 21:50:34 +0000] middleware INFO Redirecting to
login page: / [23/Sep/2019 21:50:34 +0000] access INFO
210.94.41.89, 34.96.109.171 -anon- - "GET / HTTP/1.1" (mem: 158mb)-- login redirection [23/Sep/2019 21:50:34 +0000] access INFO
210.94.41.89, 34.96.109.171 -anon- - "GET / HTTP/1.1" returned in 1ms (mem: 158mb) [23/Sep/2019 21:50:34] "GET / HTTP/1.1" 302 0
[23/Sep/2019 21:50:34] "GET
/static/desktop/js/bundles/hue/hue-bundle-facb48d1fb2c72ee1343.js.map
HTTP/1.1" 200 7139914 [23/Sep/2019 21:50:35 +0000] access DEBUG
210.94.41.89, 34.96.109.171 -anon- - "GET /saml2/login/ HTTP/1.1" (mem: 158mb) [23/Sep/2019 21:50:35 +0000] mdstore DEBUG
service => {'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST':
[{'binding': 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST',
'class':
'urn:oasis:names:tc:SAML:2.0:metadata&SingleSignOnService',
'location': 'https://sts.secsso.net/adfs/ls/'}],
'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect': [{'binding':
'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect', 'class':
'urn:oasis:names:tc:SAML:2.0:metadata&SingleSignOnService',
'location': 'https://sts.secsso.net/adfs/ls/'}]} [23/Sep/2019 21:50:35
+0000] mdstore DEBUG service => {'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST': [{'binding':
'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST', 'class':
'urn:oasis:names:tc:SAML:2.0:metadata&SingleSignOnService',
'location': 'https://sts.secsso.net/adfs/ls/'}],
'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect': [{'binding':
'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect', 'class':
'urn:oasis:names:tc:SAML:2.0:metadata&SingleSignOnService',
'location': 'https://sts.secsso.net/adfs/ls/'}]} [23/Sep/2019 21:50:35
+0000] mdstore DEBUG service(http://sts.secsso.net/adfs/services/trust, idpsso_descriptor,
single_sign_on_service, None) [23/Sep/2019 21:50:35 +0000] mdstore
DEBUG service => {'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST':
[{'binding': 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST',
'class':
'urn:oasis:names:tc:SAML:2.0:metadata&SingleSignOnService',
'location': 'https://sts.secsso.net/adfs/ls/'}],
'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect': [{'binding':
'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect', 'class':
'urn:oasis:names:tc:SAML:2.0:metadata&SingleSignOnService',
'location': 'https://sts.secsso.net/adfs/ls/'}]} [23/Sep/2019 21:50:35
+0000] mdstore DEBUG service(http://sts.secsso.net/adfs/services/trust, idpsso_descriptor,
single_sign_on_service,
urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect) [23/Sep/2019
21:50:35 +0000] mdstore DEBUG service => [{'binding':
'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect', 'class':
'urn:oasis:names:tc:SAML:2.0:metadata&SingleSignOnService',
'location': 'https://sts.secsso.net/adfs/ls/'}] [23/Sep/2019 21:50:35
+0000] client INFO destination to provider: https://sts.secsso.net/adfs/ls/ [23/Sep/2019 21:50:35 +0000] entity
INFO REQUEST:
https://sbc-hue.mgmt.dev.com/saml2/metadata/ [23/Sep/2019 21:50:35 +0000] client INFO
AuthNReq: https://sbc-hue.mgmt.dev.com/saml2/metadata/ [23/Sep/2019 21:50:35 +0000] entity INFO
HTTP REDIRECT [23/Sep/2019 21:50:35 +0000] views WARNING User
is using Hue 3 UI [23/Sep/2019 21:50:35 +0000] decorators INFO
AXES: Calling decorated function: dt_login [23/Sep/2019 21:50:35
+0000] decorators INFO args: (True,) [23/Sep/2019 21:50:35 +0000] access INFO 210.94.41.89, 34.96.109.171 -anon- - "GET /saml2/login/ HTTP/1.1" returned in 250ms (mem: 158mb)
I tried it with hue 4.0.0 version but it works

I resolved it with setting 'redirect_whitelist'.
I just though it is not mandatory. but it is

Related

java.net.SocketException: Connection reset since TLSv1.2 protocol

I'm no more able to connect to api.softlayer.com
I'm calling the rest API from a WebSphere application portal 8.5 (java7) using Apache (HTTP-client-4.5.3.jar)
The coding is
HttpClient client = HttpClientBuilder.create().build();
HttpResponse response = client.execute(request);
The error is
17:44:00.997 [main] DEBUG o.a.h.i.c.PoolingHttpClientConnectionManager - Connection request: [route: {s}->https://api.softlayer.com:443][total kept alive: 0; route allocated: 0 of 2; total allocated: 0 of 20]
17:44:01.044 [main] DEBUG o.a.h.i.c.PoolingHttpClientConnectionManager - Connection leased: [id: 0][route: {s}->https://api.softlayer.com:443][total kept alive: 0; route allocated: 1 of 2; total allocated: 1 of 20]
17:44:01.044 [main] DEBUG o.a.h.impl.execchain.MainClientExec - Opening connection {s}->https://api.softlayer.com:443
17:44:01.060 [main] DEBUG o.a.h.i.c.DefaultHttpClientConnectionOperator - Connecting to api.softlayer.com/66.228.119.120:443
17:44:01.060 [main] DEBUG o.a.h.c.s.SSLConnectionSocketFactory - Connecting socket to api.softlayer.com/66.228.119.120:443 with timeout 0
17:44:01.606 [main] DEBUG o.a.h.c.s.SSLConnectionSocketFactory - Enabled protocols: [TLSv1]
17:44:01.606 [main] DEBUG o.a.h.c.s.SSLConnectionSocketFactory - Enabled cipher suites:[TLS_EMPTY_RENEGOTIATION_INFO_SCSV, SSL_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, SSL_ECDHE_RSA_WITH_AES_128_CBC_SHA256, SSL_RSA_WITH_AES_128_CBC_SHA256, SSL_ECDH_ECDSA_WITH_AES_128_CBC_SHA256, SSL_ECDH_RSA_WITH_AES_128_CBC_SHA256, SSL_DHE_RSA_WITH_AES_128_CBC_SHA256, SSL_DHE_DSS_WITH_AES_128_CBC_SHA256, SSL_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, SSL_ECDHE_RSA_WITH_AES_128_CBC_SHA, SSL_RSA_WITH_AES_128_CBC_SHA, SSL_ECDH_ECDSA_WITH_AES_128_CBC_SHA, SSL_ECDH_RSA_WITH_AES_128_CBC_SHA, SSL_DHE_RSA_WITH_AES_128_CBC_SHA, SSL_DHE_DSS_WITH_AES_128_CBC_SHA, SSL_ECDHE_ECDSA_WITH_RC4_128_SHA, SSL_ECDHE_RSA_WITH_RC4_128_SHA, SSL_RSA_WITH_RC4_128_SHA, SSL_ECDH_ECDSA_WITH_RC4_128_SHA, SSL_ECDH_RSA_WITH_RC4_128_SHA, SSL_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA, SSL_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA, SSL_RSA_WITH_3DES_EDE_CBC_SHA, SSL_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA, SSL_ECDH_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA, SSL_RSA_WITH_RC4_128_MD5]
17:44:01.606 [main] DEBUG o.a.h.c.s.SSLConnectionSocketFactory - Starting handshake
17:44:01.747 [main] DEBUG o.a.h.i.c.DefaultManagedHttpClientConnection - http-outgoing-0: Shutdown connection
17:44:01.747 [main] DEBUG o.a.h.impl.execchain.MainClientExec - Connection discarded
17:44:01.747 [main] DEBUG o.a.h.i.c.PoolingHttpClientConnectionManager - Connection released: [id: 0][route: {s}->https://api.softlayer.com:443][total kept alive: 0; route allocated: 0 of 2; total allocated: 0 of 20]
17:44:01.747 [main] INFO o.a.http.impl.execchain.RetryExec - I/O exception (java.net.SocketException) caught when processing request to {s}->https://api.softlayer.com:443: Connection reset
17:44:01.747 [main] DEBUG o.a.http.impl.execchain.RetryExec - Connection reset
java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:207) ~[na:1.7.0]
at java.net.SocketInputStream.read(SocketInputStream.java:133) ~[na:1.7.0]
at com.ibm.jsse2.a.a(a.java:110) ~[na:7.0 build_20131216]
at com.ibm.jsse2.a.a(a.java:141) ~[na:7.0 build_20131216]
at com.ibm.jsse2.qc.a(qc.java:691) ~[na:7.0 build_20131216]
at com.ibm.jsse2.qc.h(qc.java:266) ~[na:7.0 build_20131216]
at com.ibm.jsse2.qc.a(qc.java:770) ~[na:7.0 build_20131216]
at com.ibm.jsse2.qc.startHandshake(qc.java:476) ~[na:7.0 build_20131216]
at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:396) ~[httpclient-4.5.3.jar:4.5.3]
at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:355) ~[httpclient-4.5.3.jar:4.5.3]
The solution is to enable the enable TLSv1.2
import javax.net.ssl.SSLContext;
import org.apache.http.client.HttpClient;
import org.apache.http.conn.ssl.NoopHostnameVerifier;
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.ssl.SSLContexts;
public class HttpClientFactory {
private static CloseableHttpClient client;
public static HttpClient getHttpsClient() throws Exception {
if (client != null) {
return client;
}
SSLContext sslContext = SSLContexts.createDefault();
SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(sslContext, new String[] { "TLSv1.2"}, null, new NoopHostnameVerifier());
client = HttpClients.custom().setSSLSocketFactory(sslsf).build();
return client;
}
}
Softlayer's servers only accept TLSv1.2 connections you must make sure that your code is only performing connections with that protocol which it seems your code is not doing
17:44:01.606 [main] DEBUG o.a.h.c.s.SSLConnectionSocketFactory -
Enabled protocols: [TLSv1]

Webdriver keep on executing the scenarios without terminating the job

I used the below protractor cucumber multiCapabilities config file to execute my scenarios. While executing the config file, First time Chrome and Firefox got launched and my expected scenario got executed. But after the execution the job not got finished. The webdriver keep on launching the browsers and ending with 0 scenarios / 0 steps / 0m00.000s results. Can anyone help me to handle this situation.
Config file:
exports.config = {
seleniumAddress: "http://localhost:4444/wd/hub",
baseUrl: "https://www.google.co.in/",
multiCapabilities: [
{
browserName: "chrome",
shardTestFiles: true,
maxInstances: 1
},
{
browserName: "firefox",
shardTestFiles: true,
maxInstances: 1
}
],
framework: "custom",
frameworkPath: require.resolve("protractor-cucumber-framework"),
specs: ["../features/*.feature"],
cucumberOpts: {
format: 'json:results.json',
require: ["../stepDefinitions/*.js"],
tags: ['#sample']
}
};
Output:
I/launcher - 2 instance(s) of WebDriver still running
I/testLogger -
------------------------------------
I/testLogger - [chrome #01-0] PID: XXXXX
#Expected scenario got executed
I/launcher - 2 instance(s) of WebDriver still running
I/testLogger -
------------------------------------
I/testLogger - [firefox #11-0] PID: XXXXX
#Expected scenario got executed
I/launcher - 2 instance(s) of WebDriver still running
I/testLogger -
------------------------------------
I/testLogger - [firefox #11-1] PID: XXXXX
[firefox #11-1] 0 scenarios
[firefox #11-1] 0 steps
[firefox #11-1] 0m00.000s
I/launcher - 2 instance(s) of WebDriver still running
I/testLogger -
------------------------------------
I/testLogger - [chrome #01-1] PID: XXXXX
[chrome #01-1] 0 scenarios
[chrome #01-1] 0 steps
[chrome #01-1] 0m00.000s
And the webdriver keep on execution the scenarios until I manually terminate the job.

protractor tutorial step throwing "element not visible"

I'm new to protractor and am going through the tutorial. The setup and Step 0 worked fine for me but I had an unexpected error in Step 1:
$ protractor conf.js
[13:11:41] I/launcher - Running 1 instances of WebDriver
[13:11:41] I/hosted - Using the selenium server at http://localhost:4444/wd/hub
Started
seeking `first`
seeking `second`
seeking `gobutton`
seeking `latest`
F
Failures:
1) Protractor Demo App should add one and two
Message:
Failed: element not visible
(Session info: chrome=60.0.3112.78)
(Driver info: chromedriver=2.31.488763 (092de99f48a300323ecf8c2a4e2e7cab51de5ba8),platform=Linux 4.4.0-87-generic x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 43 milliseconds
Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
System info: host: 'pfuntner1', ip: '9.42.83.35', os.name: 'Linux', os.arch: 'amd64', os.version: '4.4.0-87-generic', java.version: '1.8.0'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, networkConnectionEnabled=false, chrome={chromedriverVersion=2.31.488763 (092de99f48a300323ecf8c2a4e2e7cab51de5ba8), userDataDir=/tmp/.org.chromium.Chromium.ZhadTr}, takesHeapSnapshot=true, pageLoadStrategy=normal, databaseEnabled=false, handlesAlerts=true, hasTouchScreen=false, version=60.0.3112.78, platform=LINUX, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true, setWindowRect=true, unexpectedAlertBehaviour=}]
Session ID: cf611f619dbf2069413885ed9bcbba17
Stack:
ElementNotVisibleError: element not visible
(Session info: chrome=60.0.3112.78)
(Driver info: chromedriver=2.31.488763 (092de99f48a300323ecf8c2a4e2e7cab51de5ba8),platform=Linux 4.4.0-87-generic x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 43 milliseconds
Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
System info: host: 'pfuntner1', ip: '9.42.83.35', os.name: 'Linux', os.arch: 'amd64', os.version: '4.4.0-87-generic', java.version: '1.8.0'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, networkConnectionEnabled=false, chrome={chromedriverVersion=2.31.488763 (092de99f48a300323ecf8c2a4e2e7cab51de5ba8), userDataDir=/tmp/.org.chromium.Chromium.ZhadTr}, takesHeapSnapshot=true, pageLoadStrategy=normal, databaseEnabled=false, handlesAlerts=true, hasTouchScreen=false, version=60.0.3112.78, platform=LINUX, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true, setWindowRect=true, unexpectedAlertBehaviour=}]
.
.
.
I added debugging statements to spec.js to try to identify what element it can't find. It appears to find the two input fields and the button fine but does not find the output field.
Here is my spec.js:
// spec.js
describe('Protractor Demo App', function() {
it('should add one and two', function() {
browser.get('http://juliemr.github.io/protractor-demo/');
console.log("seeking `first`");
element(by.model('first')).sendKeys(1);
console.log("seeking `second`");
element(by.model('second')).sendKeys(2);
console.log("seeking `gobutton`");
element(by.id('gobutton')).click();
console.log("seeking `latest`");
expect(element(by.binding('latest')).getText()).toEqual('5'); // This is wrong!
});
});
Am I doing something wrong?
Now there are few possible things happening here
The element that is returned by element(by.binding('latest')) is not the correct one
There are multiple elements matching element(by.binding('latest')) and the first one is being returned to you
The element being returned to you is not visible on the screen. Chromedriver is very specific when it comes to taking actions on element which are visible to the user. If the element is not visible to user a automation shouldn't be able to simulate action on it (not 100% true, because some actions can still be taken).
So make sure you are getting the right element and there are no multiple matches

Not able to run Protractor tests (5.0.0) on IE11

Protractor : 5.0.0, IE11, IEDriverServer_Win32_3.0.0.exe
conf file:
capabilities: {
browserName: 'internet explorer',
}
localSeleniumStandaloneOpts: {
jvmArgs: ["-Dwebdriver.ie.driver=.\\node_modules\\protractor\\node_modules\\webdriver-manager\\selenium\\IEDriverServer.exe"]
}
IE browsers opens up but doesn't do anything. Following is the error
[11:12:22] I/local - Starting selenium standalone server...
[11:12:22] I/launcher - Running 1 instances of WebDriver
[11:12:23] I/local - Selenium standalone server started at http://192.168.56.1:53122/wd/hub
Started
A Jasmine spec timed out. Resetting the WebDriver Control Flow.
F[11:12:26] E/launcher - Unable to get browser (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 15 milliseconds
Build info: version: '3.0.1', revision: '1969d75', time: '2016-10-18 09:48:19 -0700'
System info: host: 'RLAPTOP', ip: '', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_111'
Driver info: org.openqa.selenium.ie.InternetExplorerDriver
Capabilities [{browserAttachTimeout=0, ie.enableFullPageScreenshot=true, enablePersistentHover=true, ie.forceCreateProcessApi=false, ie.forceShellWindowsApi=false, pageLoadStrategy=normal, ignoreZoomSetting=false, ie.fileUploadDialogTimeout=3000, version=11, platform=WINDOWS, nativeEvents=true, ie.ensureCleanSession=false, elementScrollBehavior=0, ie.browserCommandLineSwitches=, requireWindowFocus=false, browserName=internet explorer, initialBrowserUrl=http://localhost:36498/, javascriptEnabled=true, ignoreProtectedModeSettings=false, enableElementCacheCleanup=true, unexpectedAlertBehaviour=dismiss}]
Session ID: e830e362-bb50-41bb-8b2d-cd4bd35f6d4d
[11:12:26] E/launcher - NoSuchWindowError: Unable to get browser (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 15 milliseconds
Build info: version: '3.0.1', revision: '1969d75', time: '2016-10-18 09:48:19 -0700'
System info: host: 'RLAPTOP', ip: '', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_111'
Driver info: org.openqa.selenium.ie.InternetExplorerDriver
Capabilities [{browserAttachTimeout=0, ie.enableFullPageScreenshot=true, enablePersistentHover=true, ie.forceCreateProcessApi=false, ie.forceShellWindowsApi=false, pageLoadStrategy=normal, ignoreZoomSetting=false, ie.fileUploadDialogTimeout=3000, version=11, platform=WINDOWS, nativeEvents=true, ie.ensureCleanSession=false, elementScrollBehavior=0, ie.browserCommandLineSwitches=, requireWindowFocus=false, browserName=internet explorer, initialBrowserUrl=http://localhost:36498/, javascriptEnabled=true, ignoreProtectedModeSettings=false, enableElementCacheCleanup=true, unexpectedAlertBehaviour=dismiss}]
Session ID: e830e362-bb50-41bb-8b2d-cd4bd35f6d4d
at WebDriverError (C:\QA\testingmaster\tests\protractor_tests\node_modules\selenium-webdriver\lib\error.js:27:5)
at NoSuchWindowError (C:\QA\testingmaster\tests\protractor_tests\node_modules\selenium-webdriver\lib\error.js:192:5)
at Object.checkLegacyResponse (C:\QA\testingmaster\tests\protractor_tests\node_modules\selenium-webdriver\lib\error.js:505:15)
at parseHttpResponse (C:\QA\testingmaster\tests\protractor_tests\node_modules\selenium-webdriver\lib\http.js:509:13)
at doSend.then.response (C:\QA\testingmaster\tests\protractor_tests\node_modules\selenium-webdriver\lib\http.js:440:13)
at process._tickCallback (internal/process/next_tick.js:103:7)
From: Task: WebDriver.getCurrentUrl()
at WebDriver.schedule (C:\QA\testingmaster\tests\protractor_tests\node_modules\selenium-webdriver\lib\webdriver.js:816:17)
at WebDriver.getCurrentUrl (C:\QA\testingmaster\tests\protractor_tests\node_modules\selenium-webdriver\lib\webdriver.js:1002:17)
at ScreenshotReporter.specDone (C:\QA\testingmaster\tests\protractor_tests\e2e\jasmine_reporters\screenshot_reporter.js:12:22)
at dispatch (C:\QA\testingmaster\tests\protractor_tests\node_modules\jasmine-core\lib\jasmine-core\jasmine.js:1966:28)
at ReportDispatcher.specDone (C:\QA\testingmaster\tests\protractor_tests\node_modules\jasmine-core\lib\jasmine-core\jasmine.js:1949:11)
at Spec.specResultCallback [as resultCallback] (C:\QA\testingmaster\tests\protractor_tests\node_modules\jasmine-core\lib\jasmine-core\jasmine.js:903:18)
at complete (C:\QA\testingmaster\tests\protractor_tests\node_modules\jasmine-core\lib\jasmine-core\jasmine.js:368:12)
at QueueRunner.clearStack (C:\QA\testingmaster\tests\protractor_tests\node_modules\jasmine-core\lib\jasmine-core\jasmine.js:660:9)
at QueueRunner.run (C:\QA\testingmaster\tests\protractor_tests\node_modules\jasmine-core\lib\jasmine-core\jasmine.js:1881:12)
at C:\QA\testingmaster\tests\protractor_tests\node_modules\jasmine-core\lib\jasmine-core\jasmine.js:1898:16
[11:12:26] E/launcher - Process exited with error code 199
Any suggestions? Do i need to start selenium server as well manually ?

HTTP POST - Mongo Connection Issue

I am attempting to perform an HTTP POST to a local mongo database based off a simple example (http://www.tothenew.com/blog/using-groovys-http-builder-library/) and am having trouble keeping the connection open long enough to make any posts. Here is my code:
public static void postToDatabase(String item, final log) {
try {
String baseURL = "http://localhost:27017"
URIBuilder uri = new URIBuilder(baseURL)
HTTPBuilder http = new HTTPBuilder(uri)
String path = "Test/testCollection"
http.post(path: path, body: item, requestContentType: URLENC) { resp ->
log.info("POST Success: ${resp.StatusLine}")
assert resp.StatusLine.statusCode == 201
}
} catch(HttpResponseException ex) {
ex.printStackTrace()
} catch(ConnectException ex) {
ex.printStackTrace()
}
}
Once the program reaches the http.post call, here is the following stack trace I receive:
5651 [main] DEBUG groovyx.net.http.HTTPBuilder - POST http://localhost:27017Test/testCollection
5843 [main] DEBUG org.apache.http.impl.conn.BasicClientConnectionManager - Get connection for route {}->http://localhost:27017
5862 [main] DEBUG org.apache.http.impl.conn.DefaultClientConnectionOperator - Connecting to localhost:27017
5890 [main] DEBUG org.apache.http.client.protocol.RequestAddCookies - CookieSpec selected: best-match
6067 [main] DEBUG org.apache.http.client.protocol.RequestAuthCache - Auth cache not set in the context
6067 [main] DEBUG org.apache.http.client.protocol.RequestTargetAuthentication - Target auth state: UNCHALLENGED
6068 [main] DEBUG org.apache.http.client.protocol.RequestProxyAuthentication - Proxy auth state: UNCHALLENGED
6068 [main] DEBUG org.apache.http.impl.client.DefaultHttpClient - Attempt 1 to execute request
6069 [main] DEBUG org.apache.http.impl.conn.DefaultClientConnection - Sending request: POST Test/testCollection HTTP/1.1
6069 [main] DEBUG org.apache.http.wire - >> "POST Test/testCollection HTTP/1.1[\r][\n]"
6071 [main] DEBUG org.apache.http.wire - >> "Accept: */*[\r][\n]"
6071 [main] DEBUG org.apache.http.wire - >> "Content-Length: 122[\r][\n]"
6071 [main] DEBUG org.apache.http.wire - >> "Content-Type: application/x-www-form-urlencoded[\r][\n]"
6071 [main] DEBUG org.apache.http.wire - >> "Host: localhost:27017[\r][\n]"
6071 [main] DEBUG org.apache.http.wire - >> "Connection: Keep-Alive[\r][\n]"
6071 [main] DEBUG org.apache.http.wire - >> "Accept-Encoding: gzip,deflate[\r][\n]"
6072 [main] DEBUG org.apache.http.wire - >> "[\r][\n]"
6072 [main] DEBUG org.apache.http.headers - >> POST Test/testCollection HTTP/1.1
6072 [main] DEBUG org.apache.http.headers - >> Accept: */*
6072 [main] DEBUG org.apache.http.headers - >> Content-Length: 122
6072 [main] DEBUG org.apache.http.headers - >> Content-Type: application/x-www-form-urlencoded
6072 [main] DEBUG org.apache.http.headers - >> Host: localhost:27017
6072 [main] DEBUG org.apache.http.headers - >> Connection: Keep-Alive
6072 [main] DEBUG org.apache.http.headers - >> Accept-Encoding: gzip,deflate
6073 [main] DEBUG org.apache.http.wire - >> "[ { "size" : "10\" - 10\" Double Helix (Class 4) 1 1/4\" Rod" , "strength" : { "unit" : "POUND_FORCE" , "value" : 31000}}]"
6075 [main] DEBUG org.apache.http.impl.conn.DefaultClientConnection - Connection 0.0.0.0:51283<->127.0.0.1:27017 closed
6075 [main] DEBUG org.apache.http.impl.client.DefaultHttpClient - Closing the connection.
6075 [main] DEBUG org.apache.http.impl.conn.DefaultClientConnection - Connection 0.0.0.0:51283<->127.0.0.1:27017 closed
6075 [main] DEBUG org.apache.http.impl.conn.DefaultClientConnection - Connection 0.0.0.0:51283<->127.0.0.1:27017 shut down
6075 [main] DEBUG org.apache.http.impl.conn.BasicClientConnectionManager - Releasing connection org.apache.http.impl.conn.ManagedClientConnectionImpl#50d3bf39
Exception in thread "main" org.apache.http.NoHttpResponseException: The target server failed to respond
at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:143)
at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:57)
at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:260)
at org.apache.http.impl.AbstractHttpClientConnection.receiveResponseHeader(AbstractHttpClientConnection.java:283)
at org.apache.http.impl.conn.DefaultClientConnection.receiveResponseHeader(DefaultClientConnection.java:251)
at org.apache.http.impl.conn.ManagedClientConnectionImpl.receiveResponseHeader(ManagedClientConnectionImpl.java:197)
at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:271)
at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:123)
at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:682)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:486)
at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:863)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:57)
at groovyx.net.http.HTTPBuilder.doRequest(HTTPBuilder.java:476)
at groovyx.net.http.HTTPBuilder.post(HTTPBuilder.java:359)
at groovyx.net.http.HTTPBuilder$post.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:110)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:130)
at com.spidasoftware.engine.api.v1.serializers.MongoLoader.postToDatabase(MongoLoader.groovy:180)
at com.spidasoftware.engine.api.v1.serializers.MongoLoader$postToDatabase$1.callStatic(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallStatic(CallSiteArray.java:53)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:191)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:219)
at com.spidasoftware.engine.api.v1.serializers.MongoLoader.sortClientItems(MongoLoader.groovy:99)
at com.spidasoftware.engine.api.v1.serializers.MongoLoader$sortClientItems$0.callStatic(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallStatic(CallSiteArray.java:53)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:191)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:227)
at com.spidasoftware.engine.api.v1.serializers.MongoLoader.parseJSONString(MongoLoader.groovy:76)
at com.spidasoftware.engine.api.v1.serializers.MongoLoader$parseJSONString.callStatic(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallStatic(CallSiteArray.java:53)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:191)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:219)
at com.spidasoftware.engine.api.v1.serializers.MongoLoader.main(MongoLoader.groovy:45)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
For whatever reason, it seems like the program likes to close the connection before it even makes the post. Any suggestions?
I think you are using the wrong port number for mongodb use 28017 according to http://docs.mongodb.org/ecosystem/tools/http-interfaces/