This site is in read only mode. Please continue to browse, but replying, likes, and other actions are disabled for now.

⚠️ We've moved!

Hi there!

To reduce project dependency on 3rd party paid services the StackStorm TSC has decided to move the Q/A from this forum to Github Discussions. This will make user experience better integrated with the native Github flow, as well as the questions closer to the community where they can provide answers.

Use 🔗 Github Discussions to ask your questions.

Error setting datastore variable

I’m having trouble setting a datastore key/value. I’m logged into the st2client pod as st2admin and am doing the following:

st2 key set foo boo

and getting this error:

ERROR: 400 Client Error: Bad Request
MESSAGE: Extra data: line 1 column 5 - line 2 column 1 (char 4 - 19) for url: http://stackstorm-st2api:9101/keys/foo

Am I doing something that is obviously wrong?

Looking at logs, it seems to be throwing the following exception:

2021-01-04 19:22:15,825 INFO [-] abc5b97e-6ae8-4bf1-8303-50da40b79cfd - PUT /keys/foo with query={} (method=‘PUT’,path=’/keys/foo’,remote_addr=‘’,query={},request_id=‘abc5b97e-6ae8-4bf1-8303-50da40b79cfd’)
2021-01-04 19:22:15,832 ERROR [-] Failed to call controller function “put” for operation “st2api.controllers.v1.keyvalue:key_value_pair_controller.put”: Extra data: line 1 column 5 - line 2 column 1 (char 4 - 19)
Traceback (most recent call last):
File “/opt/stackstorm/st2/lib/python3.6/site-packages/st2common/”, line 516, in call
resp = func(**kw)
File “/opt/stackstorm/st2/lib/python3.6/site-packages/st2api/controllers/v1/”, line 292, in put
with self._coordinator.get_lock(lock_name):
File “/opt/stackstorm/st2/lib/python3.6/site-packages/tooz/”, line 52, in enter
acquired = self.acquire(*args, **kwargs)
File “/opt/stackstorm/st2/lib/python3.6/site-packages/tooz/drivers/”, line 132, in acquire
“prevExist”: “false”})
File “/opt/stackstorm/st2/lib/python3.6/site-packages/tooz/drivers/”, line 75, in put
return self.session.put(url, **kwargs).json()
File “/opt/stackstorm/st2/lib/python3.6/site-packages/requests/”, line 898, in json
return complexjson.loads(self.text, **kwargs)
File “/opt/stackstorm/st2/lib/python3.6/site-packages/simplejson/”, line 525, in loads
return _default_decoder.decode(s)
File “/opt/stackstorm/st2/lib/python3.6/site-packages/simplejson/”, line 373, in decode
raise JSONDecodeError(“Extra data”, s, end, len(s))
simplejson.errors.JSONDecodeError: Extra data: line 1 column 5 - line 2 column 1 (char 4 - 19)
2021-01-04 19:22:15,833 INFO [-] abc5b97e-6ae8-4bf1-8303-50da40b79cfd - 400 84 8.372ms (method=‘PUT’,path=’/keys/foo’,remote_addr=‘’,status=400,runtime=8.372,content_length=84,request_id=‘abc5b97e-6ae8-4bf1-8303-50da40b79cfd’)

Confirming it’s a bug specific to stackstorm-ha K8s/Helm environment.
Thanks for reporting it in Can't set datastore key/value pairs in 0.50.0 · Issue #167 · StackStorm/stackstorm-ha · GitHub.
Let’s track it there.