InseeFrLab / legacy-onyxia-entrypoint

🔬 A data science oriented container launcher
MIT License
69 stars 3 forks source link

Helm default installation not working #29

Closed sebastien-prudhomme closed 2 years ago

sebastien-prudhomme commented 2 years ago

Hi,

When launching with the default following command (version 3.0.0 of the chart)

helm install onyxia inseefrlab/onyxia --set ingress.enabled=true --set ingress.hosts[0].host=datalab.yourdomain.com

Error in the API pod:

2022-01-10 17:16:39.478  INFO 1 --- [           main] fr.insee.onyxia.api.Application          : Starting Application vmaster using Java 17.0.1 on onyxia-api-576689d8b9-q7dj4 with PID 1 (/app.jar started by root in /)
2022-01-10 17:16:39.480  INFO 1 --- [           main] fr.insee.onyxia.api.Application          : No active profile set, falling back to default profiles: default
2022-01-10 17:16:39.935  INFO 1 --- [           main] o.s.c.a.ConfigurationClassParser         : Properties location [classpath:regions-default.json] not resolvable: class path resource [regions-default.json] cannot be opened because it does not exist
2022-01-10 17:16:39.938  INFO 1 --- [           main] o.s.c.a.ConfigurationClassParser         : Properties location [classpath:catalogs-default.json] not resolvable: class path resource [catalogs-default.json] cannot be opened because it does not exist
2022-01-10 17:16:40.354  WARN 1 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.support.BeanDefinitionOverrideException: Invalid bean definition with name 'getUserProvider' defined in class path resource [fr/insee/onyxia/api/security/NoSecurityConfiguration.class]: Cannot register bean definition [Root bean: class [null]; scope=; abstract=false; lazyInit=null; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=noSecurityConfiguration; factoryMethodName=getUserProvider; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [fr/insee/onyxia/api/security/NoSecurityConfiguration.class]] for bean 'getUserProvider': There is already [Root bean: class [null]; scope=; abstract=false; lazyInit=null; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=keycloakUserProvider; factoryMethodName=getUserProvider; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [fr/insee/onyxia/api/security/KeycloakUserProvider.class]] bound.
2022-01-10 17:16:40.370  INFO 1 --- [           main] ConditionEvaluationReportLoggingListener : 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2022-01-10 17:16:40.402 ERROR 1 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
APPLICATION FAILED TO START
***************************

Description:

The bean 'getUserProvider', defined in class path resource [fr/insee/onyxia/api/security/NoSecurityConfiguration.class], could not be registered. A bean with that name has already been defined in class path resource [fr/insee/onyxia/api/security/KeycloakUserProvider.class] and overriding is disabled.

Action:

Consider renaming one of the beans or enabling overriding by setting spring.main.allow-bean-definition-overriding=true   
olevitt commented 2 years ago

Hi ! Thanks for this report. I think it may be related to the recent changes to the API, probably https://github.com/InseeFrLab/onyxia-api/commit/8fe86d776cd5b36a915ac30420f1e9348a237cdf
As a quick workaround, you can pin the onyxia-api version to v0.8 which is stable and was released december 1 (by default, the chart uses the latest tag which can be unstable). You can do so in the api.image.version field of the values.yaml file. See https://github.com/InseeFrLab/helm-charts/blob/b4539c8e0e4fe8be00aa2f4b405de7dbc8107437/charts/onyxia/values.yaml#L79 I will take a look at the API code and hopefully push a fix for it.

Thanks again for your report 👍

sebastien-prudhomme commented 2 years ago

@olevitt thanks, it works!

olevitt commented 2 years ago

@sebastien-prudhomme FYI, the bug has been fixed on Onyxia-api master branch. You can now use the tag latest and get rid of the workaround if you want to.