[Nest.js] DEK 컨텍스트 없이 엔티티를 hydrate하면 왜 터지는가
API로 유저 정보를 조회하면 아무 문제가 없었습니다.그런데 밤에 도는 배치 워커에서 똑같은 엔티티를 읽으면 이런 에러가 났습니다.Error: Unsupported state or unable to authenticate data at Decipheriv.final (node:internal/crypto/cipher) 혹은 더 허무하게 이렇게 났습니다.TypeError: Cannot read properties of undefined (reading 'key') 처음에는 워커 쪽 환경 변수나 DB 커넥션 설정이 잘못됐겠거니 했습니다. 그런데 설정은 멀쩡했고, 워커에서 쓰는 리포지토리도 API에서 쓰는 것과 같은 인스턴스였습니다. 코드가 동일한데 실행 경로에 따라 결과가 달라진다면, 그건 코드가 아니..