Part Search: Endless "Loading data..."

This issue has been tracked since 2023-01-16.

Please verify that this bug has NOT been raised before.

  • I checked and didn't find similar issue

Describe the bug*

Searching for certain parts results into an endless "Loading data..." text. The search works within the quick view sidebar, however once enter is pressed, it looks as displayed within the attached screenshot. There are no error/warn logs visible.

2023-01-16-122737

Steps to Reproduce

In our case some special words as "deckel" or "gehäuse" triggers the behavior.

  1. Enter one of the words in the global search bar.
  2. See the correct results within the sidebar
  3. Press enter
  4. No data is shown. "Loading data..."

Expected behavior

I expect the same results as within the quick search sidebar.

Deployment Method

  • Docker
  • Bare metal

Version Information

0.9.2 docker container

Relevant log output

No error or warn logs available
matmair wrote this answer on 2023-01-23

@r0l1 what database backend are you using? I suspect this might be something with collation - the old friend of germans and swedes.

I can not reproduce the issue by renaming parts in the demo instance. Is there anything else special with the parts? Can you see them if you issue an API request?

r0l1 wrote this answer on 2023-01-23

Thanks for the fast response. I am using the postgres:13 docker image. I attached some screenshots of a part and the working sidebar search functionality. The inventree instance was upgraded several times beginning with the 0.6.x version.

All logs during the "Loading data..." request:

