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

OpenTelemetry Logs and Keycloak build steps cycle #45360

Closed
Malandril opened this issue Jan 3, 2025 · 8 comments
Closed

OpenTelemetry Logs and Keycloak build steps cycle #45360

Malandril opened this issue Jan 3, 2025 · 8 comments
Labels
area/keycloak area/kotlin area/tracing kind/bug Something isn't working triage/out-of-date This issue/PR is no longer valid or relevant

Comments

@Malandril
Copy link
Contributor

Malandril commented Jan 3, 2025

Describe the bug

When activating open telemetry logs and oidc with keycloak devservice in one project the build fails with cyclic dependencies.

aused by: io.quarkus.builder.ChainBuildException: Cycle detected:
                   io.quarkus.oidc.deployment.devservices.keycloak.KeycloakDevUIProcessor#produceProviderComponent produced class io.quarkus.arc.deployment.SyntheticBeanBuildItem
                to io.quarkus.arc.deployment.SyntheticBeansProcessor#initRuntime produced class io.quarkus.arc.deployment.BeanRegistrationPhaseBuildItem$BeanConfiguratorBuildItem
                to io.quarkus.arc.deployment.ArcProcessor#registerSyntheticObservers produced class io.quarkus.arc.deployment.ObserverRegistrationPhaseBuildItem
                to io.quarkus.arc.deployment.ArcProcessor#validate produced class io.quarkus.arc.deployment.ValidationPhaseBuildItem
                to io.quarkus.arc.deployment.ArcProcessor#validateAsyncObserverExceptionHandlers produced class io.quarkus.arc.deployment.ValidationPhaseBuildItem$ValidationErrorBuildItem
                to io.quarkus.arc.deployment.ArcProcessor#generateResources produced class io.quarkus.arc.deployment.ResourcesGeneratedPhaseBuildItem
                to io.quarkus.arc.deployment.ArcProcessor#initializeContainer produced class io.quarkus.arc.deployment.ArcContainerBuildItem
                to io.quarkus.arc.deployment.ArcProcessor#notifyBeanContainerListeners produced class io.quarkus.arc.deployment.PreBeanContainerBuildItem
                to io.quarkus.arc.deployment.ArcProcessor#signalBeanContainerReady produced class io.quarkus.arc.deployment.BeanContainerBuildItem
                to io.quarkus.opentelemetry.deployment.logging.LogHandlerProcessor#build produced class io.quarkus.deployment.builditem.LogHandlerBuildItem
                to io.quarkus.deployment.logging.LoggingResourceProcessor#setupLoggingRuntimeInit produced class io.quarkus.deployment.logging.LoggingSetupBuildItem
                to io.quarkus.devservices.keycloak.KeycloakDevServicesProcessor#startKeycloakContainer produced class io.quarkus.devservices.keycloak.KeycloakDevServicesConfigBuildItem
                to io.quarkus.oidc.deployment.devservices.keycloak.KeycloakDevUIProcessor#produceProviderComponent
        at io.quarkus.builder.BuildChainBuilder.detectCycles(BuildChainBuilder.java:327)

Expected behavior

No response

Actual behavior

No response

How to Reproduce?

Create a project with both dependencis
quarkus create app quarkus-oidc-otel --gradle-kotlin-dsl --extension='rest-jackson,opentelemetry,oidc' -P 'io.quarkus.platform:quarkus-bom:3.17.5'

Add otel logs

echo 'quarkus.otel.exporter.otlp.enabled=true' >> quarkus-oidc-otel/src/main/resources/application.properties
echo 'quarkus.otel.logs.enabled=true' >> quarkus-oidc-otel/src/main/resources/application.properties

Then run quarkus dev

Output of uname -a or ver

linux

Output of java -version

21

Quarkus version or git rev

3.17.5

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

8.12

Additional information

Should not be a duplicate of #45130 as the fix should be already included in quarkus 3.17.5

Copy link

quarkus-bot bot commented Jan 3, 2025

/cc @brunobat (opentelemetry), @geoand (kotlin), @pedroigor (keycloak), @radcortez (opentelemetry), @sberyozkin (keycloak)

@geoand
Copy link
Contributor

geoand commented Jan 3, 2025

This is similar to #45130, but it's likely harder to address

@michalvavrik
Copy link
Member

I'll have a look.

@michalvavrik michalvavrik self-assigned this Jan 4, 2025
@michalvavrik
Copy link
Member

It can only be reproduced with 3.17.5, but not with the 999-SNAPSHOT. I suspect we just need to backport #44590.

@brunobat
Copy link
Contributor

brunobat commented Jan 4, 2025

It makes sense #44590 will fix the issue because it's not using a synthetic bean anymore.

@javanegmond
Copy link

It can only be reproduced with 3.17.5, but not with the 999-SNAPSHOT. I suspect we just need to backport #44590.

FWIW, this also happens on 3.17.3.

Also FWIW: disabling keycloak devservices (quarkus.keycloak.devservices.enabled=false [1]) does not alleviate the issue.

[1] https://quarkus.io/guides/security-openid-connect-dev-services#disable-dev-services-for-keycloak

@michalvavrik
Copy link
Member

thanks for info @javanegmond , all of that is aligned with our conclusion. I don't think you can work around that, but it's a DEV mode issue, so it has zero impact on production and tests.

@geoand
Copy link
Contributor

geoand commented Jan 7, 2025

Closing this as the problem does not exist in main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/keycloak area/kotlin area/tracing kind/bug Something isn't working triage/out-of-date This issue/PR is no longer valid or relevant
Projects
Status: Done
Development

No branches or pull requests

5 participants