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_API_KEY #233

Closed
ghost opened this issue Dec 7, 2021 · 6 comments · Fixed by #234
Closed

ST2_API_KEY #233

ghost opened this issue Dec 7, 2021 · 6 comments · Fixed by #234
Labels

Comments

@ghost
Copy link

ghost commented Dec 7, 2021

image

I want to know what is the ‘ST2_API_KEY’?
How do I get this value?

@arm4b arm4b added the question label Dec 7, 2021
@arm4b
Copy link
Member

arm4b commented Dec 7, 2021

See https://docs.stackstorm.com/authentication.html#api-keys documentation for the StackStorm API Keys.

stevemuskiewicz added a commit to stevemuskiewicz/st2-docker that referenced this issue Dec 7, 2021
@stevemuskiewicz
Copy link
Contributor

I'll push up a PR with a clarification in the README for this as well since I didn't initially mention it when I updated the docs, thanks for bringing it to attention. 🙂

@arm4b arm4b closed this as completed in #234 Dec 7, 2021
arm4b added a commit that referenced this issue Dec 7, 2021
…-apikey

clarify ST2_API_KEY requirement for chatops in README per #233
@ghost
Copy link
Author

ghost commented Dec 8, 2021

@armab @stevemuskiewicz Thank you for your answers, but I still have a few questions.

Problem Reproduction

MacBook-Pro-8:st2-docker shansxu$ docker-compose exec st2api bash
st2@717cd2824c84:/opt/stackstorm$ st2 apikey create -k -m'{"name": "sstest"}' 
ERROR: 401 Client Error: Unauthorized
MESSAGE: Unauthorized - One of Token or API key required. for url: http://st2api:9101/apikeys
st2@717cd2824c84:/opt/stackstorm$ st2 apikey create -k -m '{"used_by": "st2admin"}'
ERROR: 401 Client Error: Unauthorized
MESSAGE: Unauthorized - One of Token or API key required. for url: http://st2api:9101/apikeys

Was it an error? How do I create an ApiKey in Docker?

@stevemuskiewicz
Copy link
Contributor

@xxtaoqi first off, have you reviewed the Stackstorm docs to get an idea of how to use it? Specifically the quick start guide and also the docker install guide should be helpful here.

Also when you are running st2 commands with a docker install, you will want to connect to the st2client container, not to the st2api container. So try docker-compose exec st2client bash and see if that works better.

@ghost
Copy link
Author

ghost commented Dec 8, 2021

@stevemuskiewicz
The reason why I connected to the ST2API container is that it has failed inST2Client container.

MacBook-Pro-8:st2-docker shansxu$ docker-compose exec st2client bash
bash: /opt/stackstorm/st2/bin/python: No such file or directory
Welcome to StackStorm HA v (Ubuntu 18.04.6 LTS GNU/Linux x86_64)
 * Documentation: https://docs.stackstorm.com/
 * Community: https://stackstorm.com/community-signup
 * Forum: https://forum.stackstorm.com/

 Here you can use StackStorm CLI. Examples:
   st2 action list --pack=core
   st2 run core.local cmd=date
   st2 run core.local_sudo cmd='apt-get update' --tail
   st2 execution list


root@0f00c3584a52:/opt/stackstorm# st2 apikey create -k -m '{"used_by": "st2admin"}'
bash: st2: command not found
root@0f00c3584a52:/opt/stackstorm# 

@stevemuskiewicz
Copy link
Contributor

@xxtaoqi hmmm, this line in your output seems odd

bash: /opt/stackstorm/st2/bin/python: No such file or directory

Not sure but seems like something is messed up on your st2client container image... I don't know how that would normally happen but maybe worth trying to tear down the stack (docker-compose down --remove-orphans -v) and do a docker system prune -a to clear out the existing images and then try the docker-compose up -d again?

Also double check your version of docker is recent enough as detailed in the readme.

@ghost ghost mentioned this issue Dec 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants