Files
CODE_ASSISTANT/docs/troubleshootings/2026-09-17-customer-deploy-first.md

2.5 KiB

고객사 첫 배포에서 걸린 것들 (2026-09-17, -12 컨테이너)

한 번에 안 되고 순서대로 다섯 군데 걸림. 다음에 다른 컨테이너 갈 때 그대로 밟을 것.

증상 원인 조치
pip install 실패 — pytest 없음 컨테이너 인터넷 없음. -13 의 offline wheels 에 테스트 패키지는 없음 grep -v pytest requirements.txt > req-run.txt 로 설치
OpenCode "cannot connect to API" render_opencode.py 기본 BACKEND_PORT=8001 인데 Django 를 8080 에 띄움 .envBACKEND_PORT=8080 넣고 다시 렌더
Django UnicodeEncodeError: 'ascii' 컨테이너 로케일 ASCII PYTHONUTF8=1 붙여서 uvicorn 기동 (ABAP_OPENCODE run.sh 도 같음)
FabriX 호출 시 httpx _normalize_header_key 에서 UnicodeEncodeError .env.example 줄 끝 한글 주석을 파서가 값으로 읽어 HTTP 헤더에 실림 파서에서 # 뒤 제거(config/settings.py), .env.example 주석 삭제
FabriX 전부 401 .env 에 붙여넣은 토큰 앞에 ' 하나가 딸려 들어감(짝 안 맞아 파서가 못 뗌) + 토큰은 Bearer 접두 필수 따옴표 sed 로 제거, AAF_FABRIX_TOKEN_PREFIX=bearer
설치 exe 메일 반입 시 잘림(3,148KB→2,699KB) 메일 시스템이 exe 를 자름. 압축·이름변경 무관 msi 를 4조각 .txt 로 쪼개 보내고 copy /b 로 합침, MD5 대조

배포 절차 (정리본)

# PC: -13 부품 꺼내서 -12 로
scp -P 8916 -r root@10.196.81.34:/www/abap-ito/offline/wheels ./wheels
scp -P 8916 root@10.196.81.34:/www/abap-ito/bin/opencode ./opencode-bin
scp -P 8912 -r ABAP_CODE_ASSISTANT wheels opencode-bin root@10.196.81.34:/www/
# -12
cd /www/ABAP_CODE_ASSISTANT && python3 _*.py          # 메일 zip 이면 이름 복원
cd 5_django_backend && python3 -m venv .venv
grep -v pytest requirements.txt > req-run.txt
.venv/bin/pip install --no-index --find-links /www/wheels -r req-run.txt
cp .env.example .env && vi .env                       # AAF_FABRIX_* 4개, BACKEND_PORT=8080. 따옴표·주석 없이
.venv/bin/python manage.py migrate
.venv/bin/python opencode/render_opencode.py
chmod +x /www/opencode-bin; mkdir -p logs
(cd opencode && nohup /www/opencode-bin serve --hostname 127.0.0.1 --port 4096 > ../logs/opencode.log 2>&1 &)
PYTHONUTF8=1 nohup .venv/bin/uvicorn config.asgi:application --host 0.0.0.0 --port 8080 > logs/django.log 2>&1 &
curl -s http://127.0.0.1:8080/api/ito/models

포트: -12 안 8080 → 바깥 8914. 앱은 http://10.196.81.34:8914/api/v1 로 빌드됨.