When you start Skedler Reports and if you see the following error in console or in skedler log (skedler.log):
- Cluster - number of CPU cores in your server 16
- Cluster - On Exit
- Cluster - Creating worker threads
- Server running at http://0.0.0.0:3000
- ********Checking for the configured Datastore********
- Skedler Config - Database type: Elasticsearch
- ES version - 7
- Kibana version - 7.0.1
- …
- Skedler Config - This Elasticsearch version is 7
- ServerInitialization - Skedler index created successfully
- ServerInitialization - Error in creating skedler config { Error: [illegal_argument_exception] Rejecting mapping update to [.skedler] as the final mapping would have more than 1 type: [_doc, skedlerdoc]
- at respond (/opt/skedler/node_modules/elasticsearch/src/lib/transport.js:315:23)
- at checkRespForFailure (/opt/skedler/node_modules/elasticsearch/src/lib/transport.js:274:13)
- at HttpConnector.<anonymous> (/opt/skedler/node_modules/elasticsearch/src/lib/connectors/http.js:159:7)
- at IncomingMessage.bound (/opt/skedler/node_modules/elasticsearch/node_modules/lodash/dist/lodash.js:729:21)
- at IncomingMessage.emit (events.js:194:15)
- at endReadableNT (_stream_readable.js:1103:12)
- at process._tickCallback (internal/process/next_tick.js:63:19)
- status: 400,
- displayName: 'BadRequest',
- message:
- '[illegal_argument_exception] Rejecting mapping update to [.skedler] as the final mapping would have more than 1 type: [_doc, skedlerdoc]',
- path: '/.skedler/skedlerdoc/version/_create',
- query: {},
- body:
- '{"version":"4.6.1","edition":"Basic","registrationstatus":""}',
- statusCode: 400,
- response:
- '{"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"Rejecting mapping update to [.skedler] as the final mapping would have more than 1 type: [_doc, skedlerdoc]"}],"type":"illegal_argument_exception","reason":"Rejecting mapping update to [.skedler] as the final mapping would have more than 1 type: [_doc, skedlerdoc]"},"status":400}',
- toString: [Function],
- toJSON: [Function] }
- checking for skedler index shards health
- Found skedler index
- Update Layer - get skedler version { Error: Not Found
- at respond (/opt/skedler/node_modules/elasticsearch/src/lib/transport.js:315:23)
- at checkRespForFailure (/opt/skedler/node_modules/elasticsearch/src/lib/transport.js:274:13)
- at HttpConnector.<anonymous> (/opt/skedler/node_modules/elasticsearch/src/lib/connectors/http.js:159:7)
- at IncomingMessage.bound (/opt/skedler/node_modules/elasticsearch/node_modules/lodash/dist/lodash.js:729:21)
- at IncomingMessage.emit (events.js:194:15)
- at endReadableNT (_stream_readable.js:1103:12)
- at process._tickCallback (internal/process/next_tick.js:63:19)
- status: 404,
- displayName: 'NotFound',
- message: 'Not Found',
- path: '/.skedler/skedlerdoc/version',
- query: {},
- body: undefined,
- statusCode: 404,
- response:
- '{"_index":".skedler","_type":"skedlerdoc","_id":"version","found":false}',
- toString: [Function],
- toJSON: [Function] }
- Exception TypeError: Cannot read property '_type' of undefined
- at recursiveIndex (eval at o9l (/opt/skedler/server/routes/updates.js:1:111561), <anonymous>:1:2047)
- at eval (eval at o9l (/opt/skedler/server/routes/updates.js:1:111561), <anonymous>:1:9238)
- at respond (/opt/skedler/node_modules/elasticsearch/src/lib/transport.js:334:17)
- at checkRespForFailure (/opt/skedler/node_modules/elasticsearch/src/lib/transport.js:274:13)
- at HttpConnector.<anonymous> (/opt/skedler/node_modules/elasticsearch/src/lib/connectors/http.js:159:7)
- at IncomingMessage.bound (/opt/skedler/node_modules/elasticsearch/node_modules/lodash/dist/lodash.js:729:21)
- at IncomingMessage.emit (events.js:194:15)
- at endReadableNT (_stream_readable.js:1103:12)
- at process._tickCallback (internal/process/next_tick.js:63:19)
Do the following to resolve this issue
It looks like when you're setting a template for .skedler index, on doing so, a type _doc is mapped to .skedler by default. Usually, we create an index with the type as skedlerdoc in Skedler. Since _doc is mapped already, we cannot create the index. Can you remove the template for .skedler and try again?
Or you can simply comment on the elasticsearch_url in reporting.yml and use internal DB for storing the metadata. By doing either one of these, you can bypass the issue.