inventree-nginx | 172.18.0.5 - - [17/Jan/2023:09:57:33 +0000] "GET /api/notifications/?read=false HTTP/1.1" 200 2 "https://{inventree}/part/" ".... .... ...." "...."
inventree-server | 172.18.0.5 - - [17/Jan/2023:09:57:33 +0000] "GET /api/notifications/?read=false HTTP/1.0" 200 2 "https://{inventree}/part/" ".... .... ...."
inventree-server | 172.18.0.5 - - [17/Jan/2023:09:57:34 +0000] "POST /search/ HTTP/1.0" 200 25052 "https://{inventree}/part/" ".... .... ...."
inventree-nginx | 172.18.0.5 - - [17/Jan/2023:09:57:34 +0000] "POST /search/ HTTP/1.1" 200 25052 "https://{inventree}/part/" ".... .... ...." "...."
inventree-server | 172.18.0.5 - - [17/Jan/2023:09:57:34 +0000] "GET /js/dynamic/nav.js HTTP/1.0" 200 8674 "https://{inventree}/search/" ".... .... ...."
inventree-nginx | 172.18.0.5 - - [17/Jan/2023:09:57:34 +0000] "GET /js/dynamic/nav.js HTTP/1.1" 200 8674 "https://{inventree}/search/" ".... .... ...." "...."
inventree-nginx | 172.18.0.5 - - [17/Jan/2023:09:57:34 +0000] "GET /js/dynamic/calendar.js HTTP/1.1" 200 1332 "https://{inventree}/search/" ".... .... ...." "...."
inventree-server | 172.18.0.5 - - [17/Jan/2023:09:57:34 +0000] "GET /js/dynamic/calendar.js HTTP/1.0" 200 1332 "https://{inventree}/search/" ".... .... ...."
inventree-server | 172.18.0.5 - - [17/Jan/2023:09:57:34 +0000] "GET /js/dynamic/settings.js HTTP/1.0" 200 9049 "https://{inventree}/search/" ".... .... ...."
inventree-nginx | 172.18.0.5 - - [17/Jan/2023:09:57:34 +0000] "GET /js/dynamic/settings.js HTTP/1.1" 200 9049 "https://{inventree}/search/" ".... .... ...." "...."
inventree-nginx | 172.18.0.5 - - [17/Jan/2023:09:57:34 +0000] "GET /api/part/category/?search=deckel&offset=0&limit=25 HTTP/1.1" 200 52 "https://{inventree}/search/" ".... .... ...." "...."
inventree-server | 172.18.0.5 - - [17/Jan/2023:09:57:34 +0000] "GET /api/part/category/?search=deckel&offset=0&limit=25 HTTP/1.0" 200 52 "https://{inventree}/search/" ".... .... ...."
inventree-nginx | 172.18.0.5 - - [17/Jan/2023:09:57:34 +0000] "GET /api/company/part/manufacturer/?search=deckel&offset=0&limit=25&part_detail=true&supplier_detail=true&manufacturer_detail=true HTTP/1.1" 200 6253 "https://{inventree}/search/" ".... .... ...." "...."
inventree-server | 172.18.0.5 - - [17/Jan/2023:09:57:34 +0000] "GET /api/company/part/manufacturer/?search=deckel&offset=0&limit=25&part_detail=true&supplier_detail=true&manufacturer_detail=true HTTP/1.0" 200 6253 "https://{inventree}/search/" ".... .... ...."
inventree-nginx | 172.18.0.5 - - [17/Jan/2023:09:57:34 +0000] "GET /api/build/?search=deckel&offset=0&limit=25&part_detail=true HTTP/1.1" 200 52 "https://{inventree}/search/" ".... .... ...." "...."
inventree-server | 172.18.0.5 - - [17/Jan/2023:09:57:34 +0000] "GET /api/build/?search=deckel&offset=0&limit=25&part_detail=true HTTP/1.0" 200 52 "https://{inventree}/search/" ".... .... ...."
inventree-nginx | 172.18.0.5 - - [17/Jan/2023:09:57:34 +0000] "GET /api/company/?search=deckel&offset=0&limit=25&is_supplier=true HTTP/1.1" 200 52 "https://{inventree}/search/" ".... .... ...." "...."
inventree-server | 172.18.0.5 - - [17/Jan/2023:09:57:34 +0000] "GET /api/company/?search=deckel&offset=0&limit=25&is_supplier=true HTTP/1.0" 200 52 "https://{inventree}/search/" ".... .... ...."
inventree-nginx | 172.18.0.5 - - [17/Jan/2023:09:57:34 +0000] "GET /api/stock/location/?search=deckel&offset=0&limit=25 HTTP/1.1" 200 52 "https://{inventree}/search/" ".... .... ...." "...."
inventree-server | 172.18.0.5 - - [17/Jan/2023:09:57:34 +0000] "GET /api/stock/location/?search=deckel&offset=0&limit=25 HTTP/1.0" 200 52 "https://{inventree}/search/" ".... .... ...."
inventree-nginx | 172.18.0.5 - - [17/Jan/2023:09:57:34 +0000] "GET /api/company/?search=deckel&offset=0&limit=25&is_manufacturer=true HTTP/1.1" 200 52 "https://{inventree}/search/" ".... .... ...." "...."
inventree-server | 172.18.0.5 - - [17/Jan/2023:09:57:34 +0000] "GET /api/company/?search=deckel&offset=0&limit=25&is_manufacturer=true HTTP/1.0" 200 52 "https://{inventree}/search/" ".... .... ...."
inventree-nginx | 172.18.0.5 - - [17/Jan/2023:09:57:34 +0000] "GET /api/company/?search=deckel&offset=0&limit=25&is_customer=true HTTP/1.1" 200 52 "https://{inventree}/search/" ".... .... ...." "...."
inventree-server | 172.18.0.5 - - [17/Jan/2023:09:57:34 +0000] "GET /api/company/?search=deckel&offset=0&limit=25&is_customer=true HTTP/1.0" 200 52 "https://{inventree}/search/" ".... .... ...."
inventree-server | 172.18.0.5 - - [17/Jan/2023:09:57:34 +0000] "GET /api/order/so/?search=deckel&offset=0&limit=25&customer_detail=true HTTP/1.0" 200 52 "https://{inventree}/search/" ".... .... ...."
inventree-nginx | 172.18.0.5 - - [17/Jan/2023:09:57:34 +0000] "GET /api/order/so/?search=deckel&offset=0&limit=25&customer_detail=true HTTP/1.1" 200 52 "https://{inventree}/search/" ".... .... ...." "...."
inventree-nginx | 172.18.0.5 - - [17/Jan/2023:09:57:34 +0000] "GET /api/order/po/?search=deckel&offset=0&limit=25&supplier_detail=true HTTP/1.1" 200 52 "https://{inventree}/search/" ".... .... ...." "...."
inventree-server | 172.18.0.5 - - [17/Jan/2023:09:57:34 +0000] "GET /api/order/po/?search=deckel&offset=0&limit=25&supplier_detail=true HTTP/1.0" 200 52 "https://{inventree}/search/" ".... .... ...."
inventree-nginx | 172.18.0.5 - - [17/Jan/2023:09:57:34 +0000] "GET /api/company/part/?search=deckel&offset=0&limit=25&part_detail=true&supplier_detail=true&manufacturer_detail=true HTTP/1.1" 200 15787 "https://{inventree}/search/" ".... .... ...." "...."
inventree-server | 172.18.0.5 - - [17/Jan/2023:09:57:34 +0000] "GET /api/company/part/?search=deckel&offset=0&limit=25&part_detail=true&supplier_detail=true&manufacturer_detail=true HTTP/1.0" 200 15787 "https://{inventree}/search/" ".... .... ...."
inventree-nginx | 172.18.0.5 - - [17/Jan/2023:09:57:34 +0000] "GET /api/notifications/?read=false HTTP/1.1" 200 2 "https://{inventree}/search/" ".... .... ...." "...."
inventree-server | 172.18.0.5 - - [17/Jan/2023:09:57:34 +0000] "GET /api/notifications/?read=false HTTP/1.0" 200 2 "https://{inventree}/search/" ".... .... ...."
inventree-server | 172.18.0.5 - - [17/Jan/2023:09:57:34 +0000] "GET /api/stock/?search=deckel&offset=0&limit=25&part_detail=true&location_detail=true HTTP/1.0" 200 17191 "https://{inventree}/search/" ".... .... ...."
inventree-nginx | 172.18.0.5 - - [17/Jan/2023:09:57:34 +0000] "GET /api/stock/?search=deckel&offset=0&limit=25&part_detail=true&location_detail=true HTTP/1.1" 200 17191 "https://{inventree}/search/" ".... .... ...." "...."
inventree-server | 172.18.0.5 - - [17/Jan/2023:09:57:35 +0000] "GET /api/part/?search=deckel&offset=0&limit=25&category_detail=true HTTP/1.0" 200 25817 "https://{inventree}/search/" ".... .... ...."
inventree-nginx | 172.18.0.5 - - [17/Jan/2023:09:57:35 +0000] "GET /api/part/?search=deckel&offset=0&limit=25&category_detail=true HTTP/1.1" 200 25817 "https://{inventree}/search/" ".... .... ...." "...."

