Closed ajaiswal595 closed 3 weeks ago
This is not easily reproducible as it contains some parameters/files specific to your environment. Can you please try to transform this into a minimal example that I can reproduce locally?
2024-10-07 16:52:42,791 WARN [org.keycloak.quarkus.runtime.cli.Picocli] (main) The following run time options were found, but will be ignored during build time: kc.spi-realm-restapi-extension-mytest-identity-provider-vault-password
Will be addressed by https://github.com/keycloak/keycloak/issues/33638 - it is not related to any other issues that you are seeing. It also should only be emitted on a non-optimized start, so if you are running different commands than the ones shown, please include them.
024-10-07 16:52:42,791 WARN [org.keycloak.quarkus.runtime.cli.Picocli] (main) The following used options or option values are DEPRECATED and will be removed or their behaviour changed in a future release:
- legacy-observability-interface
This should only be emitted if legacy-observability-interface is used as an option - which is not shown in the command given. Again, if you are running different commands than the ones shown, please include them.
This is not easily reproducible as it contains some parameters/files specific to your environment. Can you please try to transform this into a minimal example that I can reproduce locally?
It breaks in my provider
class MyProviderFactory implements RealmResourceProviderFactory, ProviderEventListener {
@Override
public void onEvent(ProviderEvent event) {
if (event instanceof PostMigrationEvent postMigrationEvent) {
KeycloakModelUtils.runJobInTransaction(postMigrationEvent.getFactory(), new MyCustomProvider());
}
}
...
...
}
class MyCustomProvider extends implements KeycloakSessionTask
{
@Override
public void run(KeycloakSession session) {
session.getProvider(DatastoreProvider.class).realms().getRealmsStream().forEach(this::migrateRealmComponents);
}
private void migrateRealmComponents(RealmModel realm) {
realm.getIdentityProvidersStream()
}
...
...
...
}
2024-10-07 16:52:42,791 WARN [org.keycloak.quarkus.runtime.cli.Picocli] (main) The following run time options were found, but will be ignored during build time: kc.spi-realm-restapi-extension-mytest-identity-provider-vault-password
Will be addressed by #33638 - it is not related to any other issues that you are seeing. It also should only be emitted on a non-optimized start, so if you are running different commands than the ones shown, please include them.
024-10-07 16:52:42,791 WARN [org.keycloak.quarkus.runtime.cli.Picocli] (main) The following used options or option values are DEPRECATED and will be removed or their behaviour changed in a future release:
- legacy-observability-interface
This should only be emitted if legacy-observability-interface is used as an option - which is not shown in the command given. Again, if you are running different commands than the ones shown, please include them.
can you please check https://github.com/keycloak/keycloak/issues/33637#issuecomment-2396802897
I updated the description and comments.
Please update the description to provide a better detail of what the problem is. I think perhaps reading through it you have a custom provider of sorts, and it's causing some issues. We also need steps to reproduce, but here you've simply written dfsfsdf
.
~missing-info
Thanks for reporting this issue, but there is insufficient information or lack of steps to reproduce.
Please provide additional details, otherwise this issue will be automatically closed within 14 days.
I have the same issue with v26.0.0 2024-10-12 15:36:53,836 ERROR [org.keycloak.services.error.KeycloakErrorHandler] (executor-thread-39) Uncaught server error: java.lang.IllegalArgumentException: Session not bound to a realm at org.keycloak.models.cache.infinispan.organization.InfinispanOrganizationProvider.getRealm(InfinispanOrganizationProvider.java:336) at org.keycloak.models.cache.infinispan.organization.InfinispanOrganizationProvider.count(InfinispanOrganizationProvider.java:289) at org.keycloak.storage.UserStorageManager.isReadOnlyOrganizationMember(UserStorageManager.java:943) at org.keycloak.storage.UserStorageManager.importValidation(UserStorageManager.java:117) at org.keycloak.storage.UserStorageManager.getUserById(UserStorageManager.java:389) at org.keycloak.models.cache.infinispan.UserCacheSession.getUserById(UserCacheSession.java:222) at com.invio.keycloak.even.listener.InvioUserEventListenerProviderFactory$1$1.lambda$commitImpl$0(InvioUserEventListenerProviderFactory.java:70) at org.keycloak.models.utils.KeycloakModelUtils.lambda$runJobInTransaction$1(KeycloakModelUtils.java:263) at org.keycloak.models.utils.KeycloakModelUtils.runJobInTransactionWithResult(KeycloakModelUtils.java:392) at org.keycloak.models.utils.KeycloakModelUtils.runJobInTransaction(KeycloakModelUtils.java:262) at com.invio.keycloak.even.listener.InvioUserEventListenerProviderFactory$1$1.commitImpl(InvioUserEventListenerProviderFactory.java:65) at org.keycloak.models.AbstractKeycloakTransaction.commit(AbstractKeycloakTransaction.java:46) at org.keycloak.services.DefaultKeycloakTransactionManager.commit(DefaultKeycloakTransactionManager.java:146) at org.keycloak.services.DefaultKeycloakSession.closeTransactionManager(DefaultKeycloakSession.java:414) at org.keycloak.services.DefaultKeycloakSession.close(DefaultKeycloakSession.java:379) at org.keycloak.models.KeycloakBeanProducer_ProducerMethod_getKeycloakSession_XoSEUTXOsE3bpqXlGMAykCiECUM_ClientProxy.close(Unknown Source) at org.keycloak.quarkus.runtime.transaction.TransactionalSessionHandler.close(TransactionalSessionHandler.java:60) at org.keycloak.quarkus.runtime.integration.jaxrs.CloseSessionFilter.closeSession(CloseSessionFilter.java:67) at org.keycloak.quarkus.runtime.integration.jaxrs.CloseSessionFilter.filter(CloseSessionFilter.java:63) at org.jboss.resteasy.reactive.server.handlers.ResourceResponseFilterHandler.handle(ResourceResponseFilterHandler.java:25) at io.quarkus.resteasy.reactive.server.runtime.QuarkusResteasyReactiveRequestContext.invokeHandler(QuarkusResteasyReactiveRequestContext.java:150) at org.jboss.resteasy.reactive.common.core.AbstractResteasyReactiveContext.run(AbstractResteasyReactiveContext.java:147) at io.quarkus.vertx.core.runtime.VertxCoreRecorder$14.runWith(VertxCoreRecorder.java:635) at org.jboss.threads.EnhancedQueueExecutor$Task.doRunWith(EnhancedQueueExecutor.java:2516) at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2495) at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1521) at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:11) at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:11) at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) at java.base/java.lang.Thread.run(Thread.java:1583)
It breaks in my provider :
void userAdded(String realmId, String clientId, String userId) {
session
.getTransactionManager()
.enlistAfterCompletion(
new AbstractKeycloakTransaction() {
@Override
protected void commitImpl() {
KeycloakModelUtils.runJobInTransaction(
factory,
(s) -> {
RealmModel realm = s.realms().getRealm(realmId);
-------------> UserModel user = s.users().getUserById(realm, userId); <------------ HERE
getUserChangedHandler().onUserAdded(s, realm, user, clientId);
});
}
.......................................
});
}
Due to lack of updates in the last 14 days this issue will be automatically closed.
@akoyl
Have you got the solution?
@ajaiswal595
No, not yet. I've tried many different things, but nothing worked. I'm getting this error when trying to get UserModel e.g. UserModel user = session.users().getUserById(realm, userId);
Tha same code works on v25.0.6
I can confirm that this bug has been fixed in 26.0.2. It was present in 26.0.0 and 26.0.1.
I tried with version 26.0.2 i am getting the same issue and with latest keycloak also same issue
2024-11-05T23:46:11.242+05:30 INFO 119660 --- [ream--701245566] tc.keycloak/keycloak:latest : STDOUT: 2024-11-05 18:16:11,240 WARN [io.agroal.pool] (main) Datasource '
in my case it was caused by "organization" feature which enabled since Keycloak 26. error is gone after disabling "organization" feature.
org.keycloak.models.cache.infinispan.organization.InfinispanOrganizationProvider.getRealm(InfinispanOrganizationProvider.java:336) at org.keycloak.models.cache.infinispan.organization.InfinispanOrganizationProvider.count(InfinispanOrganizationProvider.java:289) at org.keycloak.storage.UserStorageManager.isReadOnlyOrganizationMember(UserStorageManager.java:943) at org.keycloak.storage.UserStorageManager.importValidation(UserStorageManager.java:117) at org.keycloak.storage.UserStorageManager.getUserById(UserStorageManager.java:389) ...
Before reporting an issue
Area
core
Describe the bug
When I start keycloak 26.0.0 it fails with an error
Next time you run the server, just run:
'2024-10-07 16:52:42,791 WARN [org.keycloak.quarkus.runtime.cli.Picocli] (main) The following run time options were found, but will be ignored during build time: kc.spi-realm-restapi-extension-mytest-identity-provider-vault-password, kc.spi-admin-realm, kc.spi-hostname-v2-hostname-strict, kc.spi-vault-keystore-pass, kc.spi-hostname-v2-hostname, kc.spi-realm-restapi-extension-mytest-auth-provider-vault-password, kc.spi-realm-restapi-extension-mytest-auth-provider-vault-keystore, kc.spi-vault-keystore-file, kc.spi-realm-restapi-extension-mytest-identity-provider-vault-keystore, kc.spi-theme-welcome-theme
''2024-10-07 16:52:42,791 WARN [org.keycloak.quarkus.runtime.cli.Picocli] (main) The following used options or option values are DEPRECATED and will be removed or their behaviour changed in a future release:
2024-10-07 16:26:31,796 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) ERROR: Failed to start server in (production) mode ''2024-10-07 16:26:31,796 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) ERROR: Session not bound to a realm
it breaks here
Version
26.0.0
Regression
Expected behavior
It should start seamless
Actual behavior
It's failing to start
How to Reproduce?
dfsfsdf
Anything else?
26.0.0 is latest , And this error is not there on internet as of now.