savvato-software / tribe-app-backend

3 stars 20 forks source link

Bug fix: solve error GET must not have a request body in ToBeReviewedCheckerServiceImpl #233

Closed mrsbluerose closed 4 months ago

mrsbluerose commented 4 months ago

After the update to SpringBoot 3.3.1, we are getting an error.

stack trace:

2024-07-01T17:25:35.011-06:00  INFO 1364 --- [MessageBroker-1] c.s.t.s.ToBeReviewedCheckerServiceImpl   : from service: Beginning updateUngroomedPhrases process...
2024-07-01T17:25:35.045-06:00 ERROR 1364 --- [MessageBroker-1] o.s.s.s.TaskUtils$LoggingErrorHandler    : Unexpected error occurred in scheduled task

java.lang.IllegalArgumentException: method GET must not have a request body.
    at okhttp3.Request$Builder.method(Request.kt:258) ~[okhttp-4.12.0.jar:na]
    at org.springframework.http.client.OkHttp3ClientHttpRequest.executeInternal(OkHttp3ClientHttpRequest.java:88) ~[spring-web-6.1.10.jar:6.1.10]
    at org.springframework.http.client.AbstractStreamingClientHttpRequest.executeInternal(AbstractStreamingClientHttpRequest.java:70) ~[spring-web-6.1.10.jar:6.1.10]
    at org.springframework.http.client.AbstractClientHttpRequest.execute(AbstractClientHttpRequest.java:66) ~[spring-web-6.1.10.jar:6.1.10]
    at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:889) ~[spring-web-6.1.10.jar:6.1.10]
    at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:790) ~[spring-web-6.1.10.jar:6.1.10]
    at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:672) ~[spring-web-6.1.10.jar:6.1.10]
    at com.savvato.tribeapp.services.ToBeReviewedCheckerServiceImpl.getWordDetails(ToBeReviewedCheckerServiceImpl.java:70) ~[classes/:na]

Steps to reproduce:

haxwell commented 4 months ago

Good find.. let me know if you have questions in resolving it..

mrsbluerose commented 4 months ago

ChatGPT to the rescue. Created pull request #234 (linked in Development section) Discovered while working on TRIB-203, double checking migration scripts for test data. For some reason, this bug only triggered when dropping and recreating the database.