AWS Elastic Beanstalk 에서 실행중인 Spring Boot 앱에서 오랜만에 파일 업로드를 할 때 다음과 같은 장애가 발생했다.
스프링 부트에 내장된 톰캣 컨테이너에서 생성한 임시디렉토리가 한동안 사용하지 않으면서 사라진 것으로 보인다.

그래서 찾아보니 다음과 같이 스프링 부트쪽 프로젝트에 이슈로 등록이 되어 있었다.

https://github.com/spring-projects/spring-boot/issues/9616
org.springframework.web.multipart.MultipartException: Could not parse multipart servlet request; nested exception is java.io.IOException: The temporary upload location [**/tmp/tomcat.1220970741172837513.8080/work/Tomcat/localhost/ROOT]** is not valid at org.springframework.web.multipart.support.StandardMultipartHttpServletRequest.parseRequest(StandardMultipartHttpServletRequest.java:111)

#springboot #multipartfile



AWS Beanstalk 에서 실행중인 스프링부트 앱에서 오랜만에 파일을 업로드하는 과정에서 생긴 오류.

디렉토리를 별도로 지정하고 없으면 생성하고 하는 방식을 찾아봐야겠다.

http://www.tldp.org/LDP/Linux-Filesystem-Hierarchy/html/tmp.html
Linux Filesystem Hierarchy:
Chapter 1. Linux Filesystem Hierarchy

1.20. /tmp

This directory contains mostly files that are required temporarily. Many programs use this to create lock files and for temporary storage of data. Do not remove files from this directory unless you know exactly what you are doing! Many of these files are important for currently running programs and deleting them may result in a system crash. Usually it won't contain more than a few KB anyway. On most systems, this directory is cleared out at boot or at shutdown by the local system. The basis for this was historical precedent and common practice. However, it was not made a requirement because system administration is not within the scope of the FSSTND. For this reason people and programs must not assume that any files or directories in /tmp are preserved between invocations of the program. The reasoning behind this is for compliance with IEEE standard P1003.2 (POSIX, part 2).


별도로 관리를 안하면 재부팅할 때만 지워지는 것으로 생각했는데...

신경 좀 써야겠다.


앱을 재시작하는 것으로 간단하게 대응했다.

해결방법은 찾아봐야겠다.

+ Recent posts