자체 호스팅 이미지가 커밋되지 않아 발행 글이 404되던 원인 - #59
Merged
Merged
Conversation
증상 ──── 발행된 글 5편 이상이 kevinlee7250.github.io/cli/images/<해시>를 가리키는데 그 파일이 저장소에 없었습니다(HTTP 404). 독자 화면에서 그림이 깨집니다. image_audit이 broken으로 잡아 썸네일로 강등시키지만, 원인을 막지 않으면 다음 실행에서 또 생깁니다. 원인 ──── 글을 다시 생성해 발행하는 워크플로 두 개가 이미지 파일을 커밋하지 않았습니다. auto-repair.yml python main.py --retry → retry_failed_posts → generate_post → _collect_post_images → fetch_images_for_queries → _self_host: docs/images에 파일을 쓰고 본문 src를 우리 도메인으로 바꾼 뒤 Blogger에 발행 → 커밋 단계에는 소스와 post_drafts만 있음 fix-posts.yml fix_existing_posts.py도 generate_post를 부르는데 커밋 대상은 리포트 3개뿐 러너가 사라지면 파일도 사라집니다. 글은 이미 나갔으니 되돌릴 수 없습니다. 두 워크플로 모두 내내 초록이었습니다. 막는 방법 ───────── 두 워크플로가 docs/images/와 image_mirror.json을 함께 커밋합니다. 재발 방지 검사도 붙였습니다. 자체 호스팅 경로에 닿는 스크립트를 돌리는 워크플로는 반드시 그 둘을 커밋해야 합니다. 대상 모듈은 손으로 적지 않고 호출·import 이름으로 계산합니다 — 손으로 적으면 새 호출부가 생겼을 때 조용히 비켜 갑니다. 판정 범위를 좁히는 데 두 번 실패했습니다. import 전이 폐포는 워크플로 31개를 걸어 무의미했고(config 하나만 같이 써도 이어짐), 모듈 단위 한 단계 확장은 이미지를 전혀 안 받는 shorts_generator·author_profile_check까지 걸었습니다. generate_title_thumbnail은 imgbb·data URI를 써서 파일을 남기지 않는다는 것도 코드에서 확인했습니다. 지금은 이름 기준으로 18개 모듈만 잡습니다. 검사 자체도 한 번 헛돌았습니다. 처음에는 파일에 경로 문자열이 있는지만 봐서, 제가 넣은 설명 주석 때문에 git add 줄을 지워도 통과했습니다. 주석을 걷어내고 다시 확인하니 두 워크플로 모두 실패합니다. 함께: NOT_YET_GENERATED에 남아 있던 adsense_revenue.json 제거 — 파일이 생성돼 이 목록이 낡았습니다(이 커밋 전부터 실패하던 검사). 1351 passed, 2 skipped. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RgLYqM9puPW1aqHTccbX69
Kevinlee7250
marked this pull request as ready for review
September 1, 2026 14:39
Uh oh!
There was an error while loading. Please reload this page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
증상
발행된 글 5편 이상이
kevinlee7250.github.io/cli/images/<해시>를 가리키는데 그 파일이 저장소에 없습니다(HTTP 404). 독자 화면에서 그림이 깨집니다.image_audit이broken으로 잡아 썸네일로 강등시키지만, 원인을 막지 않으면 다음 실행에서 또 생깁니다.원인
글을 다시 생성해 발행하는 워크플로 두 개가 이미지 파일을 커밋하지 않았습니다.
러너가 사라지면 파일도 사라집니다. 글은 이미 나갔으니 영구 404입니다. 두 워크플로 모두 내내 초록이었습니다.
막는 방법
두 워크플로가
docs/images/와image_mirror.json을 함께 커밋합니다.재발 방지 검사(
test_self_hosted_images_are_committed.py)도 붙였습니다 — 자체 호스팅 경로에 닿는 스크립트를 돌리는 워크플로는 반드시 그 둘을 커밋해야 합니다. 대상 모듈은 손으로 적지 않고 호출·import 이름으로 계산합니다. 손으로 적으면 새 호출부가 생겼을 때 검사가 조용히 비켜 갑니다.판정 범위를 좁히는 데 두 번 실패했습니다
config하나만 같이 써도 이어집니다.shorts_generator·author_profile_check·adsense_audit까지 걸렸습니다.generate_title_thumbnail은 imgbb·data URI를 써서 파일을 남기지 않는다는 것을 코드에서 확인하고 제외했습니다.검사 자체도 한 번 헛돌았습니다
처음에는 워크플로 파일에 경로 문자열이 있는지만 봤습니다. 그런데 제가 넣은 설명 주석에
docs/images가 들어 있어서,git add줄을 지워도 통과했습니다. 주석을 걷어내고 다시 확인하니 두 워크플로 모두 실패합니다.확인
git add -f docs/images/를 양쪽에서 지워 각각 실패 → 복원 후 통과1351 passed, 2 skipped함께 고친 것
NOT_YET_GENERATED에서adsense_revenue.json제거 — 파일이 생성돼 목록이 낡았습니다. 이 커밋 전부터 실패하던 검사이고(origin/latest에서 확인), 검사가 맞는 말을 하고 있어 함께 고쳤습니다.참고로 그 파일 내용은
available: false이고 사유가refresh_token에 adsense.readonly 권한이 없습니다입니다. AdSense가 미승인 상태라 급하지는 않지만, 승인 후에는 토큰 재발급이 필요합니다(로컬에서만 가능).🤖 Generated with Claude Code
https://claude.ai/code/session_01RgLYqM9puPW1aqHTccbX69
Generated by Claude Code