Skip to content

fix(admin): datasource localhost 기본값 제거 및 .env.example 추가 (#115) - #118

Closed
tlgms wants to merge 2 commits into
developfrom
bug/115-admin-datasource-env
Closed

tlgms wants to merge 2 commits into
developfrom
bug/115-admin-datasource-env

Conversation

@tlgms

@tlgms tlgms commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • admin 서비스가 배포 환경에서 DB 연결 오류로 기동 실패하는 문제에 대해, 원인을 바로 드러내도록 datasource 설정을 정리하고 필요한 환경변수를 문서화한다.

Related Issue

Root Cause

  • admin-bootstrap/application.yaml 의 datasource 만 유일하게 ${DB_URL:jdbc:mysql://localhost:3306/admin_db...} 처럼 로컬 기본값을 가지고 있었다.
  • 환경변수가 누락되면 컨테이너 안의 localhost:3306 으로 접속을 시도해 Communications link failure 만 남고, 무엇이 빠졌는지 로그로 알 수 없었다.
  • systems/admin/.env.example 이 없어 필요한 변수 목록도 문서화되어 있지 않았다 (run-service.sh 는 systems/admin/.env 를 요구한다).
  • 서버의 .env.admin 은 저장소에서 확인할 수 없어 실제 누락 여부는 배포 담당자 확인이 필요하다.

Fix Description

  • DB_URL, DB_USERNAME, DB_PASSWORD 의 기본값을 제거해 identity / application / notification / configuration 과 동일하게 선언.
  • systems/admin/.env.example 추가 (DB, admission 정원, storage 변수. schema.sql 선적용이 필요하다는 안내 포함).

Testing

  • Reproduced before fix
  • Verified after fix
  • Test details:
    • DB 환경변수 없이 기동 → Driver com.mysql.cj.jdbc.Driver claims to not accept jdbcUrl, ${DB_URL} 로 즉시 실패하며 미해석 변수명이 로그에 드러남.
    • 로컬 MySQL 8 컨테이너에 schema.sql 적용 후 .env.example 값으로 기동 → Started AdminBootstrapApplication 확인 (ddl-auto: validate 통과, schema.sql 이 현재 엔티티와 일치함도 확인).

Risk & Impact

  • Risk level: Low
  • Affected areas: admin 기동 설정. 기본값에 의존해 환경변수 없이 실행하던 로컬 환경은 systems/admin/.env 를 만들어야 한다.

배포 담당자 확인 사항

Checklist

  • No new regressions introduced
  • Edge cases considered
  • Logs / error handling updated if needed

🤖 Generated with Claude Code

DB_URL/DB_USERNAME/DB_PASSWORD 가 빠지면 컨테이너 안의 localhost:3306 으로 붙으려다
connection refused 가 나서 원인을 찾기 어려웠다. 다른 서비스와 동일하게 기본값 없이
선언해 누락 시 기동 로그에 바로 드러나도록 하고, 필요한 환경변수를 .env.example 로 문서화한다.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 9, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (1)
  • ready-for-review
🚫 Excluded labels (none allowed) (2)
  • wip
  • do-not-review

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 412f64e3-170a-4112-b162-898fd6614f97

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

kusuri12-09
kusuri12-09 previously approved these changes Sep 9, 2026
…source-env

systems/admin/.env.example 은 develop 에서 #135 로 먼저 추가되어 add/add 충돌이 났다.
develop 버전을 그대로 쓴다. 이 브랜치 버전은 #127 로 사라진 정원 환경변수와
Flyway 도입(#111) 전의 schema.sql 수동 적용 안내를 담고 있어 낡았다.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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

Successfully merging this pull request may close these issues.

admin 서비스 DB 연결 오류: datasource localhost 기본값 및 .env.example 부재

2 participants