I tested this issue with Firefox and Chromium browsers
2023-01-17-105306
2023-01-17-105400
2023-01-17-105416
.

r0l1 wrote this answer on 2023-01-23

Looking at the browser dev console following error is thrown:

Uncaught TypeError: row.category_detail is null
    formatter https://{inventree}/static/i18n/en.part.js:1516
    calculateObjectValue https://{inventree}/static/bootstrap-table/bootstrap-table.min.js:10
    escapeCellValue https://{inventree}/static/i18n/en.tables.js:577
    value https://{inventree}/static/bootstrap-table/bootstrap-table.min.js:10
    value https://{inventree}/static/bootstrap-table/bootstrap-table.min.js:10
    value https://{inventree}/static/bootstrap-table/extensions/treegrid/bootstrap-table-treegrid.min.js:10
    value https://{inventree}/static/bootstrap-table/bootstrap-table.min.js:10
    initBody https://{inventree}/static/bootstrap-table/extensions/group-by-v2/bootstrap-table-group-by.min.js:10
    value https://{inventree}/static/bootstrap-table/extensions/filter-control/bootstrap-table-filter-control.min.js:10
    value https://{inventree}/static/bootstrap-table/extensions/treegrid/bootstrap-table-treegrid.min.js:10
    value https://{inventree}/static/bootstrap-table/extensions/custom-view/bootstrap-table-custom-view.min.js:10
    value https://{inventree}/static/bootstrap-table/bootstrap-table.min.js:10
    success https://{inventree}/static/bootstrap-table/bootstrap-table.min.js:10
    jQuery 6
    value https://{inventree}/static/bootstrap-table/bootstrap-table.min.js:10
    value https://{inventree}/static/bootstrap-table/bootstrap-table.min.js:10
    value https://{inventree}/static/bootstrap-table/extensions/filter-control/bootstrap-table-filter-control.min.js:10
    value https://{inventree}/static/bootstrap-table/extensions/treegrid/bootstrap-table-treegrid.min.js:10
    value https://{inventree}/static/bootstrap-table/extensions/custom-view/bootstrap-table-custom-view.min.js:10
    bootstrapTable https://{inventree}/static/bootstrap-table/bootstrap-table.min.js:10
    jQuery 2
    bootstrapTable https://{inventree}/static/bootstrap-table/bootstrap-table.min.js:10
    inventreeTable https://{inventree}/static/i18n/en.tables.js:392
    loadPartTable https://{inventree}/static/i18n/en.part.js:1645
    <anonymous> https://{inventree}/search/:540
    jQuery 13
en.part.js:1516:24

SergeoLacruz wrote this answer on 2023-01-23

I had something similar when I opened the parameter view and selected "All" instead of 25 using MariaDB with some version of 09...
On the latest master I can open the top level category with 2200 parts in 12 seconds using the development server.
We can start a German User Group :-)

matmair wrote this answer on 2023-01-23

Ok now I can reproduce. This is an error with the table rendering. I thought we fixed that.

Sidenote: We buy our screws and hardware from the same online shop ;-) Maybe a German-speaking user group would be a nice idea.

matmair wrote this answer on 2023-01-23

@SergeoLacruz I just checked: we have the most hits on the website from Germany (measured by region code)
grafik

SergeoLacruz wrote this answer on 2023-01-23

Interesting. What is the timescale? 44 visitors is not much.

matmair wrote this answer on 2023-01-23

@SergeoLacruz that was past 12h at that point. That is probably mostly ppl. researching, there is not much need to go on the landing page otherwise.

r0l1 wrote this answer on 2023-01-23

@matmair thanks for looking into this :)

Maybe a German-speaking user group would be a nice idea.

Sounds good. Please feel free and post the link, once created. I would join together with 2 colleges :)

matmair wrote this answer on 2023-01-24

@inventree/maintainer @inventree/triage any idea what this could be? I tried wrapping my head around it twice now but I can not find why the UI filter is not working.

matmair wrote this answer on 2023-01-24

Sounds good. Please feel free and post the link, once created. I would join together with 2 colleges :)

@r0l1 that was meant more as a joke - we have our hands full with the current workload already. But there seems to be some interest and it might be nice. Do you have an idea what one could use? Lots of projects seem to use discord nowadays but that is not well searchable and a forum like Linux distros have seems to be a lot of maintenance work.

SchrodingersGat wrote this answer on 2023-01-30

@matmair @SergeoLacruz what are the simple steps to reproduce this reliably?

SergeoLacruz wrote this answer on 2023-01-30

As told I do not see it any more on the latest development version with mariadb.

More Details About Repo
Owner Name inventree
Repo Name InvenTree
Full Name inventree/InvenTree
Language Python
Created Date 2017-03-23
Updated Date 2023-03-31
Star Count 2586
Watcher Count 61
Fork Count 411
Issue Count 141

YOU MAY BE INTERESTED

Issue Title Created Date Updated Date