[error] Reading package lists... Error!

parkjh9370·2022년 5월 25일
0

🔎 배포 된 서버의 이미지 파일 업로드 기능이 되지 않아 ubuntu 접속 후 로그들을 살펴보던 중 서버 종료 후 재시작하려 했지만 다음과 같은 에러 발생

root@ip-172-31-37-60:/home/ubuntu/server# npm start
npm ERR! code ENOSPC
npm ERR! syscall write
npm ERR! errno -28
npm ERR! nospc ENOSPC: no space left on device, write
npm ERR! nospc There appears to be insufficient space on your system to finish.
npm ERR! nospc Clear up some disk space and try again.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2022-05-25T09_20_40_235Z-debug-0.log
  • 서버 용량이 부족하거나 사용할 리소스가 충분치 않다고 생각하여 사용하지 않은 파일들을 제거 하기로 결정
root@ip-172-31-37-60:/home/ubuntu/server# sudo apt-get purge 
  • 하지만 다음과 같은 에러가 발생하며 명령어가 먹히지 않는다.
  • 이후 다른 명령어도 입력해 봤지만 아예 명령어 자체가 전달되지 않고 해당 에러를 뿜어냄
Reading package lists... Error!
E: Write error - write (28: No space left on device)
E: IO Error saving source cache
E: The package lists or status file could not be parsed or opened.

구글링을 통해 해당 에러 The package lists or status file could not be parsed or opened 입력

sudo rm /var/lib/apt/lists/* -vf
sudo apt-get clean
sudo apt-get update

참조: https://askubuntu.com/questions/410045/the-package-lists-or-status-file-could-not-be-parsed-or-opened

apt-get을 비워준 후, 정상적으로 서버가 실행되는 것을 확인할 수 있었다.

아마 apt-get에 캐쉬된 데이터가 너무 많아 명령어를 수행할 수 있는 리소스가 더 이상 남아 있지 않아 발생한 오류로 생각된다.

또한, 해당 에러가 발생했을 시 무중단 배포 기능을 하는 pm2도 일부 기능을 수행할 수 없는 것 같다.
( 내 경우 클라이언트에서 사진을 업로드 했을 때 500번 에러를 뱉어냈고, 서버로는 요청 후 로그가 찍히지 않았다.)

0개의 댓글