tdeshpande
tdeshpande

Reputation: 1

How to fix "Your JWT secret key is not set up, you will not be able to log into the JHipster" during the startup of jhipster-registry container

I am trying to launch a microservice application with Jhipster. Each of my services are run in docker containers. When jhipster-registry is starting up, I receive this error:

2019-06-18 18:58:39.066  INFO 1 --- [           main] i.g.j.r.security.jwt.TokenProvider       : The JWT key used is not Base64-encoded. We recommend using the `jhipster.security.authentication.jwt.base64-secret` key for optimum security.
2019-06-18 18:58:39.067 ERROR 1 --- [           main] i.g.j.r.security.jwt.TokenProvider       :
----------------------------------------------------------
Your JWT secret key is not set up, you will not be able to log into the JHipster.
Please read the documentation at https://www.jhipster.tech/jhipster-registry/

This causes the jhipster-registry service to exit with a code of 1. However, my application.yml file currently contains a base-64 jwt secret key:

jhipster:
  security:
    authentication:
      jwt:
        base64-secret: MjNiZjdiNDk5MGM4MjE4ODI4YzRiNjZkOTRhNTU3YmNkMWRmMWYxMzkzYjAzMzI5OWI0MzNjNzVmZjg0ZDRkNDkwOTNkNjlmNjU4Zjc0NmEyYTQ3NzViMWIzZTliYjNkNjI5ZQ==

I am currently using the docker image jhipster/jhipster-registry:v5.0.1. I have tried using v5.0.2 and the error persists. I have also tried changing my application.yml to include an empty secret parameter like so, but this didn't result in any change.

secret:
base64-secret: MjNiZjdiNDk5MGM4MjE4ODI4YzRiNjZkOTRhNTU3YmNkMWRmMWYxMzkzYjAzMzI5OWI0MzNjNzVmZjg0ZDRkNDkwOTNkNjlmNjU4Zjc0NmEyYTQ3NzViMWIzZTliYjNkNjI5ZQ==

I also tried the solution suggested in How to fix Invalid JWT with JHipster Registry [Docker]? and it did not work for me. My docker-compose.yml and application.yml are exactly the same as the other people on my team and the registry service launches fine for them. How do I resolve this error?

EDIT: This started happening after I changed my Windows password.

Upvotes: 0

Views: 3526

Answers (2)

USQ91
USQ91

Reputation: 352

Go to your Docker Desktop settings and under Shared Drives see if you've selected the drives you want to share with Docker.

Upvotes: 0

bravenoob
bravenoob

Reputation: 83

Probably your Docker hasn't acces to the Filesystem where the config lies. In my case the Firewall was blocking the access.

Check your Docker Desktop installation:

Docker Desktop -> Settings -> Shared Drives -> Reset credentials -> re-enter your new data.

Upvotes: 1

Related Questions