queue worker가 open_basedir 제한에 걸린 사례

humanpchumanpc ·
05-2036
최근 open_basedir 제한 환경에서 queue worker가 정상 동작하지 않는 사례를 확인했습니다. 초기에는 단순 permission 문제처럼 보였지만, 실제로는 CLI runtime과 PHP-FPM runtime의 open_basedir 범위 차이 때문에 worker가 특정 filesystem 경로에 접근하지 못하고 있었습니다. 특히 queue worker는: - cache - session - log - bootstrap cache - temporary file - compiled container 등 다양한 runtime path에 접근하기 때문에, open_basedir 제한 환경에서는 filesystem 범위 차이가 쉽게 runtime failure로 이어질 수 있었습니다. 현재 확인한 주요 증상은 다음과 같습니다. - queue job 처리 중 filesystem warning 발생 - storage 접근 실패 - bootstrap cache 접근 실패 - log write 실패 - worker silently fail 상태 발생 - supervisor에서는 실행되지만 실제 job 처리 실패 - CLI에서는 정상인데 daemon runtime에서 실패 특히 일부 환경에서는: filesystem warning → ErrorException 전환 → queue worker 중단 형태로 이어질 가능성도 확인했습니다. 현재는 다음 부분을 중심으로 계속 정리 중입니다. 1. CLI / PHP-FPM runtime path alignment 현재 환경에서는: - PHP-FPM - CLI - supervisor daemon 사이의 runtime path 범위를 최대한 일치시키는 방향을 우선 검토 중입니다. 특히: - storage - bootstrap/cache - runtime temp - log path 등 writable path consistency를 중요하게 보고 있습니다. 2. runtime-safe filesystem 접근 queue worker 내부에서도: - file_exists() - is_readable() - file_get_contents() - storage 접근 등이 제한 환경에서 실패할 수 있기 때문에, runtime-safe helper 방향을 계속 정리 중입니다. 3. worker failure와 서비스 실패 분리 현재는 일부 worker runtime failure가 발생하더라도: - HTTP 서비스 유지 - dashboard 유지 - queue backlog 관리 가능 - graceful degradation 유지 방향을 우선적으로 보고 있습니다. 특히 제한 환경에서는: - open_basedir - restricted filesystem - shared hosting - hardened PHP runtime - container/chroot 등이 충분히 실제 운영 환경에서 발생 가능한 상태라고 판단했습니다. 4. 추가 확인 중인 항목 현재 추가로 계속 확인 중인 부분: - queue retry consistency - failed_jobs 처리 - supervisor restart loop - daemon cwd 문제 - storage symbolic link 접근 - fallback log write path - disabled shell_exec 환경 현재는 queue worker runtime이 제한 환경에서도 안정적으로 유지되도록 runtime-safe 방향으로 계속 구조를 정리 중입니다.

Comments and actions are deferred

Load the comment and action area when you need it. Comments: 0