Error when running Keycloak in Docker - docker

I am trying to run Keycloak in Docker, but its throwing an error.
Here's the docker file:
FROM jboss/keycloak:4.1.0.Final
WORKDIR /opt/jboss/keycloak
COPY realm-export.json initial_data.json
RUN ./bin/standalone.sh -Dkeycloak.migration.action=import -Dkeycloak.migration.provider=singleFile -Dkeycloak.migration.file=initial_data.json -Dkeycloak.migration.strategy=OVERWRITE_EXISTING
I am using that realm-export.json file because I have some configurations there.
And the error that is showing is this one:
12:04:35,033 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 48) MSC000001: Failed to start service jboss.undertow.deployment.default-server.default-host./auth: org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./auth: java.lang.RuntimeException: RESTEASY003325: Failed to construct public org.keycloak.services.resources.KeycloakApplication(javax.servlet.ServletContext,org.jboss.resteasy.core.Dispatcher)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:84)
Caused by: java.lang.RuntimeException: RESTEASY003325: Failed to construct public org.keycloak.services.resources.KeycloakApplication(javax.servlet.ServletContext,org.jboss.resteasy.core.Dispatcher)
Caused by: java.lang.RuntimeException: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "typedScopes" (class org.keycloak.representations.idm.authorization.ResourceRepresentation), not marked as ignorable (11 known properties: "ownerManagedAccess", "owner", "icon_uri", "attributes", "type", "name", "uri", "displayName", "scopes", "resource_scopes", "_id"])
at [Source: java.io.FileInputStream#6d0b4fbd; line: 690, column: 29] (through reference chain: org.keycloak.representations.idm.RealmRepresentation["clients"]->java.util.ArrayList[2]->org.keycloak.representations.idm.ClientRepresentation["authorizationSettings"]->org.keycloak.representations.idm.authorization.ResourceServerRepresentation["resources"]->java.util.ArrayList[2]->org.keycloak.representations.idm.authorization.ResourceRepresentation["typedScopes"])
Caused by: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "typedScopes" (class org.keycloak.representations.idm.authorization.ResourceRepresentation), not marked as ignorable (11 known properties: "ownerManagedAccess", "owner", "icon_uri", "attributes", "type", "name", "uri", "displayName", "scopes", "resource_scopes", "_id"])
at [Source: java.io.FileInputStream#6d0b4fbd; line: 690, column: 29] (through reference chain: org.keycloak.representations.idm.RealmRepresentation["clients"]->java.util.ArrayList[2]->org.keycloak.representations.idm.ClientRepresentation["authorizationSettings"]->org.keycloak.representations.idm.authorization.ResourceServerRepresentation["resources"]->java.util.ArrayList[2]->org.keycloak.representations.idm.authorization.ResourceRepresentation["typedScopes"])
While this shows at the end:
12:04:35,121 ERROR [org.jboss.as.server] (ServerService Thread Pool -- 45) WFLYSRV0022: Deploy of deployment "keycloak-server.war" was rolled back with no failure message
ERROR: Service 'keycloak' failed to build: The command '/bin/sh -c ./bin/standalone.sh -Dkeycloak.migration.action=import -Dkeycloak.migration.provider=singleFile -Dkeycloak.migration.file=initial_data.json -Dkeycloak.migration.strategy=OVERWRITE_EXISTING' returned a non-zero code: 1
p.s. When I comment this code in DockerFile
RUN ./bin/standalone.sh -Dkeycloak.migration.action=import -Dkeycloak.migration.provider=singleFile -Dkeycloak.migration.file=initial_data.json -Dkeycloak.migration.strategy=OVERWRITE_EXISTING
Then it is executing perfectly, but I do need to add that realm-export.json file here.

typedScopes is changed to scopes from 4.0.0 version, you realm-export.json file is generated from older version of keycloak

Related

Neo4j - Community - 4.0.2 - Database won't start (Internal token for id 9 not found, but a public token exists on that id)

Issue: We had a working Neo4j instance running on an AWS EC2 instance. By mistake, it was stopped accidentally. Now the database is not coming back.
What we tried so far:
Build a brand new machine and try to restore and load data from the existing Neo4j instances. I used the neo4j-admin utility to do so. Restarted the database but no luck.
Version Details:
Neo4.j - 4.0.2 Community
PlatformType": "Linux",
PlatformVersion": "16.04",
PlatformName": "Ubuntu",
ResourceType": "EC2Instance",
Debug.log shows below-mentioned error.
2022-08-25 17:29:52.159+0000 INFO [o.n.i.d.DiagnosticsManager]
2022-08-25 17:29:52.209+0000 WARN [o.n.k.d.Database] [neo4j] Exception occurred while starting the database. Trying to stop already started components. Component 'org.neo4j.internal.recordstorage.RecordStorageEngine$2#668d9b0' failed to initialize. Please see the attached cause exception "Internal token for id 9 not found, but a public token exists on that id: NamedToken[name:account_id, id:9, internal:false].".
org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.internal.recordstorage.RecordStorageEngine$2#668d9b0' failed to initialize. Please see the attached cause exception "Internal token for id 9 not found, but a public token exists on that id: NamedToken[name:account_id, id:9, internal:false].".
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.init(LifeSupport.java:426)
at org.neo4j.kernel.lifecycle.LifeSupport.init(LifeSupport.java:66)
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:102)
at org.neo4j.kernel.database.Database.start(Database.java:462)
at org.neo4j.dbms.database.AbstractDatabaseManager.startDatabase(AbstractDatabaseManager.java:187)
at org.neo4j.dbms.database.DefaultDatabaseManager.startDatabase(DefaultDatabaseManager.java:132)
at org.neo4j.dbms.database.DefaultDatabaseManager.initialiseDefaultDatabase(DefaultDatabaseManager.java:64)
at org.neo4j.dbms.database.DefaultDatabaseInitializer.start0(DefaultDatabaseInitializer.java:39)
at org.neo4j.kernel.lifecycle.SafeLifecycle.transition(SafeLifecycle.java:124)
at org.neo4j.kernel.lifecycle.SafeLifecycle.start(SafeLifecycle.java:138)
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:444)
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:111)
at org.neo4j.graphdb.facade.DatabaseManagementServiceFactory.startDatabaseServer(DatabaseManagementServiceFactory.java:158)
at org.neo4j.graphdb.facade.DatabaseManagementServiceFactory.build(DatabaseManagementServiceFactory.java:145)
at org.neo4j.server.database.CommunityGraphFactory.newDatabaseManagementService(CommunityGraphFactory.java:36)
at org.neo4j.server.database.LifecycleManagingDatabaseService.start(LifecycleManagingDatabaseService.java:88)
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:444)
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:111)
at org.neo4j.server.AbstractNeoServer.start(AbstractNeoServer.java:157)
at org.neo4j.server.ServerBootstrapper.start(ServerBootstrapper.java:114)
at org.neo4j.server.ServerBootstrapper.start(ServerBootstrapper.java:89)
at org.neo4j.server.CommunityEntryPoint.main(CommunityEntryPoint.java:35)
Caused by: java.lang.RuntimeException: org.neo4j.internal.kernel.api.exceptions.schema.MalformedSchemaRuleException: Cannot read schema rule because it is referring to a property key token (id 9) that does not exist.
at org.neo4j.internal.recordstorage.SchemaStorage.readSchemaRuleThrowingRuntimeException(SchemaStorage.java:272)
at org.neo4j.internal.recordstorage.SchemaStorage.lambda$streamAllSchemaRules$5(SchemaStorage.java:244)
at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:271)
at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
at java.base/java.util.stream.LongPipeline$1$1.accept(LongPipeline.java:177)
at java.base/java.util.stream.Streams$RangeLongSpliterator.tryAdvance(Streams.java:207)
at java.base/java.util.Spliterator$OfLong.tryAdvance(Spliterator.java:740)
at java.base/java.util.stream.StreamSpliterators$WrappingSpliterator.lambda$initPartialTraversalState$0(StreamSpliterators.java:294)
at java.base/java.util.stream.StreamSpliterators$AbstractWrappingSpliterator.fillBuffer(StreamSpliterators.java:206)
at java.base/java.util.stream.StreamSpliterators$AbstractWrappingSpliterator.doAdvance(StreamSpliterators.java:161)
at java.base/java.util.stream.StreamSpliterators$WrappingSpliterator.tryAdvance(StreamSpliterators.java:300)
at java.base/java.util.Spliterators$1Adapter.hasNext(Spliterators.java:681)
at org.neo4j.internal.recordstorage.SchemaCache$SchemaCacheState.load(SchemaCache.java:298)
at org.neo4j.internal.recordstorage.SchemaCache$SchemaCacheState.<init>(SchemaCache.java:264)
at org.neo4j.internal.recordstorage.SchemaCache.load(SchemaCache.java:134)
at org.neo4j.internal.recordstorage.RecordStorageEngine.loadSchemaCache(RecordStorageEngine.java:368)
at org.neo4j.internal.recordstorage.RecordStorageEngine$2.init(RecordStorageEngine.java:459)
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.init(LifeSupport.java:405)
... 21 more
Caused by: org.neo4j.internal.kernel.api.exceptions.schema.MalformedSchemaRuleException: Cannot read schema rule because it is referring to a property key token (id 9) that does not exist.
at org.neo4j.kernel.impl.store.SchemaStore.insertPropertyIntoMap(SchemaStore.java:463)
at org.neo4j.kernel.impl.store.SchemaStore.schemaRecordToMap(SchemaStore.java:445)
at org.neo4j.kernel.impl.store.SchemaStore.readSchemaRule(SchemaStore.java:326)
at org.neo4j.internal.recordstorage.SchemaStorage.readSchemaRule(SchemaStorage.java:280)
at org.neo4j.internal.recordstorage.SchemaStorage.readSchemaRuleThrowingRuntimeException(SchemaStorage.java:265)
... 38 more
Caused by: org.neo4j.token.api.TokenNotFoundException: Internal token for id 9 not found, but a public token exists on that id: NamedToken[name:account_id, id:9, internal:false].
at org.neo4j.token.AbstractTokenHolderBase.getInternalTokenById(AbstractTokenHolderBase.java:121)
at org.neo4j.kernel.impl.store.SchemaStore.insertPropertyIntoMap(SchemaStore.java:457)
... 42 more
2022-08-25 17:29:52.211+0000 ERROR [o.n.d.d.DefaultDatabaseManager] Failed to start database: neo4j An error occurred! Unable to start database with name `neo4j`.
org.neo4j.dbms.api.DatabaseManagementException: An error occurred! Unable to start database with name `neo4j`.
at org.neo4j.dbms.database.AbstractDatabaseManager.startDatabase(AbstractDatabaseManager.java:191)
at org.neo4j.dbms.database.DefaultDatabaseManager.startDatabase(DefaultDatabaseManager.java:132)
at org.neo4j.dbms.database.DefaultDatabaseManager.initialiseDefaultDatabase(DefaultDatabaseManager.java:64)
at org.neo4j.dbms.database.DefaultDatabaseInitializer.start0(DefaultDatabaseInitializer.java:39)
at org.neo4j.kernel.lifecycle.SafeLifecycle.transition(SafeLifecycle.java:124)
at org.neo4j.kernel.lifecycle.SafeLifecycle.start(SafeLifecycle.java:138)
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:444)
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:111)
at org.neo4j.graphdb.facade.DatabaseManagementServiceFactory.startDatabaseServer(DatabaseManagementServiceFactory.java:158)
at org.neo4j.graphdb.facade.DatabaseManagementServiceFactory.build(DatabaseManagementServiceFactory.java:145)
at org.neo4j.server.database.CommunityGraphFactory.newDatabaseManagementService(CommunityGraphFactory.java:36)
at org.neo4j.server.database.LifecycleManagingDatabaseService.start(LifecycleManagingDatabaseService.java:88)
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:444)
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:111)
at org.neo4j.server.AbstractNeoServer.start(AbstractNeoServer.java:157)
at org.neo4j.server.ServerBootstrapper.start(ServerBootstrapper.java:114)
at org.neo4j.server.ServerBootstrapper.start(ServerBootstrapper.java:89)
at org.neo4j.server.CommunityEntryPoint.main(CommunityEntryPoint.java:35)
Caused by: java.lang.RuntimeException: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.internal.recordstorage.RecordStorageEngine$2#668d9b0' failed to initialize. Please see the attached cause exception "Internal token for id 9 not found, but a public token exists on that id: NamedToken[name:account_id, id:9, internal:false].".
at org.neo4j.kernel.database.Database.start(Database.java:478)
at org.neo4j.dbms.database.AbstractDatabaseManager.startDatabase(AbstractDatabaseManager.java:187)
... 17 more
Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.internal.recordstorage.RecordStorageEngine$2#668d9b0' failed to initialize. Please see the attached cause exception "Internal token for id 9 not found, but a public token exists on that id: NamedToken[name:account_id, id:9, internal:false].".
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.init(LifeSupport.java:426)
at org.neo4j.kernel.lifecycle.LifeSupport.init(LifeSupport.java:66)
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:102)
at org.neo4j.kernel.database.Database.start(Database.java:462)
... 18 more
Caused by: java.lang.RuntimeException: org.neo4j.internal.kernel.api.exceptions.schema.MalformedSchemaRuleException: Cannot read schema rule because it is referring to a property key token (id 9) that does not exist.
at org.neo4j.internal.recordstorage.SchemaStorage.readSchemaRuleThrowingRuntimeException(SchemaStorage.java:272)
at org.neo4j.internal.recordstorage.SchemaStorage.lambda$streamAllSchemaRules$5(SchemaStorage.java:244)
at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:271)
at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
at java.base/java.util.stream.LongPipeline$1$1.accept(LongPipeline.java:177)
at java.base/java.util.stream.Streams$RangeLongSpliterator.tryAdvance(Streams.java:207)
at java.base/java.util.Spliterator$OfLong.tryAdvance(Spliterator.java:740)
at java.base/java.util.stream.StreamSpliterators$WrappingSpliterator.lambda$initPartialTraversalState$0(StreamSpliterators.java:294)
at java.base/java.util.stream.StreamSpliterators$AbstractWrappingSpliterator.fillBuffer(StreamSpliterators.java:206)
at java.base/java.util.stream.StreamSpliterators$AbstractWrappingSpliterator.doAdvance(StreamSpliterators.java:161)
at java.base/java.util.stream.StreamSpliterators$WrappingSpliterator.tryAdvance(StreamSpliterators.java:300)
at java.base/java.util.Spliterators$1Adapter.hasNext(Spliterators.java:681)
at org.neo4j.internal.recordstorage.SchemaCache$SchemaCacheState.load(SchemaCache.java:298)
at org.neo4j.internal.recordstorage.SchemaCache$SchemaCacheState.<init>(SchemaCache.java:264)
at org.neo4j.internal.recordstorage.SchemaCache.load(SchemaCache.java:134)
at org.neo4j.internal.recordstorage.RecordStorageEngine.loadSchemaCache(RecordStorageEngine.java:368)
at org.neo4j.internal.recordstorage.RecordStorageEngine$2.init(RecordStorageEngine.java:459)
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.init(LifeSupport.java:405)
... 21 more
Caused by: org.neo4j.internal.kernel.api.exceptions.schema.MalformedSchemaRuleException: Cannot read schema rule because it is referring to a property key token (id 9) that does not exist.
at org.neo4j.kernel.impl.store.SchemaStore.insertPropertyIntoMap(SchemaStore.java:463)
at org.neo4j.kernel.impl.store.SchemaStore.schemaRecordToMap(SchemaStore.java:445)
at org.neo4j.kernel.impl.store.SchemaStore.readSchemaRule(SchemaStore.java:326)
at org.neo4j.internal.recordstorage.SchemaStorage.readSchemaRule(SchemaStorage.java:280)
at org.neo4j.internal.recordstorage.SchemaStorage.readSchemaRuleThrowingRuntimeException(SchemaStorage.java:265)
... 38 more
Caused by: org.neo4j.token.api.TokenNotFoundException: Internal token for id 9 not found, but a public token exists on that id: NamedToken[name:account_id, id:9, internal:false].
at org.neo4j.token.AbstractTokenHolderBase.getInternalTokenById(AbstractTokenHolderBase.java:121)
at org.neo4j.kernel.impl.store.SchemaStore.insertPropertyIntoMap(SchemaStore.java:457)
... 42 more
2022-08-25 17:29:52.296+0000 INFO [o.n.b.BoltServer] Bolt enabled on 10.126.9.105:7687.
2022-08-25 17:29:52.349+0000 INFO [o.n.s.AbstractNeoServer$ServerComponentsLifecycleAdapter] [system] Starting web server
2022-08-25 17:29:53.740+0000 INFO [o.n.s.AbstractNeoServer$ServerComponentsLifecycleAdapter] [system] Web server started.

