Bug: location list

Hello All,

Since today a strange bug came to life.
If you are on the Dashboard and click on the name of the warehouse to get the location list, the list stays empty.

However, if I click on Inventory → Browse Inventory and then click again it list fills correctly.

Any ideas? I Already restarted Tomcat several times, no effect…

I see this in the log:

2025-03-02 14:21:07,650 [http-bio-8443-exec-1] ERROR errors.GrailsExceptionResolver  - Exception occurred when processing request: [GET] /openboxes/api/locations
Stacktrace follows:
org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [org.pih.warehouse.core.User#5523c3127f33c127017fbb7a41b6015b]
        at org.pih.warehouse.core.User_$$_javassist_122.toJson(User_$$_javassist_122.java)
        at org.pih.warehouse.core.User_$$_javassist_122$toJson.call(Unknown Source)
        at BootStrap$_closure1_closure37.doCall(BootStrap.groovy:468)
        at grails.converters.JSON.value(JSON.java:198)
        at grails.converters.JSON.convertAnother(JSON.java:161)
        at grails.converters.JSON.value(JSON.java:198)
        at grails.converters.JSON.convertAnother(JSON.java:161)
        at grails.converters.JSON.value(JSON.java:198)
        at grails.converters.JSON.convertAnother(JSON.java:161)
        at grails.converters.JSON.value(JSON.java:198)
        at grails.converters.JSON.convertAnother(JSON.java:161)
        at grails.converters.JSON.value(JSON.java:198)
        at grails.converters.JSON.render(JSON.java:133)
        at grails.converters.JSON.render(JSON.java:149)
        at org.pih.warehouse.api.LocationApiController$_closure2.doCall(LocationApiController.groovy:95)
        at org.pih.warehouse.api.LocationApiController$_closure2.doCall(LocationApiController.groovy)
        at grails.plugin.springcache.web.GrailsFragmentCachingFilter.doFilter(GrailsFragmentCachingFilter.groovy:66)
        at net.sf.ehcache.constructs.web.filter.Filter.doFilter(Filter.java:86)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:622)
        at java.lang.Thread.run(Thread.java:748)
2025-03-02 14:21:07,659 [http-bio-8443-exec-1] INFO  filters.SecurityFilters  - Request for (locationApi/list) failed with an uncaught exception: Executing action [list] of controller [org.pih.warehouse.api.LocationApiController]  caused exception: org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [org.pih.warehouse.core.User#5523c3127f33c127017fbb7a41b6015b]
2025-03-02 14:21:07,662 [http-bio-8443-exec-11] INFO  filters.SecurityFilters  - dashboardApi.getFillRateDestinations: [user:admin, location:Test Locatie]
2025-03-02 14:21:07,662 [http-bio-8443-exec-11] INFO  filters.SecurityFilters  - No rule for dashboardApi:getFillRateDestinations -> allow anonymous

Edited by jmiranda to place stacktrace in code block.

As far as I know, we haven’t encountered that bug. Let me try to get a little more information so I can reproduce it myself.

Did you delete a user (i.e. user with ID 5523c3127f33c127017fbb7a41b6015b) from the application (or maybe directly from the database) recently?

Execute the following SQL to check if there’s a reference to that user in the location table.

select * 
from location 
where manager_id = '5523c3127f33c127017fbb7a41b6015b';

NOTE: Please backup your database before making any changes.

If so, you can probably remove the reference with the following update.

update location
set manager_id = NULL
where manager_id = '5523c3127f33c127017fbb7a41b6015b'

If this solves the problem, then let me know how you deleted the user so we can try to see if there’s an issue with the foreign key constraint validation around that column.

Justin

Hmm yeah, that got me thinking.

I indeed deleted few users, I restored them now it works, strange!
I think it has something todo with who the manager is of a warehouse, and if you delete that user the systems becomes confused.

Yeah that was my hunch. But the system shouldn’t alllw you to delete a user if they’re assigned as a manager of a location. So I’ll create a bug report and look into that.

1 Like