Skip to content
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

[Ingest Manager] [DRAFT] POST /setup can crash #74125

Closed

Conversation

jfsiii
Copy link
Contributor

@jfsiii jfsiii commented Aug 3, 2020

WIP PR only to get CI & merge upstream

get EPM packages behaves as expected

curl  http://localhost:5601/api/ingest_manager/epm/packages --user elastic:changeme
{"statusCode":500,"error":"Internal Server Error","message":"Error connecting to package registry at http://localhost:9999/search: request to http://localhost:9999/search failed, reason: connect ECONNREFUSED 127.0.0.1:9999"}
server    log   [17:10:12.499] [info][server][Kibana][http] http server running at http://0.0.0.0:5601
fetchUrl http://localhost:9999/search
getResponseStream before http://localhost:9999/search
registry#getResponse try http://localhost:9999/search
registry#getResponse catch http://localhost:9999/search
server   error  [17:10:14.470]  Error: Internal Server Error
    at HapiResponseAdapter.toError (/Users/jfsiii/work/kibana/src/core/server/http/router/response_adapter.ts:129:19)
    at HapiResponseAdapter.toHapiResponse (/Users/jfsiii/work/kibana/src/core/server/http/router/response_adapter.ts:79:19)
    at HapiResponseAdapter.handle (/Users/jfsiii/work/kibana/src/core/server/http/router/response_adapter.ts:74:17)
    at Router.handle (/Users/jfsiii/work/kibana/src/core/server/http/router/router.ts:273:34)
    at process._tickCallback (internal/process/next_tick.js:68:7)

but crashes with POST to /setup while no registry

curl -X POST 'http://localhost:5601/api/ingest_manager/setup' -H 'kbn-xsrf: <string>' --user elastic:changeme
{"isInitialized":true}

server / console Logs

handler try await setupIngestManager
setupIngestManager
setupIngestManager try/catch await Promise.all default packages, output, agent config, etc
ensureInstalledDefaultPackages return 2
installLatestPackage try/catch system
fetchFindLatestPackage try system calls fetchUrl http://localhost:9999/search?package=system&internal=true&experimental=true
fetchUrl http://localhost:9999/search?package=system&internal=true&experimental=true
getResponseStream before http://localhost:9999/search?package=system&internal=true&experimental=true
registry#getResponse try http://localhost:9999/search?package=system&internal=true&experimental=true
installLatestPackage try/catch endpoint
fetchFindLatestPackage try endpoint calls fetchUrl http://localhost:9999/search?package=endpoint&internal=true&experimental=true
fetchUrl http://localhost:9999/search?package=endpoint&internal=true&experimental=true
getResponseStream before http://localhost:9999/search?package=endpoint&internal=true&experimental=true
registry#getResponse try http://localhost:9999/search?package=endpoint&internal=true&experimental=true
registry#getResponse catch http://localhost:9999/search?package=system&internal=true&experimental=true
installLatestPackage catch { RegistryError: Error connecting to package registry at http://localhost:9999/search?package=system&internal=true&experimental=true: request to http://localhost:9999/search?package=system&internal=true&experimental=true failed, reason: connect ECONNREFUSED 127.0.0.1:9999
    at getResponse (/Users/jfsiii/work/kibana/x-pack/plugins/ingest_manager/server/services/epm/registry/requests.ts:26:11)
    at process._tickCallback (internal/process/next_tick.js:68:7) name: 'RegistryError' }
setupIngestManager catch & call onSetupReject { RegistryError: Error connecting to package registry at http://localhost:9999/search?package=system&internal=true&experimental=true: request to http://localhost:9999/search?package=system&internal=true&experimental=true failed, reason: connect ECONNREFUSED 127.0.0.1:9999
    at getResponse (/Users/jfsiii/work/kibana/x-pack/plugins/ingest_manager/server/services/epm/registry/requests.ts:26:11)
    at process._tickCallback (internal/process/next_tick.js:68:7) name: 'RegistryError' }
ingestManagerSetupHandler await success undefined
Unhandled Promise rejection detected:

{ RegistryError: Error connecting to package registry at http://localhost:9999/search?package=system&internal=true&experimental=true: request to http://localhost:9999/search?package=system&internal=true&experimental=true failed, reason: connect ECONNREFUSED 127.0.0.1:9999
    at getResponse (/Users/jfsiii/work/kibana/x-pack/plugins/ingest_manager/server/services/epm/registry/requests.ts:26:11)
    at process._tickCallback (internal/process/next_tick.js:68:7) name: 'RegistryError' }

Terminating process...
 server crashed  with status code 1

Summary

Summarize your PR. If it involves visual changes include a screenshot or gif.

Checklist

Delete any items that are not applicable to this PR.

For maintainers

get EPM packages behaves as expected

