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

Application throws "Configuration validation failed" exception for service-binded properties #34759

Closed
fedinskiy opened this issue Jul 14, 2023 · 2 comments · Fixed by #34792
Closed
Labels
area/kubernetes kind/bug Something isn't working
Milestone

Comments

@fedinskiy
Copy link
Contributor

Describe the bug

I have an application, which uses service binding and requires postgress, deployed by crunchydata operator. When I deploy the app on the Openshift via extension, it fails to start with "Configuration validation failed" exception, but only if use 999-SNAPOSHOT Quarkus build

Expected behavior

The application should start successfully, same as for 3.1.0.Final and 3.2.0.Final

Actual behavior

The pod crash-loops and logs contain this exception:

java.lang.RuntimeException: Failed to start quarkus
	at io.quarkus.runner.ApplicationImpl.doStart(Unknown Source)
	at io.quarkus.runtime.Application.start(Application.java:101)
	at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:111)
	at io.quarkus.runtime.Quarkus.run(Quarkus.java:71)
	at io.quarkus.runtime.Quarkus.run(Quarkus.java:44)
	at io.quarkus.runtime.Quarkus.run(Quarkus.java:124)
	at io.quarkus.runner.GeneratedMain.main(Unknown Source)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at io.quarkus.bootstrap.runner.QuarkusEntryPoint.doRun(QuarkusEntryPoint.java:61)
	at io.quarkus.bootstrap.runner.QuarkusEntryPoint.main(QuarkusEntryPoint.java:32)
Caused by: io.smallrye.config.ConfigValidationException: Configuration validation failed:
	SRCFG00050: quarkus.kubernetes-service-binding.services.postgresql.name in io.smallrye.config.ConfigSourceContext$ConfigSourceContextConfigSource does not map to any root
	SRCFG00050: quarkus.kubernetes-service-binding.services.postgresql.api-version in io.smallrye.config.ConfigSourceContext$ConfigSourceContextConfigSource does not map to any root
	SRCFG00050: quarkus.kubernetes-service-binding.services.postgresql.kind in io.smallrye.config.ConfigSourceContext$ConfigSourceContextConfigSource does not map to any root
	at io.smallrye.config.ConfigMappingProvider.mapConfigurationInternal(ConfigMappingProvider.java:1001)
	at io.smallrye.config.ConfigMappingProvider.lambda$mapConfiguration$3(ConfigMappingProvider.java:957)
	at io.smallrye.config.SecretKeys.doUnlocked(SecretKeys.java:28)
	at io.smallrye.config.ConfigMappingProvider.mapConfiguration(ConfigMappingProvider.java:957)
	at io.smallrye.config.ConfigMappings.mapConfiguration(ConfigMappings.java:91)
	at io.smallrye.config.SmallRyeConfigBuilder.build(SmallRyeConfigBuilder.java:630)
	at io.smallrye.config.ConfigSourceFactory$ConfigurableConfigSourceFactory.getConfigSources(ConfigSourceFactory.java:54)
	at io.smallrye.config.ConfigurableConfigSource.getConfigSources(ConfigurableConfigSource.java:50)
	at io.smallrye.config.SmallRyeConfig$ConfigSources.mapLateSources(SmallRyeConfig.java:669)
	at io.smallrye.config.SmallRyeConfig$ConfigSources.<init>(SmallRyeConfig.java:553)
	at io.smallrye.config.SmallRyeConfig.<init>(SmallRyeConfig.java:69)
	at io.smallrye.config.SmallRyeConfigBuilder.build(SmallRyeConfigBuilder.java:629)
	at io.quarkus.runtime.generated.Config.readConfig(Unknown Source)
	at io.quarkus.deployment.steps.RuntimeConfigSetup.deploy(Unknown Source)
	... 13 more

How to Reproduce?

  1. Clone the reproducer git clone https://github.com/fedinskiy/reproducer -b postgres-cluster-properties
  2. Create new project on kubernetes: oc new-project fd-postgres
  3. Verify, that Crunchy operator is installed:
$ oc get csv
NAME                              DISPLAY                           VERSION   REPLACES                          PHASE
datagrid-operator.v8.4.6          Data Grid                         8.4.6     datagrid-operator.v8.4.5          Succeeded
postgresoperator.v5.4.0           Crunchy Postgres for Kubernetes   5.4.0     postgresoperator.v5.3.0           Succeeded
serverless-operator.v1.29.0       Red Hat OpenShift Serverless      1.29.0    serverless-operator.v1.28.0       Succeeded
service-binding-operator.v1.3.3   Service Binding Operator          1.3.3     service-binding-operator.v1.3.1   Succeeded
  1. Create postgres cluster: oc apply -f pg-cluster.yml
  2. Wait for cluster to start: oc wait --for condition=Ready --timeout=300s pods --all
  3. Deploy the app: mvn package -Dquarkus.kubernetes.deploy=true -Dquarkus.openshift.expose=true -Dquarkus.openshift.route.expose=true -Dquarkus.kubernetes-client.trust-certs=true -Dquarkus.openshift.build-strategy=docker -Dquarkus.openshift.base-jvm-image=registry.access.redhat.com/ubi8/openjdk-17:latest -Dquarkus.platform.version=999-SNAPSHOT -Dquarkus.platform.group-id=io.quarkus
  4. Check deployments:
$ oc get pods
NAME                      READY   STATUS             RESTARTS      AGE
hippo-backup-b8f9-mmmhq   0/1     Completed          0             3m5s
hippo-instance1-4nbf-0    4/4     Running            0             3m22s
hippo-repo-host-0         2/2     Running            0             3m22s
theapp-1-build            0/1     Completed          0             2m5s
theapp-1-deploy           0/1     Completed          0             48s
theapp-1-zq2q6            0/1     CrashLoopBackOff   2 (22s ago)   45s
  1. Check logs: oc logs theapp-1-zq2q6 (results above)
  2. If started using command mvn package -Dquarkus.kubernetes.deploy=true -Dquarkus.openshift.expose=true -Dquarkus.openshift.route.expose=true -Dquarkus.kubernetes-client.trust-certs=true -Dquarkus.openshift.build-strategy=docker -Dquarkus.openshift.base-jvm-image=registry.access.redhat.com/ubi8/openjdk-17:latest -Dquarkus.platform.version=3.2.0.Final the application starts successfully.

Output of uname -a or ver

6.3.8-200.fc38.x86_64

Output of java -version

17.0.5, vendor: GraalVM Community

GraalVM version (if different from Java)

No response

Quarkus version or git rev

1a9a20d

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.8.7 (b89d5959fcde851dcb1c8946a785a163f14e1e29)

Additional information

$ oc version
Client Version: 4.13.0-202305312300.p0.g05d83ef.assembly.stream-05d83ef
Kustomize Version: v4.5.7
Kubernetes Version: v1.26.5+7d22122
@fedinskiy fedinskiy added the kind/bug Something isn't working label Jul 14, 2023
@quarkus-bot
Copy link

quarkus-bot bot commented Jul 14, 2023

/cc @Sgitario (kubernetes), @geoand (kubernetes,openshift), @iocanel (kubernetes,openshift)

@fedinskiy fedinskiy changed the title Configuration validation fails on the lastest snapshot "Configuration validation fails" for service-binded properties Jul 14, 2023
@fedinskiy fedinskiy changed the title "Configuration validation fails" for service-binded properties Application throws "Configuration validation failed" exception for service-binded properties Jul 14, 2023
@geoand
Copy link
Contributor

geoand commented Jul 14, 2023

cc @radcortez

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/kubernetes kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants