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

RDM-cas-overlayの起動に失敗する。 #525

Open
hiroyuki-sato opened this issue Aug 15, 2024 · 0 comments
Open

RDM-cas-overlayの起動に失敗する。 #525

hiroyuki-sato opened this issue Aug 15, 2024 · 0 comments

Comments

@hiroyuki-sato
Copy link

RDM-osf.io: bd5b4db
RDM-cas-overlay: 7c97d3b2ce5a4e32252ff61967ccd07cd07c7823

現象

事前にビルドした、RDM-cas-overlayのイメージを指定するようにdocker-compose.override.ymlを作成しておく(後述)

docker-compose up cas とすると以下のエラーが発生する。(エラーの詳細は添付ファイル)

Could not resolve placeholder 'osf.api.institutions.login.availability.url' in string value "${osf.api.institutions.login.availability.url}"; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'osf.api.institutions.login.availability.url' in string value "${osf.api.institutions.login.availability.url}"

原因

docker-compose.ymlで以下の記述がされており、casが利用する設定ファイルがRDM-osf.ioの設定ファイルで
オーバライドされるようになっている。

services
# 中略
  cas:
    # cas-overlay: Dummy Image
    image: rcosdp/cas-overlay:master
    ports:
      - 8080:8080
    depends_on:
      - postgres
      - caspostgres
    volumes:
      - ./etc/cas-overlay/cas.properties:/code/etc/cas.properties:ro # <-- これ
    stdin_open: true

オリジナルの設定ファイルには入っている、osf.api.institutions.login.availability.url の記述がないため
エラーになる。

diff -u etc/cas-overlay/cas.properties ../RDM-cas-overlay/etc/cas.properties
--- etc/cas-overlay/cas.properties	2024-08-15 11:08:07.261026451 +0900
+++ ../RDM-cas-overlay/etc/cas.properties	2024-08-15 09:12:07.875259168 +0900
@@ -102,7 +102,7 @@
 # OSF Postgres Database
 #
 osf.database.driverClass=org.postgresql.Driver
-osf.database.url=jdbc:postgresql://postgres:5432/osf?sslmode=disable
+osf.database.url=jdbc:postgresql://192.168.168.167:5432/osf?targetServerType=master
 osf.database.user=postgres
 osf.database.password=
 osf.database.hibernate.dialect=io.cos.cas.adaptors.postgres.hibernate.OSFPostgreSQLDialect
@@ -152,7 +152,7 @@
 database.hibernate.batchSize=1
 database.hibernate.showSql=true
 database.driverClass=org.postgresql.Driver
-database.url=jdbc:postgresql://caspostgres:5432/cas?sslmode=disable
+database.url=jdbc:postgresql://127.0.0.1:5432/cas?targetServerType=master
 database.user=postgres
 database.password=

@@ -337,3 +337,6 @@
 #
 # URL to which the user will be redirected to change the password.
 # password.policy.url=https://password.example.edu/change
+
+## Login Availability API
+osf.api.institutions.login.availability.url=http://localhost:8000/api/v2/institutions/login_availability/

暫定対応

etc/cas-overlay/cas.properties に以下の記述を追加する。

git diff etc/cas-overlay/cas.properties
diff --git a/etc/cas-overlay/cas.properties b/etc/cas-overlay/cas.properties
index 4122dda2ae..f406bf5e6c 100644
--- a/etc/cas-overlay/cas.properties
+++ b/etc/cas-overlay/cas.properties
@@ -337,3 +337,6 @@ metrics.refresh.internal=9999s
 #
 # URL to which the user will be redirected to change the password.
 # password.policy.url=https://password.example.edu/change
+
+## Login Availability API
+osf.api.institutions.login.availability.url=http://localhost:8000/api/v2/institutions/login_availability/

RDM-cas-overlayのビルド

( cd RDM-cas-overlay ; docker build -t rdm-cas-overlay . )

docker-compose.override.yml

services:
  #################
  # CAS           #
  #################
  cas:
    image: rdm-cas-overlay

error.txt

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

1 participant