Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<ST2 on k8s> Unable to decrypt the secret values from data store when used in webhook. st2rulesengine not mounting "st2-encryption-key-vol" volume. #223

Closed
moti1992 opened this issue Jul 22, 2021 · 6 comments · Fixed by #224
Labels
bug Something isn't working Helm

Comments

@moti1992
Copy link
Contributor

Webhook rule under rules/:

---
name: "wb"
pack: "xxx"
description: "Sample webhook to remote cmd run"
enabled: true

trigger:
  type: "core.st2.webhook"
  parameters:
    url: remote
criteria:
  trigger.body.name:
    pattern: "run"
    type: "equals"
action:
  ref: "xxx.yyy"
  parameters:
    cmd: "{{trigger.body.cmd}}"

Getting the below error on rulesengine pod:

error: 'Failed to render parameter "username": [Errno 2] No such file or directory: ''/etc/st2/keys/datastore_key.json'''
  traceback: "  File "/opt/stackstorm/st2/lib/python3.6/site-packages/st2reactor/rules/enforcer.py", line 237, in _invoke_action
    additional_contexts=additional_contexts,
  File "/opt/stackstorm/st2/lib/python3.6/site-packages/st2reactor/rules/enforcer.py", line 83, in get_resolved_parameters
    additional_contexts=additional_contexts,
  File "/opt/stackstorm/st2/lib/python3.6/site-packages/st2common/util/param.py", line 334, in render_live_params
    context = _resolve_dependencies(G)
  File "/opt/stackstorm/st2/lib/python3.6/site-packages/st2common/util/param.py", line 242, in _resolve_dependencies
    raise ParamException(msg)
"
@cognifloyd
Copy link
Member

What version of the StackStorm-ha chart are you using?
What version of StackStorm?

@moti1992
Copy link
Contributor Author

I'm using the code pulled from master in the past month. Pulled from this Commit ID: 2f9d0c9

ST2 version:
st2 3.5.0, on Python 3.6.9

Moreover, I have tried mounting the datastore on st2rulesengine (below image) and it worked after that. Just wanted to confirm if its a right fix or not. Please review and let me know if further info needed.

Screenshot 2021-07-22 at 9 35 59 PM

@cognifloyd
Copy link
Member

Let's see. So right now we're adding a datastore_crypto_key volume in these deployments:

  • st2api
  • st2rulesengine
  • st2workflowengine
  • st2scheduler
  • st2sensorcontainer
  • st2actionrunner
  • st2client

But we're only mounting the volume in these:

  • st2api
  • st2workflowengine
  • st2scheduler
  • st2sensorcontainer
  • st2actionrunner
  • st2client

So, yes. We are missing the volumeMount for the st2rulesengine. Would you please submit a PR? Thanks for finding a fix for this!

@cognifloyd cognifloyd added bug Something isn't working Helm labels Jul 22, 2021
@moti1992
Copy link
Contributor Author

Sure I will raise a PR. Thanks for the confirmation.

@moti1992
Copy link
Contributor Author

moti1992 commented Jul 22, 2021

@cognifloyd getting this error when i tried to commit to new branch from master
ERROR: Permission to StackStorm/stackstorm-ha.git denied to moti1992.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.

Is there any permission required ?

UPDATE: please ignore this comment. Forgot to fork the repo.

@moti1992
Copy link
Contributor Author

@cognifloyd PR : #224

arm4b added a commit that referenced this issue Jul 27, 2021
Fix : mount datastore_cryto_key volumne on st2rulesengine deployment #223
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Helm
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants