Keycloak restart on aws dev environment

hi guys im using keycloak from a custom docker Quay image that i already configured to use an external postgresql database, with standalone.xml, locally it works fine and i have used this environment variables for the keycloak container
DB_VENDOR
DB_ADDR
DB_DATABASE
DB_USER
DB_SCHEMA
DB_PASSWORD
KEYCLOAK_USER
KEYCLOAK_PASSWORD
KEYCLOAK_STATISTICS
and this for the postgresql container
POSTGRES_DB
POSTGRES_USER
POSTGRES_PASSWORD

im doing a deployment with terraform to create the following AWS resouces
ECS
ECR
Alb
Ec2
RDS
route53
acm
network resources (public and private subnets, vpc, internet gateway, nat gateway, eips, route tables)
when the deployment its done the applications shows the following logs
“Added ‘administr4tor’ to ‘/opt/jboss/keycloak/standalone/configuration/keycloak-add-user.json’, restart server to load user”
then it restart the fargate task definition and it got cycled
As the docker image stored on ECR is working locally i think that i may be missing a configuration, does someone knows what the problem may be ?

By the way if i do the deployment with the keycloak docker image with the embed database it works fine on the dev environment.

Can you post some logs?

sure this are the logs that keycloak shows when i do the deployment

2021-11-23 08:06:34e[0me[0m14:06:34,879 INFO [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0039: Creating http management service using socket-binding (management-http)
2021-11-23 08:06:34e[0me[0m14:06:34,079 INFO [org.jboss.as.controller.management-deprecated] (ServerService Thread Pool – 23) WFLYCTL0028: Attribute ‘security-realm’ in the resource at address ‘/subsystem=undertow/server=default-server/https-listener=https’ is deprecated, and may be removed in a future version. See the attribute description in the output of the read-resource-description operation to learn more about the deprecation.
2021-11-23 08:06:33e[0me[0m14:06:33,575 INFO [org.jboss.as.controller.management-deprecated] (Controller Boot Thread) WFLYCTL0028: Attribute ‘security-realm’ in the resource at address ‘/core-service=management/management-interface=http-interface’ is deprecated, and may be removed in a future version. See the attribute description in the output of the read-resource-description operation to learn more about the deprecation.
2021-11-23 08:06:31e[0me[0m14:06:31,574 INFO [org.jboss.as.controller.management-deprecated] (ServerService Thread Pool – 15) WFLYCTL0033: Extension ‘security’ is deprecated and may not be supported in future versions
2021-11-23 08:06:29e[0me[0m14:06:29,887 INFO [org.wildfly.security] (ServerService Thread Pool – 22) ELY00001: WildFly Elytron version 1.15.3.Final
2021-11-23 08:06:25e[0me[0m14:06:25,583 INFO [org.jboss.vfs] (MSC service thread 1-2) VFS000002: Failed to clean existing content for temp file provider of type temp. Enable DEBUG level log to find what caused this
2021-11-23 08:06:25e[0me[32m14:06:25,066 DEBUG [org.jboss.as.config] (MSC service thread 1-2) VM Arguments: -D[Standalone] -Xms64m -Xmx512m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true --add-exports=java.base/sun.nio.ch=ALL-UNNAMED --add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED --add-exports=jdk.unsupported/sun.reflect=ALL-UNNAMED -Dorg.jboss.boot.log.file=/opt/jboss/keycloak/standalone/log/server.log -Dlogging.configuration=file:/opt/jboss/keycloak/standalone/configuration/logging.properties
2021-11-23 08:06:24e[0me[32m14:06:24,981 DEBUG [org.jboss.as.config] (MSC service thread 1-2) Configured system properties:
2021-11-23 08:06:24[Standalone] =
2021-11-23 08:06:24awt.toolkit = sun.awt.X11.XToolkit
2021-11-23 08:06:24file.encoding = UTF-8
2021-11-23 08:06:24file.separator = /
2021-11-23 08:06:24java.awt.graphicsenv = sun.awt.X11GraphicsEnvironment
2021-11-23 08:06:24java.awt.headless = true
2021-11-23 08:06:24java.awt.printerjob = sun.print.PSPrinterJob
2021-11-23 08:06:24java.class.path = /opt/jboss/keycloak/jboss-modules.jar
2021-11-23 08:06:24java.class.version = 55.0
2021-11-23 08:06:24java.home = /usr/lib/jvm/java-11-openjdk-11.0.12.0.7-0.el8_4.x86_64
2021-11-23 08:06:24java.io.tmpdir = /tmp
2021-11-23 08:06:24java.library.path = /usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib
2021-11-23 08:06:24java.net.preferIPv4Stack = true
2021-11-23 08:06:24java.runtime.name = OpenJDK Runtime Environment
2021-11-23 08:06:24java.runtime.version = 11.0.12+7-LTS
2021-11-23 08:06:24java.specification.name = Java Platform API Specification
2021-11-23 08:06:24java.specification.vendor = Oracle Corporation
2021-11-23 08:06:24java.specification.version = 11
2021-11-23 08:06:24java.util.logging.manager = org.jboss.logmanager.LogManager
2021-11-23 08:06:24java.vendor = Red Hat, Inc.
2021-11-23 08:06:24java.vendor.url = https://www.redhat.com/
2021-11-23 08:06:24java.vendor.url.bug = Log in to Red Hat Bugzilla
2021-11-23 08:06:24java.vendor.version = 18.9
2021-11-23 08:06:24java.version = 11.0.12
2021-11-23 08:06:24java.version.date = 2021-07-20
2021-11-23 08:06:24java.vm.compressedOopsMode = 32-bit
2021-11-23 08:06:24java.vm.info = mixed mode, sharing
2021-11-23 08:06:24java.vm.name = OpenJDK 64-Bit Server VM
2021-11-23 08:06:24java.vm.specification.name = Java Virtual Machine Specification
2021-11-23 08:06:24java.vm.specification.vendor = Oracle Corporation
2021-11-23 08:06:24java.vm.specification.version = 11
2021-11-23 08:06:24java.vm.vendor = Red Hat, Inc.
2021-11-23 08:06:24java.vm.version = 11.0.12+7-LTS
2021-11-23 08:06:24javax.management.builder.initial = org.jboss.as.jmx.PluggableMBeanServerBuilder
2021-11-23 08:06:24jboss.bind.address = 0.0.0.0
2021-11-23 08:06:24jboss.bind.address.management = 0.0.0.0
2021-11-23 08:06:24jboss.bind.address.private = 10.1.10.112
2021-11-23 08:06:24jboss.home.dir = /opt/jboss/keycloak
2021-11-23 08:06:24jboss.host.name = ip-10-1-10-112
2021-11-23 08:06:24jboss.modules.dir = /opt/jboss/keycloak/modules
2021-11-23 08:06:24jboss.modules.system.pkgs = org.jboss.byteman
2021-11-23 08:06:24jboss.node.name = ip-10-1-10-112
2021-11-23 08:06:24jboss.qualified.host.name = ip-10-1-10-112.ec2.internal
2021-11-23 08:06:24jboss.server.base.dir = /opt/jboss/keycloak/standalone
2021-11-23 08:06:24jboss.server.config.dir = /opt/jboss/keycloak/standalone/configuration
2021-11-23 08:06:24jboss.server.data.dir = /opt/jboss/keycloak/standalone/data
2021-11-23 08:06:24jboss.server.deploy.dir = /opt/jboss/keycloak/standalone/data/content
2021-11-23 08:06:24jboss.server.log.dir = /opt/jboss/keycloak/standalone/log
2021-11-23 08:06:24jboss.server.name = ip-10-1-10-112
2021-11-23 08:06:24jboss.server.persist.config = true
2021-11-23 08:06:24jboss.server.temp.dir = /opt/jboss/keycloak/standalone/tmp
2021-11-23 08:06:24jdk.debug = release
2021-11-23 08:06:24line.separator =
2021-11-23 08:06:24logging.configuration = file:/opt/jboss/keycloak/standalone/configuration/logging.properties
2021-11-23 08:06:24module.path = /opt/jboss/keycloak/modules
2021-11-23 08:06:24org.jboss.boot.log.file = /opt/jboss/keycloak/standalone/log/server.log
2021-11-23 08:06:24org.jboss.resolver.warning = true
2021-11-23 08:06:24os.arch = amd64
2021-11-23 08:06:24os.name = Linux
2021-11-23 08:06:24os.version = 4.14.248-189.473.amzn2.x86_64
2021-11-23 08:06:24path.separator = :
2021-11-23 08:06:24sun.arch.data.model = 64
2021-11-23 08:06:24sun.boot.library.path = /usr/lib/jvm/java-11-openjdk-11.0.12.0.7-0.el8_4.x86_64/lib
2021-11-23 08:06:24sun.cpu.endian = little
2021-11-23 08:06:24sun.cpu.isalist =
2021-11-23 08:06:24sun.io.unicode.encoding = UnicodeLittle
2021-11-23 08:06:24sun.java.command = /opt/jboss/keycloak/jboss-modules.jar -mp /opt/jboss/keycloak/modules org.jboss.as.standalone -Djboss.home.dir=/opt/jboss/keycloak -Djboss.server.base.dir=/opt/jboss/keycloak/standalone -Djboss.bind.address=169.254.172.2 -Djboss.bind.address.private=169.254.172.2 -Djboss.bind.address=10.1.10.112 -Djboss.bind.address.private=10.1.10.112 -Djboss.bind.address.management=0.0.0.0 -c=standalone-ha.xml -b 0.0.0.0
2021-11-23 08:06:24sun.java.launcher = SUN_STANDARD
2021-11-23 08:06:24sun.jnu.encoding = UTF-8
2021-11-23 08:06:24sun.management.compiler = HotSpot 64-Bit Tiered Compilers
2021-11-23 08:06:24sun.os.patch.level = unknown
2021-11-23 08:06:24user.country = US
2021-11-23 08:06:24user.dir = /
2021-11-23 08:06:24user.home = /opt/jboss
2021-11-23 08:06:24user.language = en
2021-11-23 08:06:24user.name = jboss
2021-11-23 08:06:24user.timezone = GMT
2021-11-23 08:06:24e[0me[0m14:06:24,977 INFO [org.jboss.as] (MSC service thread 1-2) WFLYSRV0049: Keycloak 15.0.2 (WildFly Core 15.0.1.Final) starting
2021-11-23 08:06:24e[0me[0m14:06:24,374 INFO [org.jboss.threads] (main) JBoss Threads version 2.4.0.Final
2021-11-23 08:06:24e[0me[0m14:06:24,286 INFO [org.jboss.msc] (main) JBoss MSC version 1.4.12.Final
2021-11-23 08:06:21e[0m14:06:21,579 INFO [org.jboss.modules] (main) JBoss Modules version 1.11.0.Final
2021-11-23 08:06:19=========================================================================
2021-11-23 08:06:19JBoss Bootstrap Environment
2021-11-23 08:06:19JBOSS_HOME: /opt/jboss/keycloak
2021-11-23 08:06:19JAVA: java
2021-11-23 08:06:19JAVA_OPTS: -server -Xms64m -Xmx512m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true --add-exports=java.base/sun.nio.ch=ALL-UNNAMED --add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED --add-exports=jdk.unsupported/sun.reflect=ALL-UNNAMED
2021-11-23 08:06:19=========================================================================
2021-11-23 08:06:18=========================================================================
2021-11-23 08:06:18Using PostgreSQL database
2021-11-23 08:06:18=========================================================================
2021-11-23 08:06:18-b 0.0.0.0
2021-11-23 08:06:18Added ‘administr4tor’ to ‘/opt/jboss/keycloak/standalone/configuration/keycloak-add-user.json’, restart server to load user