clarin-dspace icon indicating copy to clipboard operation
clarin-dspace copied to clipboard

License Administration - issue with search

Open kosarko opened this issue 11 months ago • 2 comments

This was originally https://github.com/ufal/clarin-dspace/issues/1055#issuecomment-1559257517

Still can reproduce, see the vid: https://github.com/user-attachments/assets/847dbb38-bec4-40b0-a861-d78286971812

The most recent error in dspace.log seems to match the error in the comment above:

2025-01-27 14:17:14,875 ERROR 3c6f655c-77cc-4c92-8388-3e9f0d5c26e9 4d7221af-bd34-405a-a2d5-79c4f0690205 org.dspace.app.rest.exception.DSpaceApiExceptionControllerAdvice @ An exception has occurred (status:500)
org.dspace.app.rest.exception.PaginationException: null
        at org.dspace.app.rest.utils.Utils.getPageObjectList(Utils.java:188) ~[classes/:7.6.1]
        at org.dspace.app.rest.converter.ConverterService.toRestPage(ConverterService.java:208) ~[classes/:7.6.1]
        at org.dspace.app.rest.converter.ConverterService$$FastClassBySpringCGLIB$$41367eae.invoke(<generated>) ~[classes/:7.6.1]
        at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.3.27.jar:5.3.27]

kosarko avatar Jan 27 '25 13:01 kosarko

Couldn't get the PaginationException anymore, by playing with frontend.

However, the exception can be reproduced by passing the invalid request to clarinlicenses API, e.g.

GET /server/api/core/clarinlicenses/search/byNameLike?page=3&size=10&sort=,DESC&name=Universal

The exception is thrown, when the total size of the records is less than 30 (e.g. 25).

In this case, the offset is calculated as page * size, which is 30, and if the offset is bigger than the totalSize, the PaginationException is thrown, and the PaginationException results in 500 Error.

Clarin-DSpace should somehow catch this exception, and rather provide the empty response.

kuchtiak-ufal avatar Mar 26 '25 15:03 kuchtiak-ufal

Pull Request: https://github.com/ufal/clarin-dspace/pull/1184

kuchtiak-ufal avatar Mar 31 '25 13:03 kuchtiak-ufal

fixed in #1184

kosarko avatar Apr 07 '25 14:04 kosarko