Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error syncing new cable to branch #155

Open
jams1077 opened this issue Oct 16, 2024 · 4 comments
Open

Error syncing new cable to branch #155

jams1077 opened this issue Oct 16, 2024 · 4 comments
Labels
app: branching status: blocked type: bug A confirmed report of unexpected behavior in the application

Comments

@jams1077
Copy link

Plugin Version

0.5.1

NetBox Version

4.1.3

Python Version

3.10.12

Steps to Reproduce

  1. Create Devices A and B with interfaces
  2. Create a new branch
  3. On the Main branch, create a cable between device A interface and device B interface
  4. On the new branch sync changes

Expected Behavior

All changes behind should have synced with the new branch

Observed Behavior

Sync operation fails with error:

"Creating cable <DeserializedObject: dcim.Cable(pk=300)>",
"{'__all__': ['Must define A and B terminations when creating a new cable.']}"
@jams1077 jams1077 added the type: bug A confirmed report of unexpected behavior in the application label Oct 16, 2024
@jams1077
Copy link
Author

jams1077 commented Oct 16, 2024

Commenting out instance.object.full_clean() (line 42) in netbox_branching/models/changes.py solves the issue, but I don't know what implications removing this line could have.

@RedLine89
Copy link

RedLine89 commented Oct 22, 2024

Facing the same issue. It also fails to merge cable changes from a branch into main with the same error.

@jeremystretch
Copy link
Contributor

I think this is caused by a recent change to NetBox, #17577. Changing the evaluation logic from self.pk is None to self._state.adding is True has a subtle implication for this plugin: We want to skip this specific validation rule because in the case of syncing an object, we know that any cable terminations have already been validated.

@jams1077
Copy link
Author

thanks @jeremystretch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app: branching status: blocked type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

No branches or pull requests

4 participants