Keycloak docker image not running any more Failed to start service org.wildfly.undertow.listener.ajp

i'm a new to keycloak, sorry for this newby post.
I have a docker image that was working perfectly, the same image is deployed on AWS and everything is working fine but suddenly the execution fails for this image locally and it doesn't want to be executed after a system reboot here are the logs if anyone had the same error:
KC version 8.2.0 Config:
{
"KC_DOMAIN": "http://keycloak:8080",
"KC_PRIVATE_DOMAIN": "http://keycloak:8080",
"KC_LIFE_SPAN_DISTRIBUTOR": "1200",
"KC_LIFE_SPAN_IMPLICIT_FLOW_DISTRIBUTOR": "1200",
"KC_SESSION_IDLE_TIMEOUT_DISTRIBUTOR": "3600",
"KC_SESSION_MAX_LIFE_SPAN_DISTRIBUTOR": "43200",
"KC_XFRAME_OPTIONS_DISTRIBUTOR": "ALLOW ORIGIN *",
"KC_CONTENT_SECURITY_POLICY_DISTRIBUTOR": "frame-src 'self' *; frame-ancestors 'self' *; object-src 'none';",
"KEYCLOAK_LOGLEVEL": "INFO",
"EVENT_LOGLEVEL": "DEBUG",
"ROOT_LOGLEVEL": "INFO",
"JGROUP_LOGLEVEL": "INFO",
"KEYCLOAK_LOG_ROTATE_SIZE":"10240k",
"KEYCLOAK_LOG_MAX_BACKUP_INDEX":"50",
"ENABLE_INFINISPAN_STATISTICS": "false",
"DB_USER": "keycloak",
"DB_PASSWORD": "******",
"DB_ADDR": "mysql",
"DB_PORT": "3306",
"DB_DATABASE": "keycloak",
"JDBC_PARAMS": "",
"PROXY_ADDRESS_FORWARDING": "false",
"KC_SSL_REQUIRED": "none",
"MAX_CONCURRENT_REQUESTS": "25",
"QUEUE_SIZE": "100"
}
Error when i execute the docker image:
...
13:35:42,295 INFO [org.jboss.as.ejb3] (MSC service thread 1-8) WFLYEJB0481: Strict pool slsb-strict-max-pool is using a max instance size of 128 (per class), which is derived from thread worker pool sizing.
13:35:42,366 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool -- 58) WFLYUT0014: Creating file handler for path '/opt/keycloak/welcome-content' with options [directory-listing: 'false', follow-symlink: 'false', case-sensitive: 'true', safe-symlink-paths: '[]']
13:35:42,448 INFO [org.wildfly.extension.undertow] (MSC service thread 1-3) WFLYUT0012: Started server default-server.
13:35:42,486 INFO [org.wildfly.extension.undertow] (MSC service thread 1-1) WFLYUT0018: Host default-host starting
13:35:42,674 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-8) MSC000001: Failed to start service org.wildfly.undertow.listener.ajp: org.jboss.msc.service.StartException in service org.wildfly.undertow.listener.ajp: WFLYUT0082: Could not start 'ajp' listener.
at org.wildfly.extension.undertow.ListenerService.start(ListenerService.java:211)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1739)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1701)
at org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1559)
at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.net.SocketException: Protocol family unavailable
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:461)
at sun.nio.ch.Net.bind(Net.java:453)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:222)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:85)
at org.xnio.nio.NioXnioWorker.createTcpConnectionServer(NioXnioWorker.java:178)
at org.xnio.XnioWorker.createStreamConnectionServer(XnioWorker.java:310)
at org.wildfly.extension.undertow.AjpListenerService.startListening(AjpListenerService.java:64)
at org.wildfly.extension.undertow.ListenerService.start(ListenerService.java:199)
... 8 more
13:35:42,674 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-6) MSC000001: Failed to start service org.wildfly.undertow.listener.default: org.jboss.msc.service.StartException in service org.wildfly.undertow.listener.default: WFLYUT0082: Could not start 'default' listener.
at org.wildfly.extension.undertow.ListenerService.start(ListenerService.java:211)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1739)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1701)
at org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1559)
at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.net.SocketException: Protocol family unavailable
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:461)
at sun.nio.ch.Net.bind(Net.java:453)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:222)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:85)
at org.xnio.nio.NioXnioWorker.createTcpConnectionServer(NioXnioWorker.java:178)
at org.xnio.XnioWorker.createStreamConnectionServer(XnioWorker.java:310)
at org.wildfly.extension.undertow.HttpListenerService.startListening(HttpListenerService.java:106)
at org.wildfly.extension.undertow.ListenerService.start(ListenerService.java:199)
... 8 more
2021-11-19T13:35:43.686Z WARN [org.jboss.as.dependency.private] (MSC service thread 1-7) WFLYSRV0018: Deployment "deployment.keycloak-server.war" is using a private module ("org.kie") which may be changed or removed in future versions without notice.
2021-11-19T13:35:45.327Z ERROR [org.jgroups.protocols.JDBC_PING] (ServerService Thread Pool -- 60) JGRP000138: Error reading JDBC_PING table: org.h2.jdbc.JdbcSQLException: Table "JGROUPSPING" not found; SQL statement:
SELECT ping_data, own_addr, cluster_name FROM JGROUPSPING WHERE cluster_name=? [42102-193]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)
at org.h2.message.DbException.get(DbException.java:179)
at org.h2.message.DbException.get(DbException.java:155)
at org.h2.command.Parser.readTableOrView(Parser.java:5389)
at org.h2.command.Parser.readTableFilter(Parser.java:1257)
at org.h2.command.Parser.parseSelectSimpleFromPart(Parser.java:1897)
at org.h2.command.Parser.parseSelectSimple(Parser.java:2045)
at org.h2.command.Parser.parseSelectSub(Parser.java:1891)
at org.h2.command.Parser.parseSelectUnion(Parser.java:1709)
at org.h2.command.Parser.parseSelect(Parser.java:1697)
at org.h2.command.Parser.parsePrepared(Parser.java:445)
at org.h2.command.Parser.parse(Parser.java:317)
at org.h2.command.Parser.parse(Parser.java:289)
at org.h2.command.Parser.prepareCommand(Parser.java:254)
at org.h2.engine.Session.prepareLocal(Session.java:561)
at org.h2.engine.Session.prepareCommand(Session.java:502)
at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1203)
at org.h2.jdbc.JdbcPreparedStatement.<init>(JdbcPreparedStatement.java:73)
at org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.java:676)
at org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnection.doPrepareStatement(BaseWrapperManagedConnection.java:758)
at org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnection.prepareStatement(BaseWrapperManagedConnection.java:744)
at org.jboss.jca.adapters.jdbc.WrappedConnection$5.produce(WrappedConnection.java:516)
at org.jboss.jca.adapters.jdbc.WrappedConnection$5.produce(WrappedConnection.java:514)
at org.jboss.jca.adapters.jdbc.SecurityActions.executeInTccl(SecurityActions.java:97)
at org.jboss.jca.adapters.jdbc.WrappedConnection.prepareStatement(WrappedConnection.java:514)
at org.jgroups.protocols.JDBC_PING.prepareStatement(JDBC_PING.java:209)
at org.jgroups.protocols.JDBC_PING.readAll(JDBC_PING.java:221)
at org.jgroups.protocols.JDBC_PING.readAll(JDBC_PING.java:197)
at org.jgroups.protocols.FILE_PING.findMembers(FILE_PING.java:124)
at org.jgroups.protocols.Discovery.invokeFindMembers(Discovery.java:216)
at org.jgroups.protocols.Discovery.findMembers(Discovery.java:241)
at org.jgroups.protocols.Discovery.down(Discovery.java:380)
at org.jgroups.protocols.FILE_PING.down(FILE_PING.java:119)
at org.jgroups.protocols.MERGE3.down(MERGE3.java:278)
at org.jgroups.protocols.FD_SOCK.down(FD_SOCK.java:377)
at org.jgroups.protocols.FD.down(FD.java:320)
at org.jgroups.protocols.VERIFY_SUSPECT.down(VERIFY_SUSPECT.java:102)
at org.jgroups.protocols.pbcast.NAKACK2.down(NAKACK2.java:553)
at org.jgroups.protocols.UNICAST3.down(UNICAST3.java:581)
at org.jgroups.protocols.pbcast.STABLE.down(STABLE.java:347)
at org.jgroups.protocols.pbcast.ClientGmsImpl.joinInternal(ClientGmsImpl.java:72)
at org.jgroups.protocols.pbcast.ClientGmsImpl.join(ClientGmsImpl.java:40)
at org.jgroups.protocols.pbcast.GMS.down(GMS.java:1044)
at org.jgroups.protocols.FlowControl.down(FlowControl.java:295)
at org.jgroups.protocols.FRAG3.down(FRAG3.java:135)
at org.jgroups.protocols.FORK.down(FORK.java:109)
at org.jgroups.stack.ProtocolStack.down(ProtocolStack.java:928)
at org.jgroups.JChannel.down(JChannel.java:627)
at org.jgroups.JChannel._connect(JChannel.java:855)
at org.jgroups.JChannel.connect(JChannel.java:352)
at org.jgroups.JChannel.connect(JChannel.java:343)
at org.jboss.as.clustering.jgroups.subsystem.ChannelServiceConfigurator.get(ChannelServiceConfigurator.java:112) at org.jboss.as.clustering.jgroups.subsystem.ChannelServiceConfigurator.get(ChannelServiceConfigurator.java:58)
at org.wildfly.clustering.service.FunctionalService.start(FunctionalService.java:67)
at org.wildfly.clustering.service.AsyncServiceConfigurator$AsyncService.lambda$start$0(AsyncServiceConfigurator.java:117)
at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
at java.lang.Thread.run(Thread.java:748)
at org.jboss.threads.JBossThread.run(JBossThread.java:485)
Suppressed: org.h2.jdbc.JdbcSQLException: Table "JGROUPSPING" not found; SQL statement:
SELECT ping_data, own_addr, cluster_name FROM JGROUPSPING WHERE cluster_name=? [42102-193]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)
at org.h2.message.DbException.get(DbException.java:179)
at org.h2.message.DbException.get(DbException.java:155)
at org.h2.command.Parser.readTableOrView(Parser.java:5389)
at org.h2.command.Parser.readTableFilter(Parser.java:1257)
at org.h2.command.Parser.parseSelectSimpleFromPart(Parser.java:1897)
at org.h2.command.Parser.parseSelectSimple(Parser.java:2045)
at org.h2.command.Parser.parseSelectSub(Parser.java:1891)
at org.h2.command.Parser.parseSelectUnion(Parser.java:1709)
at org.h2.command.Parser.parseSelect(Parser.java:1697)
at org.h2.command.Parser.parsePrepared(Parser.java:445)
at org.h2.command.Parser.parse(Parser.java:317)
at org.h2.command.Parser.parse(Parser.java:289)
at org.h2.command.Parser.prepareCommand(Parser.java:254)
at org.h2.engine.Session.prepareLocal(Session.java:561)
at org.h2.engine.Session.prepareCommand(Session.java:502)
at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1203)
at org.h2.jdbc.JdbcPreparedStatement.<init>(JdbcPreparedStatement.java:73)
at org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.java:676)
at org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnection.doPrepareStatement(BaseWrapperManagedConnection.java:758)
at org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnection.prepareStatement(BaseWrapperManagedConnection.java:744)
at org.jboss.jca.adapters.jdbc.WrappedConnection$4.produce(WrappedConnection.java:478)
at org.jboss.jca.adapters.jdbc.WrappedConnection$4.produce(WrappedConnection.java:476)
at org.jboss.jca.adapters.jdbc.SecurityActions.executeInTccl(SecurityActions.java:97)
at org.jboss.jca.adapters.jdbc.WrappedConnection.prepareStatement(WrappedConnection.java:476)
at org.jgroups.protocols.JDBC_PING.prepareStatement(JDBC_PING.java:212)
... 35 more
2021-11-19T13:35:45.330Z ERROR [org.jgroups.protocols.JDBC_PING] (ServerService Thread Pool -- 60) JGRP000145: Error updating JDBC_PING table: org.h2.jdbc.JdbcSQLException: Table "JGROUPSPING" not found; SQL statement:
DELETE FROM JGROUPSPING WHERE own_addr=? AND cluster_name=? [42102-193]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)
at org.h2.message.DbException.get(DbException.java:179)
...
The main problem was this error:
13:35:42,674 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-8) MSC000001: Failed to start service org.wildfly.undertow.listener.ajp: org.jboss.msc.service.StartException in service org.wildfly.undertow.listener.ajp: WFLYUT0082: Could not start 'ajp' listener.
This is a an error from the JBOSS application server (Wildfly) that failed to open a socket to listen for incoming connections due to attempting to open an IPv6 socket
And the solution that worked for me is that the JAVA_OPTS environment variable must be set to contain -Djava.net.preferIPv4Stack=true
And here is how i apply this to change keycloak jvm arguments via CLI in standalone configuration, i modify the commons.sh script which is executed in the standalone.sh by adding this enty:
if [[ "$JAVA_OPTS" != *"-Djava.net.preferIPv4Stack=true"* ]]; then
export JAVA_OPTS="$JAVA_OPTS -Djava.net.preferIPv4Stack=true"
fi
You can find more informations in this link

