terascope / teraslice

Scalable data processing pipelines in JavaScript
https://terascope.github.io/teraslice/
Apache License 2.0
50 stars 13 forks source link

Fix asset_storage_connection default connection validation error #3578

Closed godber closed 5 months ago

godber commented 5 months ago

When testing the Teraslice v1.1.1 release we encountered an issue when starting a Teraslice master without asset_storage_connection or asset_storage_connection_type set. It threw this error.

/app/source/packages/terafoundation/dist/src/validate-configs.js:56
        throw new utils_1.TSError(err, { reason: 'Error validating configuration' });
              ^

TSError: Error validating configuration, caused by Error: asset_storage_connection: default not found in terafoundation.connectors.elasticsearch-next: value was "default"
    at validateConfig (/app/source/packages/terafoundation/dist/src/validate-configs.js:56:15)
    at validateConfigs (/app/source/packages/terafoundation/dist/src/validate-configs.js:92:29)
    at new ClusterContext (/app/source/packages/terafoundation/dist/src/cluster-context.js:45:58)
    at file:///app/source/packages/teraslice/service.js:45:5
    at ModuleJob.run (node:internal/modules/esm/module_job:195:25)
    at async ModuleLoader.import (node:internal/modules/esm/loader:336:24)
    at async importModuleDynamicallyWrapper (node:internal/vm/module:429:15) {
  fatalError: false,
  statusCode: 500,
  context: {},
  code: 'INTERNAL_SERVER_ERROR'
}

Node.js v18.19.1
godber commented 5 months ago

This is because there is no default connector in the elasticsearch-next section of the connectors of the terafoundation file.

If possible we should extend tests to include this case.