This QueryDict instance is immutable #8348

Closed
opened 2025-12-29 20:35:39 +01:00 by adam · 0 comments
Owner

Originally created by @carthique on GitHub (Jul 19, 2023).

NetBox version

v3.5.6

Python version

3.10

Steps to Reproduce

Trying to get available-ips using the below curl call

curl -X 'POST' \
  'http://localhost:8000/api/ipam/prefixes/5/available-ips/' \
  -H 'accept: application/json' \
  -H 'Content-Type: multipart/form-data' \
  -H 'X-CSRFTOKEN: LLaGfBUEU5uVlM4ghWXXC34HFsGp3rgF75UVsnXcx4jMlQ5ADLC9o8tSkNqOHS67' \
  -F 'address=10.0.0.0/16'

We get the following error

<pre class="block"><strong>&lt;class &#x27;AttributeError&#x27;&gt;</strong><br />
This QueryDict instance is immutable

Expected Behavior

To get the list of IP addresses available
[10.0.0.2/16, 10.0.0.4/16, 10.0.0.5/16, 10.0.0.6/16, 10.0.0.7/16, 10.0.0.8/16, 10.0.0.9/16, 10.0.0.10/16, 10.0.0.11/16, 10.0.0.12/16, 10.0.0.13/16, 10.0.0.14/16, 10.0.0.15/16, 10.0.0.16/16, 10.0.0.17/16, 10.0.0.18/16, 10.0.0.19/16, 10.0.0.20/16, 10.0.0.21/16, 10.0.0.22/16, 10.0.0.23/16, 10.0.0.24/16, 10.0.0.25/16, 10.0.0.26/16, 10.0.0.27/16, 10.0.0.28/16, 10.0.0.29/16, 10.0.0.30/16, 10.0.0.31/16, 10.0.0.32/16, 10.0.0.33/16, 10.0.0.34/16, 10.0.0.35/16, 10.0.0.36/16, 10.0.0.37/16, 10.0.0.38/16, 10.0.0.39/16, 10.0.0.40/16, 10.0.0.41/16, 10.0.0.42/16, 10.0.0.43/16, 10.0.0.44/16, 10.0.0.45/16, 10.0.0.46/16, 10.0.0.47/16, 10.0.0.48/16, 10.0.0.49/16, 10.0.0.50/16, 10.0.0.51/16, 10.0.0.52/16]

Observed Behavior

<!DOCTYPE html>
<html lang="en">

<head>
    <title>Server Error</title>
    <link rel="stylesheet" href="/static/netbox-light.css" />
    <meta charset="UTF-8">
</head>

<body>
    <div class="container-fluid">
        <div class="row">
            <div class="col col-md-6 offset-md-3">
                <div class="card border-danger mt-5">
                    <h5 class="card-header">
                        <i class="mdi mdi-alert"></i> Server Error
                    </h5>
                    <div class="card-body">
                        
                            <p>
                                There was a problem with your request. Please contact an administrator.
                            </p>
                        
                        <hr />
                        <p>
                            The complete exception is provided below:
                        </p>
<pre class="block"><strong>&lt;class &#x27;AttributeError&#x27;&gt;</strong><br />
This QueryDict instance is immutable

Python version: 3.10.6
NetBox version: 3.5.6</pre>
                        <p>
                            If further assistance is required, please post to the <a href="https://github.com/netbox-community/netbox/discussions">NetBox discussion forum</a> on GitHub.
                        </p>
                        <div class="text-end">
                            <a href="/" class="btn btn-primary">Home Page</a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>

</html>
Originally created by @carthique on GitHub (Jul 19, 2023). ### NetBox version v3.5.6 ### Python version 3.10 ### Steps to Reproduce Trying to get available-ips using the below curl call ``` curl -X 'POST' \ 'http://localhost:8000/api/ipam/prefixes/5/available-ips/' \ -H 'accept: application/json' \ -H 'Content-Type: multipart/form-data' \ -H 'X-CSRFTOKEN: LLaGfBUEU5uVlM4ghWXXC34HFsGp3rgF75UVsnXcx4jMlQ5ADLC9o8tSkNqOHS67' \ -F 'address=10.0.0.0/16' ``` We get the following error ``` <pre class="block"><strong>&lt;class &#x27;AttributeError&#x27;&gt;</strong><br /> This QueryDict instance is immutable ``` ### Expected Behavior To get the list of IP addresses available `[10.0.0.2/16, 10.0.0.4/16, 10.0.0.5/16, 10.0.0.6/16, 10.0.0.7/16, 10.0.0.8/16, 10.0.0.9/16, 10.0.0.10/16, 10.0.0.11/16, 10.0.0.12/16, 10.0.0.13/16, 10.0.0.14/16, 10.0.0.15/16, 10.0.0.16/16, 10.0.0.17/16, 10.0.0.18/16, 10.0.0.19/16, 10.0.0.20/16, 10.0.0.21/16, 10.0.0.22/16, 10.0.0.23/16, 10.0.0.24/16, 10.0.0.25/16, 10.0.0.26/16, 10.0.0.27/16, 10.0.0.28/16, 10.0.0.29/16, 10.0.0.30/16, 10.0.0.31/16, 10.0.0.32/16, 10.0.0.33/16, 10.0.0.34/16, 10.0.0.35/16, 10.0.0.36/16, 10.0.0.37/16, 10.0.0.38/16, 10.0.0.39/16, 10.0.0.40/16, 10.0.0.41/16, 10.0.0.42/16, 10.0.0.43/16, 10.0.0.44/16, 10.0.0.45/16, 10.0.0.46/16, 10.0.0.47/16, 10.0.0.48/16, 10.0.0.49/16, 10.0.0.50/16, 10.0.0.51/16, 10.0.0.52/16] ` ### Observed Behavior ``` <!DOCTYPE html> <html lang="en"> <head> <title>Server Error</title> <link rel="stylesheet" href="/static/netbox-light.css" /> <meta charset="UTF-8"> </head> <body> <div class="container-fluid"> <div class="row"> <div class="col col-md-6 offset-md-3"> <div class="card border-danger mt-5"> <h5 class="card-header"> <i class="mdi mdi-alert"></i> Server Error </h5> <div class="card-body"> <p> There was a problem with your request. Please contact an administrator. </p> <hr /> <p> The complete exception is provided below: </p> <pre class="block"><strong>&lt;class &#x27;AttributeError&#x27;&gt;</strong><br /> This QueryDict instance is immutable Python version: 3.10.6 NetBox version: 3.5.6</pre> <p> If further assistance is required, please post to the <a href="https://github.com/netbox-community/netbox/discussions">NetBox discussion forum</a> on GitHub. </p> <div class="text-end"> <a href="/" class="btn btn-primary">Home Page</a> </div> </div> </div> </div> </div> </div> </body> </html> ```
adam closed this issue 2025-12-29 20:35:39 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#8348