본문 바로가기

TIL

TIL 24.04.24 System limit for number of file watchers reached 에러

1. 문제점

 

이번에도 기능 구현 후 빌드를 했다. 빌드과정에서 문제는 없어보였는데 배포한 사이트에 접속해보니 502 bad gateway 가 떴음. 이번에는 무슨 일인가 싶어 서버로그를 확인했는데 Error: System limit for number of file watchers reached ...  에러가 발생하였다. 이후에 파일경로가 있길래 그 파일은 건드리지도 않고 빌드했는데 대체 무슨문제인가 해서 구글 검색을 해보았다.

 

2. 해결방안

 

React 처럼 프론트엔드 개발환경에서는 많은 수의 파일감시자가 필요한데, 이 한도를 초과했기 때문에 발생하는 에러라고 한다. 개발을 너무 열심히 하다보면 날 수있다는 에러인데 정말인가  

 

https://github.com/gatsbyjs/gatsby/issues/11406

 

Error: ENOSPC: System limit for number of file watchers reached, watch '/home/foldername/abcrypto/static' · Issue #11406 · gat

Description The web app compiles but when I reload the website, the compilation end with an error. Steps to reproduce Just type gatsby develop and if you click an article for example or you reload ...

github.com

 

다음은 파일감시자의 한도를 늘려주는 명령어이다.

echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p