Skip to content

fix: SchemaSpy 문서 생성 output 권한 실패 수정 - #101

Merged
user983740 merged 1 commit into
mainfrom
fix/schemaspy-output-permission
Jul 4, 2026
Merged

fix: SchemaSpy 문서 생성 output 권한 실패 수정#101
user983740 merged 1 commit into
mainfrom
fix/schemaspy-output-permission

Conversation

@user983740

Copy link
Copy Markdown
Collaborator

문제

PR #100 머지 후 첫 prod 배포에서 SchemaSpy 문서 생성 단계가 실패:

ERROR - IOException
Unable to create directory /output/tables

continue-on-error 로 배포 자체는 성공했으나 이미지에 /schema 문서가 누락됨.

원인

SchemaSpy 컨테이너는 java 유저(이미지 내 uid 1000)로 실행되는데, CI 러너 uid(1001)와 달라
마운트된 output 디렉터리에 쓰지 못함. (로컬은 uid 1000 우연 일치로 통과했었음)

수정

run.sh 에서 output 생성 후 chmod 777 로 uid 의존성 제거.

검증

로컬에서 docker compose run --user 1001:1001 schemaspyCI 조건을 재현
수정 후 exit 0, 15개 테이블 문서 정상 생성 확인.

🤖 Generated with Claude Code

CI 러너(uid 1001)와 SchemaSpy 컨테이너의 java 유저(uid 1000)가 달라
마운트된 output 디렉터리에 쓰지 못해 "Unable to create directory /output/tables"
로 실패했다. run.sh 에서 output 생성 후 chmod 777 로 uid 의존성을 제거.

로컬에서 schemaspy 를 uid 1001 로 강제 실행해 CI 조건 재현 → 픽스 후 정상 생성 확인.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5c26d9106d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread schemaspy/run.sh
# SchemaSpy 컨테이너는 'java'(uid 1000) 유저로 실행된다. CI 러너 등 호스트 uid 가
# 다르면 마운트된 output 에 쓰지 못하므로(=Unable to create directory /output/tables)
# uid 의존성을 없애기 위해 쓰기 권한을 개방한다.
chmod 777 output

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Make generated SchemaSpy files removable on reused workspaces

When ./schemaspy/run.sh gen runs on a host whose user is not the container's uid 1000 and the workspace is reused, this only opens the empty top-level output directory before SchemaSpy writes into it. SchemaSpy then creates nested directories such as output/tables as uid 1000 with its normal non-world-writable directory mode, so the next invocation fails at the earlier rm -rf output before it can reach this chmod. I checked chmod --help; recursive changes require -R, so a post-generation chmod/chown (or running the container as the host uid) is needed to actually remove the uid dependency across repeated runs.

Useful? React with 👍 / 👎.

@user983740
user983740 merged commit f9e373b into main Jul 4, 2026
1 check passed
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.

1 participant