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

500 on trying to create token #26

Open
0nliner opened this issue Mar 27, 2024 · 0 comments
Open

500 on trying to create token #26

0nliner opened this issue Mar 27, 2024 · 0 comments
Assignees

Comments

@0nliner
Copy link

0nliner commented Mar 27, 2024

I've successfully added a new realm and tried to create a token for my user. However, Keycloak is responding with a 500 error. Maybe it's a bug, or maybe I am doing something wrong. Could you please check this out?

image
image

{
  "id": "backend",
  "realm": "backend",
  "sslRequired": "none",
  "enabled": true,
  "eventsEnabled": true,
  "eventsExpiration": 900,
  "adminEventsEnabled": true,
  "adminEventsDetailsEnabled": true,
  "attributes": {
    "adminEventsExpiration": "900"
  },
  "clients": [
    {
      "id": "backend",
      "clientId": "backend",
      "name": "backend",
      "enabled": true,
      "publicClient": true,
      "rootUrl": "http://localhost",
      "adminUrl": "http://localhost",
      "baseUrl": "http://localhost",
      "redirectUris": [
        "http://localhost/*"
      ],
      "webOrigins": [
        "http://localhost"
      ]
    }
  ],
  "users": [
    {
      "id": "chel",
      "email": "vkusnisaharok@gmail.com",
      "username": "chel",
      "enabled": true,
      "emailVerified": true,
      "credentials": [
        {
          "temporary": false,
          "type": "password",
          "value": "keycloak"
        }
      ]
    }
  ]
}
merlin@merlin:~/code/keycloak-compose$ docker compose logs -f keycloak
keycloak-1  | Updating the configuration and installing your custom providers, if any. Please wait.
keycloak-1  | 2024-03-27 09:33:34,324 INFO  [io.qua.dep.QuarkusAugmentor] (main) Quarkus augmentation completed in 9801ms
keycloak-1  | 2024-03-27 09:33:36,480 INFO  [org.keycloak.quarkus.runtime.hostname.DefaultHostnameProvider] (main) Hostname settings: Base URL: <unset>, Hostname: <request>, Strict HTTPS: false, Path: <request>, Strict BackChannel: false, Admin URL: <unset>, Admin: <request>, Port: -1, Proxied: false
keycloak-1  | 2024-03-27 09:33:36,797 WARN  [org.infinispan.CONFIG] (keycloak-cache-init) ISPN000569: Unable to persist Infinispan internal caches as no global state enabled
keycloak-1  | 2024-03-27 09:33:36,894 INFO  [org.infinispan.CONTAINER] (keycloak-cache-init) ISPN000556: Starting user marshaller 'org.infinispan.jboss.marshalling.core.JBossUserMarshaller'
keycloak-1  | 2024-03-27 09:33:39,652 WARN  [io.quarkus.agroal.runtime.DataSources] (JPA Startup Thread) Datasource <default> enables XA but transaction recovery is not enabled. Please enable transaction recovery by setting quarkus.transaction-manager.enable-recovery=true, otherwise data may be lost if the application is terminated abruptly
keycloak-1  | 2024-03-27 09:33:40,971 INFO  [org.keycloak.broker.provider.AbstractIdentityProviderMapper] (main) Registering class org.keycloak.broker.provider.mappersync.ConfigSyncEventListener
keycloak-1  | 2024-03-27 09:33:42,869 INFO  [org.keycloak.quarkus.runtime.storage.legacy.liquibase.QuarkusJpaUpdaterProvider] (main) Initializing database schema. Using changelog META-INF/jpa-changelog-master.xml
keycloak-1  | 
keycloak-1  | UPDATE SUMMARY
keycloak-1  | Run:                        121
keycloak-1  | Previously run:               0
keycloak-1  | Filtered out:                 0
keycloak-1  | -------------------------------
keycloak-1  | Total change sets:          121
keycloak-1  | 
keycloak-1  | 2024-03-27 09:33:47,329 INFO  [org.keycloak.connections.infinispan.DefaultInfinispanConnectionProviderFactory] (main) Node name: node_702661, Site name: null
keycloak-1  | 2024-03-27 09:33:47,557 INFO  [org.keycloak.services] (main) KC-SERVICES0050: Initializing master realm
keycloak-1  | 2024-03-27 09:33:49,726 INFO  [org.keycloak.exportimport.singlefile.SingleFileImportProvider] (main) Full importing from file /opt/keycloak/bin/../data/import/realm_backend.json
keycloak-1  | 2024-03-27 09:33:52,406 INFO  [org.keycloak.exportimport.util.ImportUtils] (main) Realm 'backend' imported
keycloak-1  | 2024-03-27 09:33:52,517 INFO  [org.keycloak.exportimport.singlefile.SingleFileImportProvider] (main) Full importing from file /opt/keycloak/bin/../data/import/realm.json
keycloak-1  | 2024-03-27 09:33:54,197 INFO  [org.keycloak.exportimport.util.ImportUtils] (main) Realm 'grafana' imported
keycloak-1  | 2024-03-27 09:33:54,284 INFO  [org.keycloak.exportimport.dir.DirImportProvider] (main) Importing from directory /opt/keycloak/bin/../data/import
keycloak-1  | 2024-03-27 09:33:54,284 INFO  [org.keycloak.services] (main) KC-SERVICES0030: Full model import requested. Strategy: IGNORE_EXISTING
keycloak-1  | 2024-03-27 09:33:54,285 INFO  [org.keycloak.services] (main) KC-SERVICES0032: Import finished successfully
keycloak-1  | 2024-03-27 09:33:54,428 INFO  [io.quarkus] (main) Keycloak 24.0.1 on JVM (powered by Quarkus 3.8.1) started in 19.722s. Listening on: http://0.0.0.0:8080
keycloak-1  | 2024-03-27 09:33:54,428 INFO  [io.quarkus] (main) Profile dev activated. 
keycloak-1  | 2024-03-27 09:33:54,429 INFO  [io.quarkus] (main) Installed features: [agroal, cdi, hibernate-orm, jdbc-postgresql, keycloak, logging-gelf, micrometer, narayana-jta, reactive-routes, resteasy-reactive, resteasy-reactive-jackson, smallrye-context-propagation, vertx]
keycloak-1  | 2024-03-27 09:33:54,863 INFO  [org.keycloak.services] (main) KC-SERVICES0009: Added user 'admin' to realm 'master'
keycloak-1  | 2024-03-27 09:33:54,866 WARN  [org.keycloak.quarkus.runtime.KeycloakMain] (main) Running the server in development mode. DO NOT use this configuration in production.
keycloak-1  | 2024-03-27 09:40:28,413 ERROR [org.keycloak.services.error.KeycloakErrorHandler] (executor-thread-1) Uncaught server error: java.lang.NullPointerException: Cannot invoke "String.lastIndexOf(int)" because the return value of "org.keycloak.representations.AccessToken.getIssuer()" is null
keycloak-1  |   at org.keycloak.services.resources.admin.AdminRoot.authenticateRealmAdminRequest(AdminRoot.java:170)
keycloak-1  |   at org.keycloak.services.resources.admin.AdminRoot.getRealmsAdmin(AdminRoot.java:218)
keycloak-1  |   at org.keycloak.services.resources.admin.AdminRoot$quarkusrestinvoker$getRealmsAdmin_45154ef53be93bae0f6a8d488a99e593258b537a.invoke(Unknown Source)
keycloak-1  |   at org.jboss.resteasy.reactive.server.handlers.InvocationHandler.handle(InvocationHandler.java:29)
keycloak-1  |   at io.quarkus.resteasy.reactive.server.runtime.QuarkusResteasyReactiveRequestContext.invokeHandler(QuarkusResteasyReactiveRequestContext.java:141)
keycloak-1  |   at org.jboss.resteasy.reactive.common.core.AbstractResteasyReactiveContext.run(AbstractResteasyReactiveContext.java:147)
keycloak-1  |   at io.quarkus.vertx.core.runtime.VertxCoreRecorder$14.runWith(VertxCoreRecorder.java:582)
keycloak-1  |   at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2513)
keycloak-1  |   at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1538)
keycloak-1  |   at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:29)
keycloak-1  |   at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:29)
keycloak-1  |   at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
keycloak-1  |   at java.base/java.lang.Thread.run(Thread.java:840)
@eabykov eabykov self-assigned this Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants