[SOLVED] Could not fetch signing key for OpenID Connect

Hi, I am staring in ORY/Hydra, I am trying to set up the system following this tutorial I see that there they use a docker container for the postgres database, but I currently have a remote database server executing only postgres and some databases that I am using there. I want to set up the example but using my database server, I tried to set DATABASE_URL variable poitnting to my server and also deleting this line:

--link ory-hydra-example--postgres:postgres
from all the commands that are explained in the tutorial. But, now when I type docker logs ory-hydra-example--hydra I get these lines:

time="2017-07-20T21:24:14Z" level=info msg="Connecting with postgres://*:*@xxx.xxx.xxx.xxx:5432/hydra?sslmode=disable"
time="2017-07-20T21:24:15Z" level=info msg="Connected to SQL!"
Could not fetch signing key for OpenID Connect - did you forget to run "hydra migrate sql" or forget to set the SYSTEM_SECRET? Got error: cipher: message authentication failed

I also setted the SYSTEM_SECRET and I don’t think that is the real problem. So, anyone has this error before? how can I fix it?

Thank you very much!

Looks like you are running hydra against an existing database and are usig a wrong system secret. Try removing the database container and then regreating it. The system secret env var needs to be the same always, and always set. Dont leave it empty.

1 Like

Hi sredXNY,
I ran into the same issue before. After search the source code, I found that your secret_key has to be at least size of 16. My system worked after I redo the whole exercise with a longer secret key.
Hope this helps.
Wei