line / line-fido2-server

FIDO2(WebAuthn) server officially certified by FIDO Alliance and Relying Party examples.
Apache License 2.0
515 stars 94 forks source link

fido2-server is not accept because Error creating bean with name 'embeddedRedisServerConfig': Invocation of init method failed; nested exception is java.lang.RuntimeException: Can't start redis server. #45

Closed subkaitaku closed 1 year ago

subkaitaku commented 1 year ago

Thank you for the great project. I would like to set up a fido2-server with M1 Macbook and Docker. I have followed the following steps to compose Docker but fido2-server does not start up because it seems not to start redis. I can access rp-server(:8080),but I can't access fido2-server(:8081). Is there anything I should set up?

$ docker build -t build-image .   
$ docker compose build
$ docker compose up
...
fido2-server  | Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
fido2-server  | 2023-06-19 14:59:13.785 ERROR 1 --- [           main] o.s.boot.SpringApplication               : Application run failed
fido2-server  | 
fido2-server  | org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'embeddedRedisServerConfig': Invocation of init method failed; nested exception is java.lang.RuntimeException: Can't start redis server. Check logs for details.
fido2-server  |     at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:160) ~[spring-beans-5.3.4.jar!/:5.3.4]
fido2-server  |     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:422) ~[spring-beans-5.3.4.jar!/:5.3.4]

Environment

Apple M1 Ventura 13.4 docker desktop 4.20.1

gebogebogebo commented 1 year ago

I had the same problem with my Apple M2, but the following measures solved the problem.

/server/Dockerfile

before -> Can't start redis server

FROM openjdk:8-jdk-slim

after

FROM --platform=linux/amd64 openjdk:8-jdk-slim
yedidyas commented 1 year ago

@gebogebogebo what a coincidence, I just had the same issue few minutes after you commented, that solved it. thanks

subkaitaku commented 1 year ago

@gebogebogebo Thank you! I was able to reproduce the same way and access the h2 console.

  1. fix /server/Dockerfile: FROM --platform=linux/amd64 openjdk:8-jdk-slim
  2. docker compose build
  3. docker compose up