```
curl  http://localhost:5601/api/ingest_manager/epm/packages --user elastic:changeme
{"statusCode":500,"error":"Internal Server Error","message":"Error connecting to package registry at http://localhost:9999/search: request to http://localhost:9999/search failed, reason: connect ECONNREFUSED 127.0.0.1:9999"}
```

```
server    log   [17:10:12.499] [info][server][Kibana][http] http server running at http://0.0.0.0:5601
fetchUrl http://localhost:9999/search
getResponseStream before http://localhost:9999/search
registry#getResponse try http://localhost:9999/search
registry#getResponse catch http://localhost:9999/search
server   error  [17:10:14.470]  Error: Internal Server Error
    at HapiResponseAdapter.toError (/Users/jfsiii/work/kibana/src/core/server/http/router/response_adapter.ts:129:19)
    at HapiResponseAdapter.toHapiResponse (/Users/jfsiii/work/kibana/src/core/server/http/router/response_adapter.ts:79:19)
    at HapiResponseAdapter.handle (/Users/jfsiii/work/kibana/src/core/server/http/router/response_adapter.ts:74:17)
    at Router.handle (/Users/jfsiii/work/kibana/src/core/server/http/router/router.ts:273:34)
    at process._tickCallback (internal/process/next_tick.js:68:7)
```

but crashes with POST to /setup while no registry

```
curl -X POST 'http://localhost:5601/api/ingest_manager/setup' -H 'kbn-xsrf: <string>' --user elastic:changeme
{"isInitialized":true}
```

server / console Logs

```
handler try await setupIngestManager
setupIngestManager
setupIngestManager try/catch await Promise.all default packages, output, agent config, etc
ensureInstalledDefaultPackages return 2
installLatestPackage try/catch system
fetchFindLatestPackage try system calls fetchUrl http://localhost:9999/search?package=system&internal=true&experimental=true
fetchUrl http://localhost:9999/search?package=system&internal=true&experimental=true
getResponseStream before http://localhost:9999/search?package=system&internal=true&experimental=true
registry#getResponse try http://localhost:9999/search?package=system&internal=true&experimental=true
installLatestPackage try/catch endpoint
fetchFindLatestPackage try endpoint calls fetchUrl http://localhost:9999/search?package=endpoint&internal=true&experimental=true
fetchUrl http://localhost:9999/search?package=endpoint&internal=true&experimental=true
getResponseStream before http://localhost:9999/search?package=endpoint&internal=true&experimental=true
registry#getResponse try http://localhost:9999/search?package=endpoint&internal=true&experimental=true
registry#getResponse catch http://localhost:9999/search?package=system&internal=true&experimental=true
installLatestPackage catch { RegistryError: Error connecting to package registry at http://localhost:9999/search?package=system&internal=true&experimental=true: request to http://localhost:9999/search?package=system&internal=true&experimental=true failed, reason: connect ECONNREFUSED 127.0.0.1:9999
    at getResponse (/Users/jfsiii/work/kibana/x-pack/plugins/ingest_manager/server/services/epm/registry/requests.ts:26:11)
    at process._tickCallback (internal/process/next_tick.js:68:7) name: 'RegistryError' }
setupIngestManager catch & call onSetupReject { RegistryError: Error connecting to package registry at http://localhost:9999/search?package=system&internal=true&experimental=true: request to http://localhost:9999/search?package=system&internal=true&experimental=true failed, reason: connect ECONNREFUSED 127.0.0.1:9999
    at getResponse (/Users/jfsiii/work/kibana/x-pack/plugins/ingest_manager/server/services/epm/registry/requests.ts:26:11)
    at process._tickCallback (internal/process/next_tick.js:68:7) name: 'RegistryError' }
ingestManagerSetupHandler await success undefined
Unhandled Promise rejection detected:

{ RegistryError: Error connecting to package registry at http://localhost:9999/search?package=system&internal=true&experimental=true: request to http://localhost:9999/search?package=system&internal=true&experimental=true failed, reason: connect ECONNREFUSED 127.0.0.1:9999
    at getResponse (/Users/jfsiii/work/kibana/x-pack/plugins/ingest_manager/server/services/epm/registry/requests.ts:26:11)
    at process._tickCallback (internal/process/next_tick.js:68:7) name: 'RegistryError' }

Terminating process...
 server crashed  with status code 1
 ```
@jfsiii
Copy link
Contributor Author

jfsiii commented Aug 3, 2020

@elasticmachine merge upstream master

@kibanamachine
Copy link
Contributor

kibanamachine commented Aug 3, 2020

💔 Build Failed

Failed CI Steps

Build metrics

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@jfsiii
Copy link
Contributor Author

jfsiii commented Aug 4, 2020

closing in favor of #74300

@jfsiii jfsiii closed this Aug 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants