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

Error creating server tokens #4

Open
sganon opened this issue Dec 17, 2022 · 2 comments
Open

Error creating server tokens #4

sganon opened this issue Dec 17, 2022 · 2 comments
Assignees

Comments

@sganon
Copy link

sganon commented Dec 17, 2022

Hello,

While following the Getting Started tutorial for service discovery I've run into an issue on the step Create server tokens.

While running the scripts/generate_consul_server_tokens.sh I've run into some issues.

First of all the scripts uses a predefined WORKDIR sets to /home/app. While its not problematic per say, it's not explained in the documentation, so while running the tutorial in your own vm you'll likely run into permission denied issues.
Why not use $HOME for WORKDIR.

Secondly it's not explicit in the documentation that the acl-token-bootstrap.json should be located in the same directory of the script, but I reckon it's more an issues for the documentation than the script as the behaviour is sensible.

The real issue when was creating the token, with consul acl token create ... (L56), I've run into an Error! Missing TOKEN argument message. The message is not really clear, and that's normal because the stderr is redirected to /dev/null, which maybe should not ?
This issue was simply caused by the variable CONSUL_HTTP_ADDR being overwritten at the beggining of the script, it should use the same default behaviour as the other variables like: export CONSUL_HTTP_ADDR=${CONSUL_HTTP_ADDR:-"https://consul${FQDN_SUFFIX}:8443"} imo.

As I am learning about Consul I do not know if my workarounds is the correct solution, and it seems to me that's it more about the documentation not being up to date if you choosed to follow on your own vm. With that said if the workaround seems correct I'll be happy to make a PR in that way.

Thanks,

@danielehc
Copy link
Collaborator

Hi @sganon thanks for opening the issue report.

We pushed a new version of the scripts that should now solve the issue.
Please test it out and let us know if if works for you.

Thanks

@danielehc danielehc self-assigned this Dec 22, 2022
@sganon
Copy link
Author

sganon commented Dec 23, 2022

Everything seems ok to me the tokens were generated successfully, if the WORKDIR is set, which may be added to documentation ?

Thanks for your help :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants