Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
sakjung opened this issue May 15, 2023 — with Slack · 3 comments
Open

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

sakjung opened this issue May 15, 2023 — with Slack · 3 comments
Labels

Comments

Copy link
Collaborator

sakjung commented May 15, 2023

[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 sakjung added 예약자 🐛 bug Something isn't working 🕋 backend labels May 15, 2023 — with Slack
@xrabcde xrabcde changed the title 예약 삭제 따닥 이슈? [BE] 예약 삭제 따닥 이슈? May 15, 2023
@sakjung
Copy link
Collaborator Author

sakjung commented May 15, 2023

관련 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
Copy link
Collaborator Author

sakjung commented May 15, 2023

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

@sakjung
Copy link
Collaborator Author

sakjung commented May 15, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant