question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Relationship filter broken with too many items in filter

See original GitHub issue

Environment

  • Python version: 3.6.15
  • Nautobot version: v1.2.10

We are using relationships to model hypervizors (One-to-Many Device to VMs). To avoid performance impact of 96 relationships (see issue #1593 ), we tried having single association with all the cluster_ids in single filter. The filter is the same on both sides, looks like this:

{
    "cluster_id": [
        "09c340b3-42b9-4799-b19b-9db45abd11d3",
        "0bd6582c-4ede-478c-a61c-691e044c674f",
        .... 94 more UUIDs here ....
    ]
}

But now it is not possible to set this relationship association in UI. It works via API, but UI always shows The results could not be loaded. from VM and Device alike. If I remove the filter, I am able to list all VMs and Devices respectively. But since I don’t want this Relationship to show for all Devices, I need to have some sort of filter in place to tell Nautobot the Device is in Cluster.

Steps to Reproduce

  1. create many clusters (we hit it with 96, but the critical number is 28 clusters - works with 27, does not with 28)
  2. create relationship between Device and VM, filter for cluster_id with list of all 28 clusters on source and destination
  3. try to add the relationship association from UI

Expected Behavior

all devices/VMs in those clusters listed

Observed Behavior

following message on both sides, which means inability to fill this field image

Note: It works if I remove the filter

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
bryanculvercommented, Jul 12, 2022

Worked with @Thetacz to reproduce this issue. We confirmed that it’s a result of a very low default limit on the uWSGI buffer size:

By default uWSGI allocates a very small buffer (4096 bytes) for the headers of each request. If you start receiving “invalid request block size” in your logs, it could mean you need a bigger buffer. Increase it (up to 65535) with the buffer-size option.

Source: https://uwsgi-docs.readthedocs.io/en/latest/ThingsToKnow.html

We manually bumped the buffer size as an addition command-line arg to the container and it resolved the issue.

Evaluating if we should increase the default directly in: https://github.com/nautobot/nautobot/blob/develop/docker/uwsgi.ini or should this be configurable as an environment variable.

In the meantime, anyone running into this (or similar) issues can at minimum update their runtime command for the Nautobot container to be "nautobot-server start --ini /opt/nautobot/uwsgi.ini -b 65000"

0reactions
jathanismcommented, Jul 12, 2022

Let’s get this into our troubleshooting docs in server install section.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Solved: Relationship filtering on many to one doesnt filte...
Solved: Hi, I have several tables all linked to each other. What I am finding is that the filtering from many to one...
Read more >
Not able to use many to many relation to filter in a list - Database
Unfortunately, currently it is not possible to filter many items against many items. One of the recommended workarounds is to create an index...
Read more >
Many to many relationships: why is this .filter not working?
When a filter does not work the first thing I look for is the data type of the arguments I am comparing. Here...
Read more >
Relationship troubleshooting guidance - Power BI
Troubleshooting guide ; BLANK groupings or slicer/filter items appear, and the source columns don't contain BLANKs, - It's a regular relationship ...
Read more >
Many to Many & Bi-Directional Filtering #Q&A - YouTube
Struggling with Power BI Relationship ? May be you need a Many to Many relationship or Bi-Directional filtering. Watch the solution and ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found