[CI] Issue connecting to Elasticsearch on Jenkins on Windows
See original GitHub issueWhen running the tests on Jenkins on Windows, I see a random connection error when the tests try to connect to the Elasticsearch cluster. The test always seems to fail during node --unhandled-rejections=strict test\instrumentation\modules\elasticsearch.js
, but at different locations.
In each case, the error is something along the lines of:
TypeError [ERR_INVALID_URL] [ERR_INVALID_URL]: Invalid URL: http://:undefined/_search/template
This is the URL to the Elastichsearch cluster that somehow is “undefined”.
Here are two examples of such failures:
[2020-05-11T12:00:05.627Z] # client.ping with callback
[2020-05-11T12:00:05.627Z] internal/url.js:257
[2020-05-11T12:00:05.627Z] throw new ERR_INVALID_URL(input);
[2020-05-11T12:00:05.627Z] ^
[2020-05-11T12:00:05.627Z]
[2020-05-11T12:00:05.627Z] TypeError [ERR_INVALID_URL] [ERR_INVALID_URL]: Invalid URL: http://:undefined/
[2020-05-11T12:00:05.627Z] at onParseError (internal/url.js:257:9)
[2020-05-11T12:00:05.627Z] at new URL (internal/url.js:333:5)
[2020-05-11T12:00:05.627Z] at exports.parseUrl (C:\Users\jenkins\workspace\ejs_apm-agent-nodejs-mbp_PR-1743\src\github.com\elastic\apm-agent-nodejs\lib\parsers.js:247:10)
[2020-05-11T12:00:05.627Z] at exports.getHTTPDestination (C:\Users\jenkins\workspace\ejs_apm-agent-nodejs-mbp_PR-1743\src\github.com\elastic\apm-agent-nodejs\lib\instrumentation\context.js:14:48)
[2020-05-11T12:00:05.627Z] at IncomingMessage.onEnd (C:\Users\jenkins\workspace\ejs_apm-agent-nodejs-mbp_PR-1743\src\github.com\elastic\apm-agent-nodejs\lib\instrumentation\http-shared.js:212:38)
[2020-05-11T12:00:05.627Z] at IncomingMessage.elasticAPMCallbackWrapper (C:\Users\jenkins\workspace\ejs_apm-agent-nodejs-mbp_PR-1743\src\github.com\elastic\apm-agent-nodejs\lib\instrumentation\index.js:309:27)
[2020-05-11T12:00:05.627Z] at IncomingMessage.emit (events.js:322:22)
[2020-05-11T12:00:05.627Z] at endReadableNT (_stream_readable.js:1187:12)
[2020-05-11T12:00:05.627Z] at elasticAPMCallbackWrapper (C:\Users\jenkins\workspace\ejs_apm-agent-nodejs-mbp_PR-1743\src\github.com\elastic\apm-agent-nodejs\lib\instrumentation\index.js:309:27)
[2020-05-11T12:00:05.627Z] at processTicksAndRejections (internal/process/task_queues.js:84:21) {
[2020-05-11T12:00:05.627Z] input: 'http://:undefined/',
[2020-05-11T12:00:05.627Z] code: 'ERR_INVALID_URL'
[2020-05-11T12:00:05.627Z] }
[2020-05-11T12:00:05.627Z] C:\Users\jenkins\workspace\ejs_apm-agent-nodejs-mbp_PR-1743\src\github.com\elastic\apm-agent-nodejs\test\test.js:129
[2020-05-11T12:00:05.627Z] if (err) throw err
[2020-05-11T12:00:05.627Z] ^
[2020-05-11T12:00:05.627Z]
[2020-05-11T12:00:05.627Z] Error: non-zero error code
[2020-05-11T12:00:05.627Z] at ChildProcess.<anonymous> (C:\Users\jenkins\workspace\ejs_apm-agent-nodejs-mbp_PR-1743\src\github.com\elastic\apm-agent-nodejs\test\test.js:37:19)
[2020-05-11T12:00:05.627Z] at ChildProcess.emit (events.js:310:20)
[2020-05-11T12:00:05.627Z] at maybeClose (internal/child_process.js:1021:16)
[2020-05-11T12:00:05.627Z] at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) {
[2020-05-11T12:00:05.627Z] code: 'ENONZERO',
[2020-05-11T12:00:05.627Z] exitCode: 1
[2020-05-11T12:00:05.627Z] }
[2020-05-11T13:34:42.063Z] # client.searchTemplate with callback
[2020-05-11T13:34:42.063Z] internal/url.js:257
[2020-05-11T13:34:42.063Z] throw new ERR_INVALID_URL(input);
[2020-05-11T13:34:42.063Z] ^
[2020-05-11T13:34:42.063Z]
[2020-05-11T13:34:42.063Z] TypeError [ERR_INVALID_URL] [ERR_INVALID_URL]: Invalid URL: http://:undefined/_search/template
[2020-05-11T13:34:42.063Z] at onParseError (internal/url.js:257:9)
[2020-05-11T13:34:42.063Z] at new URL (internal/url.js:333:5)
[2020-05-11T13:34:42.063Z] at exports.parseUrl (C:\Users\jenkins\workspace\ejs_apm-agent-nodejs-mbp_PR-1743\src\github.com\elastic\apm-agent-nodejs\lib\parsers.js:247:10)
[2020-05-11T13:34:42.063Z] at exports.getHTTPDestination (C:\Users\jenkins\workspace\ejs_apm-agent-nodejs-mbp_PR-1743\src\github.com\elastic\apm-agent-nodejs\lib\instrumentation\context.js:14:48)
[2020-05-11T13:34:42.063Z] at IncomingMessage.onEnd (C:\Users\jenkins\workspace\ejs_apm-agent-nodejs-mbp_PR-1743\src\github.com\elastic\apm-agent-nodejs\lib\instrumentation\http-shared.js:212:38)
[2020-05-11T13:34:42.063Z] at IncomingMessage.elasticAPMCallbackWrapper (C:\Users\jenkins\workspace\ejs_apm-agent-nodejs-mbp_PR-1743\src\github.com\elastic\apm-agent-nodejs\lib\instrumentation\index.js:309:27)
[2020-05-11T13:34:42.063Z] at IncomingMessage.emit (events.js:322:22)
[2020-05-11T13:34:42.063Z] at endReadableNT (_stream_readable.js:1187:12)
[2020-05-11T13:34:42.063Z] at elasticAPMCallbackWrapper (C:\Users\jenkins\workspace\ejs_apm-agent-nodejs-mbp_PR-1743\src\github.com\elastic\apm-agent-nodejs\lib\instrumentation\index.js:309:27)
[2020-05-11T13:34:42.063Z] at processTicksAndRejections (internal/process/task_queues.js:84:21) {
[2020-05-11T13:34:42.063Z] input: 'http://:undefined/_search/template',
[2020-05-11T13:34:42.064Z] code: 'ERR_INVALID_URL'
[2020-05-11T13:34:42.064Z] }
[2020-05-11T13:34:42.064Z] C:\Users\jenkins\workspace\ejs_apm-agent-nodejs-mbp_PR-1743\src\github.com\elastic\apm-agent-nodejs\test\test.js:129
[2020-05-11T13:34:42.064Z] if (err) throw err
[2020-05-11T13:34:42.064Z] ^
[2020-05-11T13:34:42.064Z]
[2020-05-11T13:34:42.064Z] Error: non-zero error code
[2020-05-11T13:34:42.064Z] at ChildProcess.<anonymous> (C:\Users\jenkins\workspace\ejs_apm-agent-nodejs-mbp_PR-1743\src\github.com\elastic\apm-agent-nodejs\test\test.js:37:19)
[2020-05-11T13:34:42.064Z] at ChildProcess.emit (events.js:310:20)
[2020-05-11T13:34:42.064Z] at maybeClose (internal/child_process.js:1021:16)
[2020-05-11T13:34:42.064Z] at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) {
[2020-05-11T13:34:42.064Z] code: 'ENONZERO',
[2020-05-11T13:34:42.064Z] exitCode: 1
[2020-05-11T13:34:42.064Z] }
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Interpreting CI Failures | Kibana Guide [7.17] - Elastic
Interpreting CI Failuresedit ... Kibana CI uses a Jenkins feature called "Pipelines" to automate testing of the code in pull requests and on...
Read more >Elasticsearch Reporter - CloudBees Documentation
Elasticsearch Reporter is a set of Jenkins plugins that provides connectivity to remotely hosted Elasticsearch 6.x/7.x servers for CloudBees products ...
Read more >Jenkins "unable to find valid certification path to requested ...
That error is a common error message reported by the Java Virtual Machine. This is caused when the Java environment does not have...
Read more >Jenkins integration - GitLab Documentation
Error in merge requests - “Could not connect to the CI server” · Configure the Jenkins server for GitLab API access. · Configure...
Read more >Basic Implementation of ELK on Windows With Beats and ...
One of the problems with this tool stack is security. You need to manually attach a security layer if required. Like Kibana is...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m adding more debug logs in the pipeline to see what’s going on:
FWIW I haven’t seen an error like this in CI for over a year (I’ve never seen it myself). I’ll close for now. We can re-open or open new issues if there are Windows CI issues.