Integration test with testcontainers (Redis) Failing to run

I'm building integration test infrastructure for my micro-service (Java Spring).
Having an issue with testcontainers, as I try to create base class for tests that will start redis on container and will function as redis for the tested service.
the abstract test looks like this:
#SpringBootTest(classes = Application.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
#ActiveProfiles(Constants.SPRING_PROFILE_DEVELOPMENT)
public class AbstractRedisContainerTest {
#Rule
public GenericContainer redis = new GenericContainer("redis:3.0.6")
.withExposedPorts(6379);
And my log show the follow fail msg:
2020-03-04 12:28:55.545 ERROR [myService,,,] 27709 --- [main] o.t.d.DockerClientProviderStrategy:
Could not find a valid Docker environment. Please check configuration. Attempted configurations were:
2020-03-04 12:28:55.546 ERROR [myService,,,] 27709 --- [main] o.t.d.DockerClientProviderStrategy:
EnvironmentAndSystemPropertyClientProviderStrategy:
failed with exception InvalidConfigurationException (ping failed)
2020-03-04 12:28:55.546 ERROR [myService,,,] 27709 --- [main] o.t.d.DockerClientProviderStrategy:EnvironmentAndSystemPropertyClientProviderStrategy:
failed with exception InvalidConfigurationException (ping failed)
2020-03-04 12:28:55.546 ERROR [myService,,,] 27709 --- [main] o.t.d.DockerClientProviderStrategy:UnixSocketClientProviderStrategy:
failed with exception InvalidConfigurationException (ping failed). Root cause LastErrorException ([13])
2020-03-04 12:28:55.546 ERROR [myService,,,] 27709 --- [main] o.t.d.DockerClientProviderStrategy: ProxiedUnixSocketClientProviderStrategy:
failed with exception InvalidConfigurationException (ping failed). Root cause TimeoutException (null)
2020-03-04 12:28:55.546 ERROR [myService,,,] 27709 --- [main] o.t.d.DockerClientProviderStrategy: As no valid configuration was found, execution cannot continue
org.testcontainers.containers.ContainerLaunchException: Container startup failed
where this is the error for the failing line in the code:
Caused by: org.testcontainers.containers.ContainerFetchException: Can't get Docker image:
RemoteDockerImage(imageNameFuture=java.util.concurrent.CompletableFuture#3186b07d[Completed normally],
imagePullPolicy=DefaultPullPolicy(), dockerClient=LazyDockerClient.INSTANCE)
Any idea how to configure my env or what missing here?
important to state that I have succeed to locally run docker images (the one stated here as well) and I have functioning docker environment from cli. I run this test from idea.
not sure if that related, but I run it as user (not as root).

Weblogic not coming up inside the Dockder container

Weblogic is not coming up . It is giving following stack trace . Can any one help in solving that ?
<Jun 20, 2018 1:04:27,029 PM UTC> <Critical> <WebLogicServer> <BEA-000386> <Server subsystem failed. Reason: A MultiException has 4 exceptions. They are:
1. java.lang.ExceptionInInitializerError
2. java.lang.IllegalStateException: Unable to perform operation: post construct on weblogic.rjvm.RJVMService
3. java.lang.IllegalArgumentException: While attempting to resolve the dependencies of weblogic.protocol.ProtocolRegistrationService errors were found
4. java.lang.IllegalStateException: Unable to perform operation: resolve on weblogic.protocol.ProtocolRegistrationService
A MultiException has 4 exceptions. They are:
1. java.lang.ExceptionInInitializerError
2. java.lang.IllegalStateException: Unable to perform operation: post construct on weblogic.rjvm.RJVMService
3. java.lang.IllegalArgumentException: While attempting to resolve the dependencies of weblogic.protocol.ProtocolRegistrationService errors were found
4. java.lang.IllegalStateException: Unable to perform operation: resolve on weblogic.protocol.ProtocolRegistrationService
at org.jvnet.hk2.internal.Collector.throwIfErrors(Collector.java:89)
at org.jvnet.hk2.internal.ClazzCreator.resolveAllDependencies(ClazzCreator.java:250)
at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:358)
at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:487)
at org.glassfish.hk2.runlevel.internal.AsyncRunLevelContext.findOrCreate(AsyncRunLevelContext.java:305)
Truncated. see log file for complete stacktrace
Caused By: java.lang.ExceptionInInitializerError
at weblogic.utils.net.AddressUtils.getIPForLocalHost(AddressUtils.java:163)
at weblogic.rjvm.JVMID.setLocalID(JVMID.java:278)
at weblogic.rjvm.RJVMService.setJVMID(RJVMService.java:72)
at weblogic.rjvm.RJVMService.start(RJVMService.java:54)
at weblogic.server.AbstractServerService.postConstruct(AbstractServerService.java:76)
Truncated. see log file for complete stacktrace
Caused By: java.lang.NullPointerException
at weblogic.utils.net.AddressUtils$AddressMaker.getAllAddresses(AddressUtils.java:62)
at weblogic.utils.net.AddressUtils$AddressMaker.<clinit>(AddressUtils.java:45)
at weblogic.utils.net.AddressUtils.getIPForLocalHost(AddressUtils.java:163)
at weblogic.rjvm.JVMID.setLocalID(JVMID.java:278)
at weblogic.rjvm.RJVMService.setJVMID(RJVMService.java:72)
Truncated. see log file for complete stacktrace
>
The WebLogic Server encountered a critical failure
Reason: Assertion violated
Stopping Derby server...
Derby server stopped.
Actually there was an interface resolution problem inside the docker container which was causing this
Make sure following points for resolution :
1) Cat /etc/hosts should have entry corresponding to localhost
2) docker0 interface should be in up state

