AttributeError when creating VM #4054

Closed
opened 2025-12-29 18:32:52 +01:00 by adam · 4 comments
Owner

Originally created by @laurence-syree on GitHub (Sep 1, 2020).

Originally assigned to: @jeremystretch on GitHub.

Environment

  • Python version: 3.8.2
  • NetBox version: 2.9.2

Steps to Reproduce

  1. Setup fresh install of Netbox
  2. Add a custom field, name, description and options are unimportant, but the field type must be "selection"
  3. Add a webhook, name, description, and URL are unimportant, but it must be assigned to virtual machines, enabled, and set to trigger on create.
  4. Add a cluster type, names etc unimportant
  5. Create a VM (names/data unimportant)

Expected Behavior

VM is created

Observed Behavior

Error is thrown:

Got AttributeError when attempting to get a value for field `value` on serializer `CustomFieldChoiceSerializer`.
The serializer field might be named incorrectly and not match any attribute or key on the `str` instance.
Original exception text was: 'str' object has no attribute 'pk'.

Disabling the webhook is a temporary workaround for this issue to create vms.

Originally created by @laurence-syree on GitHub (Sep 1, 2020). Originally assigned to: @jeremystretch on GitHub. ### Environment * Python version: 3.8.2 * NetBox version: 2.9.2 ### Steps to Reproduce 1. Setup fresh install of Netbox 2. Add a custom field, name, description and options are unimportant, but the field type must be "selection" 3. Add a webhook, name, description, and URL are unimportant, but it must be assigned to virtual machines, enabled, and set to trigger on create. 4. Add a cluster type, names etc unimportant 5. Create a VM (names/data unimportant) <!-- What did you expect to happen? --> ### Expected Behavior VM is created <!-- What happened instead? --> ### Observed Behavior Error is thrown: ``` Got AttributeError when attempting to get a value for field `value` on serializer `CustomFieldChoiceSerializer`. The serializer field might be named incorrectly and not match any attribute or key on the `str` instance. Original exception text was: 'str' object has no attribute 'pk'. ``` Disabling the webhook is a temporary workaround for this issue to create vms.
adam added the type: bugstatus: accepted labels 2025-12-29 18:32:52 +01:00
adam closed this issue 2025-12-29 18:32:52 +01:00
Author
Owner

@skredder commented on GitHub (Sep 7, 2020):

Running 2.9.3 and can confirm that I still see this error, disabling webhooks to workaround the issue

@skredder commented on GitHub (Sep 7, 2020): Running 2.9.3 and can confirm that I still see this error, disabling webhooks to workaround the issue
Author
Owner

@laurence-syree commented on GitHub (Sep 8, 2020):

We upgraded to v2.9.3 last night and it seems that creating a VM works with the webhook enabled but editing a VM still causes the same error.

@laurence-syree commented on GitHub (Sep 8, 2020): We upgraded to v2.9.3 last night and it seems that creating a VM works with the webhook enabled but editing a VM still causes the same error.
Author
Owner

@jeremystretch commented on GitHub (Sep 8, 2020):

@syreel you likely need to restart the RQ worker process. Testing prior to release confirmed that this bug has been fixed, so if you continue to experience issues after upgrading and restarting the RQ worker, please open a new bug listing the exact steps that someone else can take to replicate the observed issue.

@jeremystretch commented on GitHub (Sep 8, 2020): @syreel you likely need to restart the RQ worker process. Testing prior to release confirmed that this bug has been fixed, so if you continue to experience issues after upgrading and restarting the RQ worker, please open a new bug listing the exact steps that someone else can take to replicate the observed issue.
Author
Owner

@WilliamMarti commented on GitHub (Sep 8, 2020):

I still seem to be having as well, opened #5109

@WilliamMarti commented on GitHub (Sep 8, 2020): I still seem to be having as well, opened #5109
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#4054