在 plesk 的 docker 容器上运行 keycloak 服务器的问题

Posted

技术标签:

【中文标题】在 plesk 的 docker 容器上运行 keycloak 服务器的问题【英文标题】:issues running keycloak server on docker container in plesk 【发布时间】:2020-09-22 10:05:33 【问题描述】:

所以我试图在 docker 容器中的 Plesk 服务器上运行 Keycloak 服务器。

问题是我的 keycloak 服务器在一段时间后死了(或在某个操作之后,我不确定,因为没有记录任何内容),我进入日志的所有内容都是

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.wildfly.extension.elytron.SSLDefinitions (jar:file:/opt/jboss/keycloak/modules/system/layers/base/org/wildfly/extension/elytron/main/wildfly-elytron-integration-11.1.1.Final.jar!/) to method com.sun.net.ssl.internal.ssl.Provider.isFIPS()
WARNING: Please consider reporting this to the maintainers of org.wildfly.extension.elytron.SSLDefinitions
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
*** JBossAS process (340) received KILL signal ***

我将所需的环境设置 PROXY_ADDRESS_FORWARDING 设置为 true,我很确定我正确地遵循了 https://github.com/keycloak/keycloak-containers/blob/10.0.2/server/README.md 上的说明

我尝试过使用和不使用 TLS 设置,但它仍然会在大约 5 分钟后死掉

这里是设置为极端详细日志记录后的一些额外日志转储

[0m16:51:30,688 TRACE [org.jboss.modules] (ServerService Thread Pool -- 63) Attempting to find all resources META-INF/jpa-changelog-1.2.0.Beta1-db2.xml in Module "org.keycloak.keycloak-model-jpa" version 10.0.2 from local module loader @797cf65c (finder: local module finder @31bcf236 (roots: /opt/jboss/keycloak/modules,/opt/jboss/keycloak/modules/system/layers/keycloak,/opt/jboss/keycloak/modules/system/layers/base))
[0m16:51:30,705 TRACE [org.jboss.modules] (ServerService Thread Pool -- 63) Attempting to find all resources liquibase/parser/core/xml/dbchangelog-3.1.xsd in Module "org.keycloak.keycloak-model-jpa" version 10.0.2 from local module loader @797cf65c (finder: local module finder @31bcf236 (roots: /opt/jboss/keycloak/modules,/opt/jboss/keycloak/modules/system/layers/keycloak,/opt/jboss/keycloak/modules/system/layers/base))
[0m16:51:30,770 TRACE [org.jboss.modules] (ServerService Thread Pool -- 63) Attempting to find all resources META-INF/jpa-changelog-1.2.0.CR1.xml in Module "org.keycloak.keycloak-model-jpa" version 10.0.2 from local module loader @797cf65c (finder: local module finder @31bcf236 (roots: /opt/jboss/keycloak/modules,/opt/jboss/keycloak/modules/system/layers/keycloak,/opt/jboss/keycloak/modules/system/layers/base))
[0m16:51:30,771 TRACE [org.jboss.modules] (ServerService Thread Pool -- 63) Attempting to find all resources liquibase/parser/core/xml/dbchangelog-3.1.xsd in Module "org.keycloak.keycloak-model-jpa" version 10.0.2 from local module loader @797cf65c (finder: local module finder @31bcf236 (roots: /opt/jboss/keycloak/modules,/opt/jboss/keycloak/modules/system/layers/keycloak,/opt/jboss/keycloak/modules/system/layers/base))
[0m16:51:30,882 TRACE [org.jboss.modules] (ServerService Thread Pool -- 63) Attempting to find all resources META-INF/jpa-changelog-1.2.0.CR1-db2.xml in Module "org.keycloak.keycloak-model-jpa" version 10.0.2 from local module loader @797cf65c (finder: local module finder @31bcf236 (roots: /opt/jboss/keycloak/modules,/opt/jboss/keycloak/modules/system/layers/keycloak,/opt/jboss/keycloak/modules/system/layers/base))
[0m16:51:30,904 TRACE [org.jboss.modules] (ServerService Thread Pool -- 63) Attempting to find all resources liquibase/parser/core/xml/dbchangelog-3.1.xsd in Module "org.keycloak.keycloak-model-jpa" version 10.0.2 from local module loader @797cf65c (finder: local module finder @31bcf236 (roots: /opt/jboss/keycloak/modules,/opt/jboss/keycloak/modules/system/layers/keycloak,/opt/jboss/keycloak/modules/system/layers/base))
[0m*** JBossAS process (148) received KILL signal ***

编辑:所以 def 似乎与 Java 发生 OOM 崩溃有关

【问题讨论】:

【参考方案1】:

可能有点晚了,就我而言,这个错误发生在我使用jboss/keycloak v14.0时。

我将它与Plesk and Docker proxy https://<hostname>/auth 一起使用。

它以前可以工作(使用 v13.0)

所以,即使v13.1 也给了我同样的错误。

最后,我决定切换回 jboss/keycloak v13.0。

/!\ - 准备好丢失数据,或在测试时将容器卷映射到主机。

【讨论】:

以上是关于在 plesk 的 docker 容器上运行 keycloak 服务器的问题的主要内容,如果未能解决你的问题,请参考以下文章

Django + Plesk + Apache - 在某些 url 上禁止 403 但 404 的显示应用程序正在运行...?

在 Plesk 中运行 Laravel 5.1 任务计划程序

如何以编程方式(在 Docker 上)获取运行容器的容器 ID?

Centos7上运行Docker容器

Kubernetes:如何从 Docker 容器 A 在 Docker 容器 B 上运行 Bash 命令

无法从远程 docker 容器监听 docker 容器内运行的服务