Server Error when creating a new Tenant w/ custom_fields #1189

Closed
opened 2025-12-29 16:29:52 +01:00 by adam · 3 comments
Owner

Originally created by @cimnine on GitHub (Aug 23, 2017).

Issue type

[ ] Feature request
[x] Bug report
[ ] Documentation

Environment

  • Python version: 2.7
  • NetBox version: v2.1.3

Description

When creating a new Tenant with custom_fields, an Internal Server Error is raised.

Steps to reproduce

PATCH http://netbox/api/tenancy/tenants/1.json HTTP/1.1
Authorization: Token 8d9c88cbe931258f12a3a606bec8433236d6cc47
User-Agent: Faraday v0.12.1
Content-Type: application/json

{\"name\":\"adafafds\",\"slug\":\"adafafds\",\"custom_fields\":{\"customer_id\":928}}

HTTP/1.1 500 Internal Server Error
date: Wed, 23 Aug 2017 09:32:07 GMT
server: Apache
api-version: 2.1
vary: Cookie
x-frame-options: SAMEORIGIN
content-length: 1626
connection: close
content-type: text/html; charset=utf-8

<!DOCTYPE html>\n<html lang=\"en\">\n\n<head>\n\t<title>Server Error</title>\n\t<link rel=\"stylesheet\" href=\"/static/bootstrap-3.3.7-dist/css/bootstrap.min.css\">\n    <link rel=\"stylesheet\" href=\"/static/font-awesome-4.7.0/css/font-awesome.min.css\">\n</head>\n\n<body>\n    <div class=\"container-fluid\">\n        <div class=\"row\">\n            <div class=\"col-md-4 col-md-offset-4\">\n                <div class=\"panel panel-danger\" style=\"margin-top: 200px\">\n                    <div class=\"panel-heading\">\n                        <strong>\n                            <i class=\"fa fa-warning\"></i>\n                            Server Error\n                        </strong>\n                    </div>\n                    <div class=\"panel-body\">\n                        <p>There was a problem with your request. This error has been logged and administrative staff have\n                        been notified. Please return to the home page and try again.</p>\n                        <p>If you are responsible for this installation, please consider\n                        <a href=\"https://github.com/digitalocean/netbox/issues\">filing a bug report</a>. Additional\n                        information is provided below:</p>\n<pre><strong>&lt;type &#39;exceptions.TypeError&#39;&gt;</strong><br />\n&#39;custom_fields&#39; is an invalid keyword argument for this function</pre>\n                        <div class=\"text-right\">\n                            <a href=\"/\" class=\"btn btn-primary\">Home Page</a>\n                        </div>\n                    </div>\n                </div>\n            </div>\n        </div>\n    </div>\n</body>\n\n</html>\n"

The relevant part seems to be

<pre><strong>&lt;type &#39;exceptions.TypeError&#39;&gt;</strong><br />
&#39;custom_fields&#39; is an invalid keyword argument for this function</pre>

Additional Info

The custom field customer_id is configured like this:

screen shot 2017-08-23 at 11 38 39
Originally created by @cimnine on GitHub (Aug 23, 2017). <!-- Before opening a new issue, please search through the existing issues to see if your topic has already been addressed. Note that you may need to remove the "is:open" filter from the search bar to include closed issues. Check the appropriate type for your issue below by placing an x between the brackets. If none of the below apply, please raise your issue for discussion on our mailing list: https://groups.google.com/forum/#!forum/netbox-discuss Please note that issues which do not fall under any of the below categories will be closed. ---> ### Issue type [ ] Feature request <!-- Requesting the implementation of a new feature --> [x] Bug report <!-- Reporting unexpected or erroneous behavior --> [ ] Documentation <!-- Proposing a modification to the documentation --> <!-- Please describe the environment in which you are running NetBox. (Be sure to verify that you are running the latest stable release of NetBox before submitting a bug report.) --> ### Environment * Python version: 2.7 * NetBox version: v2.1.3 <!-- BUG REPORTS must include: * A list of the steps needed to reproduce the bug * A description of the expected behavior * Any relevant error messages (screenshots may also help) FEATURE REQUESTS must include: * A detailed description of the proposed functionality * A use case for the new feature * A rough description of any necessary changes to the database schema * Any relevant third-party libraries which would be needed --> ### Description When creating a new Tenant with `custom_fields`, an _Internal Server Error_ is raised. ### Steps to reproduce ``` PATCH http://netbox/api/tenancy/tenants/1.json HTTP/1.1 Authorization: Token 8d9c88cbe931258f12a3a606bec8433236d6cc47 User-Agent: Faraday v0.12.1 Content-Type: application/json {\"name\":\"adafafds\",\"slug\":\"adafafds\",\"custom_fields\":{\"customer_id\":928}} HTTP/1.1 500 Internal Server Error date: Wed, 23 Aug 2017 09:32:07 GMT server: Apache api-version: 2.1 vary: Cookie x-frame-options: SAMEORIGIN content-length: 1626 connection: close content-type: text/html; charset=utf-8 <!DOCTYPE html>\n<html lang=\"en\">\n\n<head>\n\t<title>Server Error</title>\n\t<link rel=\"stylesheet\" href=\"/static/bootstrap-3.3.7-dist/css/bootstrap.min.css\">\n <link rel=\"stylesheet\" href=\"/static/font-awesome-4.7.0/css/font-awesome.min.css\">\n</head>\n\n<body>\n <div class=\"container-fluid\">\n <div class=\"row\">\n <div class=\"col-md-4 col-md-offset-4\">\n <div class=\"panel panel-danger\" style=\"margin-top: 200px\">\n <div class=\"panel-heading\">\n <strong>\n <i class=\"fa fa-warning\"></i>\n Server Error\n </strong>\n </div>\n <div class=\"panel-body\">\n <p>There was a problem with your request. This error has been logged and administrative staff have\n been notified. Please return to the home page and try again.</p>\n <p>If you are responsible for this installation, please consider\n <a href=\"https://github.com/digitalocean/netbox/issues\">filing a bug report</a>. Additional\n information is provided below:</p>\n<pre><strong>&lt;type &#39;exceptions.TypeError&#39;&gt;</strong><br />\n&#39;custom_fields&#39; is an invalid keyword argument for this function</pre>\n <div class=\"text-right\">\n <a href=\"/\" class=\"btn btn-primary\">Home Page</a>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</body>\n\n</html>\n" ``` The relevant part seems to be ``` <pre><strong>&lt;type &#39;exceptions.TypeError&#39;&gt;</strong><br /> &#39;custom_fields&#39; is an invalid keyword argument for this function</pre> ``` ### Additional Info The custom field `customer_id` is configured like this: <img width="750" alt="screen shot 2017-08-23 at 11 38 39" src="https://user-images.githubusercontent.com/804532/29609518-c4d6dcc4-87f7-11e7-8f77-3a203c8ac2c8.png">
adam added the status: duplicate label 2025-12-29 16:29:52 +01:00
adam closed this issue 2025-12-29 16:29:52 +01:00
Author
Owner

@Atoms commented on GitHub (Aug 23, 2017):

i think this is duplicate of: https://github.com/digitalocean/netbox/issues/1443 and this is resolved, just needs to be released

@Atoms commented on GitHub (Aug 23, 2017): i think this is duplicate of: https://github.com/digitalocean/netbox/issues/1443 and this is resolved, just needs to be released
Author
Owner

@cimnine commented on GitHub (Aug 23, 2017):

Oh yes, that might be.

@cimnine commented on GitHub (Aug 23, 2017): Oh yes, that might be.
Author
Owner

@jeremystretch commented on GitHub (Aug 23, 2017):

Yeah, should be fixed in v2.1.4, but feel free to request re-opening of this issue if it's not.

@jeremystretch commented on GitHub (Aug 23, 2017): Yeah, should be fixed in v2.1.4, but feel free to request re-opening of this issue if it's not.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#1189