elasticsearch-HQ
elasticsearch-HQ copied to clipboard
ValueError: invalid literal for boolean. Not a string. on connection to ES 7.4.0
General information
- Windows:
- 3.5.12:
- 7.4.0 OSS:
- 3.6:
- Chrome 78:
Issue Description
Steps:
- install ElasticSearch-HQ v.3.5.12 on Windows for local ES 7.4.0 OSS with no security
- open ElasticSearch-HQ WeebUI on http://localhost:5000/
- click Connect to http://localhost:9200 and got next error:
Message: 'Unable to create connection to: http://localhost:9200'
Arguments: (ValueError('invalid literal for boolean. Not a string.',),)
but I am able to get info from my ES instance on http://localhost:9200/ in Chrome browser
{
"name" : "TEST",
"cluster_name" : "TEST",
"cluster_uuid" : "R3Iisp2yRoudlGtpHU8mAw",
"version" : {
"number" : "7.4.0",
"build_flavor" : "oss",
"build_type" : "zip",
"build_hash" : "22e1767283e61a198cb4db791ea66e3f11ab9910",
"build_date" : "2019-09-27T08:36:48.569419Z",
"build_snapshot" : false,
"lucene_version" : "8.2.0",
"minimum_wire_compatibility_version" : "6.8.0",
"minimum_index_compatibility_version" : "6.0.0-beta1"
},
"tagline" : "You Know, for Search"
}
Source Code / Logs
2019-12-03 05:32:49,616 ERROR elastichq exceptions._request_wrapper:37 Oops! Something bad happened.
Traceback (most recent call last):
File "C:\elasticsearch-HQ\elastichq\common\exceptions.py", line 29, in _request_wrapper
return functor(*args, **kwargs)
File "C:\elasticsearch-HQ\elastichq\api\clusters.py", line 129, in post
client_cert=client_cert)
File "C:\elasticsearch-HQ\elastichq\service\ConnectionService.py", line 174, in create_connection
raise ex
File "C:\elasticsearch-HQ\elastichq\service\ConnectionService.py", line 58, in create_connection
verify_certs = string_to_bool(verify_certs)
File "C:\elasticsearch-HQ\elastichq\common\utils.py", line 13, in string_to_bool
raise ValueError('invalid literal for boolean. Not a string.')
ValueError: invalid literal for boolean. Not a string.
2019-12-03 05:32:51,343 DEBUG elastichq status.get:63 {"name": "ElasticHQ", "installed_version": "3.5.12", "current_stable_version": "3.5.12", "tagline": "You know, for Elasticsearch", "clusters": [], "default_url": null}
Same with elasticsearch 6.8.5 Cluster is started and I can see info on stats/health/recovery. I start elasticsearchHQ --- http://servername:9200
It just cannot build the connection to the string I submitted -- dying in create_connection (ConnectionService.py line:58) in the call to string_to_bool.
Question -- why is a passed boolean value (verify_certs) being passed to a string_to_bool() function that tests is the value passed is some kind of true/t/True/true/false/False/fal type string?
Its a boolean value already!
commented out lines 58-59 ... since the values were already boolean
works fine
How are you installing/running HQ? The reason this was added was because when you run in a docker container, the ENV args come in as strings. When command line, they come in as booleans, as you noted.