woowacourse-teams / 2021-zzimkkong

✅ 공간을 한 눈에, 예약은 한 번에!
https://zzimkkong.com
164 stars 20 forks source link

[BE] 예약 삭제 따닥 이슈? #965

Open sakjung opened 1 year ago

sakjung commented 1 year ago

[PROD] [ERROR] [http-nio-8080-exec-185] [8e5728dd3594] [RequestLoggingFilter:?] - [55ms] [500][HTTP METHOD: DELETE] [PATH INFO: /api/guests/maps/3/spaces/5/reservations/14675] [REQUEST HEADER: x-forwarded-for:218.39.176.142, host:127.0.0.1:8080, connection:close, content-length:19, sec-ch-ua:"Google Chrome";v="113", "Chromium";v="113", "Not-A.Brand";v="24", accept:application/json, text/plain, /, content-type:application/json, sec-ch-ua-mobile:?0, user-agent:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36, sec-ch-ua-platform:"Windows", origin:https://zzimkkong.com, sec-fetch-site:same-site, sec-fetch-mode:cors, sec-fetch-dest:empty, referer:https://zzimkkong.com/, accept-encoding:gzip, deflate, br, accept-language:ko-KR,ko;q=0.9,en-US;q=0.8,en;q=0.7] [REQUEST BODY: {"password":"1234"}] [REMOTE ADDRESS: 218.39.176.142] [RESPONSE: {"message":"일시적으로 접속이 원활하지 않습니다. 잠시 후 다시 이용해 주시기 바랍니다."}]

Slack Message

sakjung commented 1 year ago

관련 Log

2023-05-15 14:06:02.102 |  INFO | http-nio-8080-exec-184 |  1ef7beda7c3d | [RequestLoggingFilter:?] - [1ms] [200][HTTP METHOD: OPTIONS] [PATH INFO: /api/guests/maps/3/spaces/5/reservations/14675] [REQUEST HEADER: x-forwarded-for:218.39.176.142, host:127.0.0.1:8080, connection:close, accept:*/*, access-control-request-method:DELETE, access-control-request-headers:content-type, origin:https://zzimkkong.com, user-agent:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36, sec-fetch-mode:cors, sec-fetch-site:same-site, sec-fetch-dest:empty, referer:https://zzimkkong.com/, accept-encoding:gzip, deflate, br, accept-language:ko-KR,ko;q=0.9,en-US;q=0.8,en;q=0.7] [REMOTE ADDRESS: 218.39.176.142]  
2023-05-15 14:06:02.102 |  INFO | http-nio-8080-exec-164 |  0d8bdf8c213b | [RequestLoggingFilter:100] - [1ms] [200][HTTP METHOD: OPTIONS] [PATH INFO: /api/guests/maps/3/spaces/5/reservations/14675] [REQUEST HEADER: x-forwarded-for:218.39.176.142, host:127.0.0.1:8080, connection:close, accept:*/*, access-control-request-method:DELETE, access-control-request-headers:content-type, origin:https://zzimkkong.com, user-agent:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36, sec-fetch-mode:cors, sec-fetch-site:same-site, sec-fetch-dest:empty, referer:https://zzimkkong.com/, accept-encoding:gzip, deflate, br, accept-language:ko-KR,ko;q=0.9,en-US;q=0.8,en;q=0.7] [REMOTE ADDRESS: 218.39.176.142]  
2023-05-15 14:06:02.150 |  INFO | http-nio-8080-exec-182 |  55b45ed3607e | [WebClientConfig:?] - REQUEST: POST https://hooks.slack.com/services/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 
2023-05-15 14:06:02.158 |  INFO | http-nio-8080-exec-185 |  8e5728dd3594 | [AbstractBatchImpl:?] - HHH000010: On release of batch it still contained JDBC statements 
2023-05-15 14:06:02.159 |  INFO | http-nio-8080-exec-182 |  55b45ed3607e | [RequestLoggingFilter:100] - [44ms] [204][HTTP METHOD: DELETE] [PATH INFO: /api/guests/maps/3/spaces/5/reservations/14675] [REQUEST HEADER: x-forwarded-for:218.39.176.142, host:127.0.0.1:8080, connection:close, content-length:19, sec-ch-ua:"Google Chrome";v="113", "Chromium";v="113", "Not-A.Brand";v="24", accept:application/json, text/plain, */*, content-type:application/json, sec-ch-ua-mobile:?0, user-agent:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36, sec-ch-ua-platform:"Windows", origin:https://zzimkkong.com, sec-fetch-site:same-site, sec-fetch-mode:cors, sec-fetch-dest:empty, referer:https://zzimkkong.com/, accept-encoding:gzip, deflate, br, accept-language:ko-KR,ko;q=0.9,en-US;q=0.8,en;q=0.7] [REQUEST BODY: {"password":"1234"}] [REMOTE ADDRESS: 218.39.176.142]  
2023-05-15 14:06:02.164 |  WARN | http-nio-8080-exec-185 |  8e5728dd3594 | [ControllerAdvice:109] - Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1; statement executed: delete from reservation where id=?; nested exception is org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1; statement executed: delete from reservation where id=? (traceId: 8e5728dd3594) 
org.springframework.orm.ObjectOptimisticLockingFailureException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1; statement executed: delete from reservation where id=?; nested exception is org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1; statement executed: delete from reservation where id=?
    at 
... 생략 ...
sakjung commented 1 year ago

먼저 들어온 DELETE 가 정상 처리 되었으므로 서비스에 영향 X

sakjung commented 1 year ago

chatGPT

Possible Causes:
- Entity was modified or deleted outside of the current session
- Another transaction has deleted the entity
- The entity no longer exists in the database
- A concurrent update operation has modified the entity

Possible Solutions:
- Refresh the entity before deleting it
- Lock the entity when loading it
- Use optimistic locking to prevent concurrent updates
- Check for the existence of the entity before deleting it.