If user has special characters such as '#', '/', '!' and others, then elastalert-server docker container cannot handle these characters in the URL path with the status code ERR_INVALID_URL
praecoapp/praeco: 1.8.16
praecoapp/elastalert-server: 20231126
Error in elastalert-server:
elastalert_1 | TypeError: Invalid URL
elastalert_1 | at new NodeError (node:internal/errors:387:5)
elastalert_1 | at URL.onParseError (node:internal/url:565:9)
elastalert_1 | at new URL (node:internal/url:641:5)
elastalert_1 | at dispatchHttpRequest (/opt/elastalert-server/node_modules/axios/lib/adapters/http.js:219:20)
elastalert_1 | at /opt/elastalert-server/node_modules/axios/lib/adapters/http.js:143:5
elastalert_1 | at new Promise (<anonymous>)
elastalert_1 | at wrapAsync (/opt/elastalert-server/node_modules/axios/lib/adapters/http.js:123:10)
elastalert_1 | at http (/opt/elastalert-server/node_modules/axios/lib/adapters/http.js:161:10)
elastalert_1 | at Axios.dispatchRequest (/opt/elastalert-server/node_modules/axios/lib/core/dispatchRequest.js:51:10)
elastalert_1 | at Axios.request (/opt/elastalert-server/node_modules/axios/lib/core/Axios.js:146:33)
elastalert_1 | at Axios.<computed> [as get] (/opt/elastalert-server/node_modules/axios/lib/core/Axios.js:172:17)
elastalert_1 | at Function.get (/opt/elastalert-server/node_modules/axios/lib/helpers/bind.js:5:15)
elastalert_1 | at getClientVersion (/opt/elastalert-server/src/common/elasticsearch_client.js:86:19)
elastalert_1 | at metadataElastalertHandler (/opt/elastalert-server/src/handlers/metadata/get.js:101:46)
elastalert_1 | at Layer.handle [as handle_request] (/opt/elastalert-server/node_modules/express/lib/router/layer.js:95:5)
elastalert_1 | at next (/opt/elastalert-server/node_modules/express/lib/router/route.js:144:13)
elastalert_1 | at Route.dispatch (/opt/elastalert-server/node_modules/express/lib/router/route.js:114:3)
elastalert_1 | at Layer.handle [as handle_request] (/opt/elastalert-server/node_modules/express/lib/router/layer.js:95:5)
elastalert_1 | at /opt/elastalert-server/node_modules/express/lib/router/index.js:284:15
elastalert_1 | at Function.process_params (/opt/elastalert-server/node_modules/express/lib/router/index.js:346:12)
elastalert_1 | at next (/opt/elastalert-server/node_modules/express/lib/router/index.js:280:10)
elastalert_1 | at urlencodedParser (/opt/elastalert-server/node_modules/body-parser/lib/types/urlencoded.js:91:7)
elastalert_1 | at Layer.handle [as handle_request] (/opt/elastalert-server/node_modules/express/lib/router/layer.js:95:5)
elastalert_1 | at trim_prefix (/opt/elastalert-server/node_modules/express/lib/router/index.js:328:13)
elastalert_1 | at /opt/elastalert-server/node_modules/express/lib/router/index.js:286:9
elastalert_1 | at Function.process_params (/opt/elastalert-server/node_modules/express/lib/router/index.js:346:12)
elastalert_1 | at next (/opt/elastalert-server/node_modules/express/lib/router/index.js:280:10)
elastalert_1 | at jsonParser (/opt/elastalert-server/node_modules/body-parser/lib/types/json.js:110:7)
elastalert_1 | at Layer.handle [as handle_request] (/opt/elastalert-server/node_modules/express/lib/router/layer.js:95:5)
elastalert_1 | at trim_prefix (/opt/elastalert-server/node_modules/express/lib/router/index.js:328:13)
elastalert_1 | at /opt/elastalert-server/node_modules/express/lib/router/index.js:286:9
elastalert_1 | at Function.process_params (/opt/elastalert-server/node_modules/express/lib/router/index.js:346:12)
elastalert_1 | at next (/opt/elastalert-server/node_modules/express/lib/router/index.js:280:10)
elastalert_1 | at cors (/opt/elastalert-server/node_modules/cors/lib/index.js:188:7)
elastalert_1 | at /opt/elastalert-server/node_modules/cors/lib/index.js:224:17
elastalert_1 | at originCallback (/opt/elastalert-server/node_modules/cors/lib/index.js:214:15)
elastalert_1 | at /opt/elastalert-server/node_modules/cors/lib/index.js:219:13
elastalert_1 | at optionsCallback (/opt/elastalert-server/node_modules/cors/lib/index.js:199:9)
elastalert_1 | at corsMiddleware (/opt/elastalert-server/node_modules/cors/lib/index.js:204:7)
elastalert_1 | at Layer.handle [as handle_request] (/opt/elastalert-server/node_modules/express/lib/router/layer.js:95:5)
elastalert_1 | at trim_prefix (/opt/elastalert-server/node_modules/express/lib/router/index.js:328:13)
elastalert_1 | at /opt/elastalert-server/node_modules/express/lib/router/index.js:286:9
elastalert_1 | at Function.process_params (/opt/elastalert-server/node_modules/express/lib/router/index.js:346:12)
elastalert_1 | at next (/opt/elastalert-server/node_modules/express/lib/router/index.js:280:10)
elastalert_1 | at expressInit (/opt/elastalert-server/node_modules/express/lib/middleware/init.js:40:5)
elastalert_1 | at Layer.handle [as handle_request] (/opt/elastalert-server/node_modules/express/lib/router/layer.js:95:5)
elastalert_1 | at trim_prefix (/opt/elastalert-server/node_modules/express/lib/router/index.js:328:13)
elastalert_1 | at /opt/elastalert-server/node_modules/express/lib/router/index.js:286:9
elastalert_1 | at Function.process_params (/opt/elastalert-server/node_modules/express/lib/router/index.js:346:12)
elastalert_1 | at next (/opt/elastalert-server/node_modules/express/lib/router/index.js:280:10) {
elastalert_1 | input: 'https://elastalertuser:A#23!vsT2/@myelasticsearch.mydomain.com:9200',
elastalert_1 | code: 'ERR_INVALID_URL'
elastalert_1 | }
elastalert_1 | TypeError: Invalid URL
elastalert_1 | at new NodeError (node:internal/errors:387:5)
elastalert_1 | at URL.onParseError (node:internal/url:565:9)
elastalert_1 | at new URL (node:internal/url:641:5)
elastalert_1 | at dispatchHttpRequest (/opt/elastalert-server/node_modules/axios/lib/adapters/http.js:219:20)
elastalert_1 | at /opt/elastalert-server/node_modules/axios/lib/adapters/http.js:143:5
elastalert_1 | at new Promise (<anonymous>)
elastalert_1 | at wrapAsync (/opt/elastalert-server/node_modules/axios/lib/adapters/http.js:123:10)
elastalert_1 | at http (/opt/elastalert-server/node_modules/axios/lib/adapters/http.js:161:10)
elastalert_1 | at Axios.dispatchRequest (/opt/elastalert-server/node_modules/axios/lib/core/dispatchRequest.js:51:10)
elastalert_1 | at Axios.request (/opt/elastalert-server/node_modules/axios/lib/core/Axios.js:146:33)
elastalert_1 | at Axios.<computed> [as get] (/opt/elastalert-server/node_modules/axios/lib/core/Axios.js:172:17)
elastalert_1 | at Function.get (/opt/elastalert-server/node_modules/axios/lib/helpers/bind.js:5:15)
elastalert_1 | at getClientVersion (/opt/elastalert-server/src/common/elasticsearch_client.js:86:19)
elastalert_1 | at getClient (/opt/elastalert-server/src/common/elasticsearch_client.js:169:30)
elastalert_1 | at metadataElastalertHandler (/opt/elastalert-server/src/handlers/metadata/get.js:102:35)
elastalert_1 | at processTicksAndRejections (node:internal/process/task_queues:96:5) {
elastalert_1 | input: 'https://elastalertuser:A#23!vsT2/@myelasticsearch.mydomain.com:9200',
elastalert_1 | code: 'ERR_INVALID_URL'
elastalert_1 | }
elastalert_1 | TypeError: Cannot read properties of undefined (reading 'search')
elastalert_1 | at metadataElastalertHandler (/opt/elastalert-server/src/handlers/metadata/get.js:154:14)
elastalert_1 | at processTicksAndRejections (node:internal/process/task_queues:96:5)
🐛 Bug decsription
If user has special characters such as '#', '/', '!' and others, then elastalert-server docker container cannot handle these characters in the URL path with the status code ERR_INVALID_URL
praecoapp/praeco: 1.8.16
praecoapp/elastalert-server: 20231126
Error in elastalert-server:
👀 Steps to reproduce
docker-compose up
when in the praeco folder with Dockerfile and docker-compose.yml🆗 Expected behavior
Be able to include special characters in user's password. Karql's elastalert2-server works without problems with the same password.