OpsCenter 5.2.1 rebalance failed

I'm trying to rebalance a 6-node DSE cluster using OpsCenter 5.2.1 and the job failed at 80% with the following stack error in opscenterd.log. We're running DSE 4.8.0 with 6 search nodes. How do I recover from this error? Can I run re-balance again? Or should I run repair first? (Or something else?)
2016-05-02 23:27:18+0000 [local] WARN: Marking request '10.0.30.57: /ops/cleanup' (3bf6010a-6790-4301-9bf1-53c37fac61d8) as failed: java.rmi.UnmarshalException: Error unmarshaling return; nested exception is:
java.lang.ClassNotFoundException: org.apache.cassandra.db.compaction.CompactionInterruptedException (no security manager: RMI class loader disabled)
2016-05-02 23:27:18+0000 [local] WARN: Marking request 'Cluster Rebalance' (6303d5ea-4382-40ff-905f-cbca051c7fa9) as failed: java.rmi.UnmarshalException: Error unmarshaling return; nested exception is:
java.lang.ClassNotFoundException: org.apache.cassandra.db.compaction.CompactionInterruptedException (no security manager: RMI class loader disabled)
2016-05-02 23:27:18+0000 [local] ERROR: Rebalance failed: java.rmi.UnmarshalException: Error unmarshaling return; nested exception is:
java.lang.ClassNotFoundException: org.apache.cassandra.db.compaction.CompactionInterruptedException (no security manager: RMI class loader disabled)
2016-05-02 23:27:18+0000 [local] ERROR: Traceback (most recent call last):
Failure: twisted.python.failure.DefaultException: java.rmi.UnmarshalException: Error unmarshaling return; nested exception is:
java.lang.ClassNotFoundException: org.apache.cassandra.db.compaction.CompactionInterruptedException (no security manager: RMI class loader disabled)
2016-05-02 23:27:18+0000 [local] ERROR: Rebalance failed: java.rmi.UnmarshalException: Error unmarshaling return; nested exception is:
java.lang.ClassNotFoundException: org.apache.cassandra.db.compaction.CompactionInterruptedException (no security manager: RMI class loader disabled)
2016-05-02 23:27:18+0000 [local] ERROR: Rolling job failed: java.rmi.UnmarshalException: Error unmarshaling return; nested exception is:
java.lang.ClassNotFoundException: org.apache.cassandra.db.compaction.CompactionInterruptedException (no security manager: RMI class loader disabled)
2016-05-02 23:27:18+0000 [local] ERROR: Traceback (most recent call last):
File "build/lib/python2.7/site-packages/opscenterd/ClusterUtils.py", line 607, in run
DefaultException: java.rmi.UnmarshalException: Error unmarshaling return; nested exception is:
java.lang.ClassNotFoundException: org.apache.cassandra.db.compaction.CompactionInterruptedException (no security manager: RMI class loader disabled)
2016-05-02 23:27:18+0000 [local] ERROR: Rolling job failed: java.rmi.UnmarshalException: Error unmarshaling return; nested exception is:
java.lang.ClassNotFoundException: org.apache.cassandra.db.compaction.CompactionInterruptedException (no security manager: RMI class loader disabled)
2016-05-02 23:27:18+0000 [local] ERROR: Traceback (most recent call last):
File "/usr/share/opscenter/lib/py-debian/2.7/amd64/twisted/internet/defer.py", line 388, in errback
self._startRunCallbacks(fail)
File "/usr/share/opscenter/lib/py-debian/2.7/amd64/twisted/internet/defer.py", line 455, in _startRunCallbacks
self._runCallbacks()
File "/usr/share/opscenter/lib/py-debian/2.7/amd64/twisted/internet/defer.py", line 542, in _runCallbacks
current.result = callback(current.result, *args, **kw)
File "/usr/share/opscenter/lib/py-debian/2.7/amd64/twisted/internet/defer.py", line 1076, in gotResult
_inlineCallbacks(r, g, deferred)
--- <exception caught here> ---
File "/usr/share/opscenter/lib/py-debian/2.7/amd64/twisted/internet/defer.py", line 1018, in _inlineCallbacks
result = result.throwExceptionIntoGenerator(g)
File "/usr/share/opscenter/lib/py-debian/2.7/amd64/twisted/python/failure.py", line 349, in throwExceptionIntoGenerator
return g.throw(self.type, self.value, self.tb)
File "build/lib/python2.7/site-packages/opscenterd/ClusterUtils.py", line 613, in run
File "build/lib/python2.7/site-packages/opscenterd/ClusterUtils.py", line 607, in run
twisted.python.failure.DefaultException: java.rmi.UnmarshalException: Error unmarshaling return; nested exception is:
java.lang.ClassNotFoundException: org.apache.cassandra.db.compaction.CompactionInterruptedException (no security manager: RMI class loader disabled)
That exception likely got thrown because there was already a cleanup running on the node when opscenterd tried to start a cleanup after moving a node during the rebalance. The opscenter agent doesn't have the exception in its class path and so couldn't deserialize it.
To continue, run a repair to make sure the data is everywhere it needs to be, run a cleanup to make sure to avoid a repeat of this issue, and then use opscenter to start another rebalance.

Resources