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

Mandatory tenant for devices #17

Open
naciohr opened this issue Sep 27, 2024 · 2 comments
Open

Mandatory tenant for devices #17

naciohr opened this issue Sep 27, 2024 · 2 comments
Labels
status: needs triage This issue is awaiting triage by a maintainer

Comments

@naciohr
Copy link

naciohr commented Sep 27, 2024

Dear Netboxlabs team,

I've been doing tests with the diode client and the server. While I found the data ingestion process successful, the reconciler happens to fail to create new devices due to the empty tenant restriction. Actually, I reached to the same if I try to add a device directly in Netbox.

I checked the documentation and there's no option to specify a tenant for a Device object.

The following messages come out the diode-reconciler container:

{
  "time": "2024-09-27T09:28:28.831843289Z",
  "level": "DEBUG",
  "msg": "apply change set",
  "response": "{\"change_set_id\":\"1a058445-ae17-4ce5-aa29-21fbd6ea1a8d\",\"result\":\"failed\",\"errors\":[{\"change_id\":\"0b3936ab-8ffe-4867-ba29-5673928c14f0\",\"__all__\":\"__all__: Custom validation failed for tenant: ['This field must not be empty.']\"}]}"
}

This seems to be in effect by the Validation configuration of Netbox server.
imaxe

Although this validation can be disabled in the configuration, I find it necessary for a correct organisational structure.

In addition to this, I tested to edit an existent device and while it's able to spot it correctly, it fails to update the properties (status in this case) even though it's linked to an existent tenant.

{
  "time": "2024-09-27T10:07:49.489919496Z",
  "level": "DEBUG",
  "msg": "ingest entity key",
  "key": "ingest-entity:dcim.device-1727431669480617735-edb1ff87-5ad4-4071-ac2c-ac896cdd4f36"
}
{
  "time": "2024-09-27T10:07:49.894569542Z",
  "level": "DEBUG",
  "msg": "apply change set",
  "payload": "{\"change_set_id\":\"aa8497e6-fb07-4e1e-a2cc-4ddba491b347\",\"change_set\":[{\"change_id\":\"74cfdecb-6ef5-47b5-b4f1-0b6e99309544\",\"change_type\":\"update\",\"object_type\":\"dcim.device\",\"object_id\":15237,\"data\":{\"id\":15237,\"name\":\"A_NAME\",\"site\":{\"id\":107},\"role\":{\"id\":19},\"device_type\":{\"id\":562},\"serial\":\"\",\"description\":\"\",\"status\":\"active\",\"comments\":\"\"}}]}"
}
{
  "time": "2024-09-27T10:07:49.937858088Z",
  "level": "DEBUG",
  "msg": "apply change set",
  "response": "{\"change_set_id\":\"aa8497e6-fb07-4e1e-a2cc-4ddba491b347\",\"result\":\"failed\",\"errors\":[{\"change_id\":\"74cfdecb-6ef5-47b5-b4f1-0b6e99309544\",\"__all__\":\"__all__: Custom validation failed for tenant: ['This field must not be empty.']\"}]}"
}
{
  "time": "2024-09-27T10:07:49.93880686Z",
  "level": "WARN",
  "msg": "failed to handle ingest request",
  "request_id": "5f0c9151-c66f-49b7-b7d4-754feb835f64",
  "errors": [
    "msg: failed to apply change set, code: 400, change set id: aa8497e6-fb07-4e1e-a2cc-4ddba491b347, result: failed, errors: [{\"__all__\":\"__all__: Custom validation failed for tenant: ['This field must not be empty.']\",\"change_id\":\"74cfdecb-6ef5-47b5-b4f1-0b6e99309544\"}]"
  ]
}

Therefore I would like to ask you if there's a way to overcome this constraint or if there's a parameter I'm missing in the documentation.

Thanks and regards,

@mfiedorowicz
Copy link
Member

Hi @naciohr, thanks for raising the issue. At the moment diode doesn't have support for custom validators. The workaround could be to specify tenant along with device during ingestion, but tenant is not supported object type in diode yet either, so we would have to plan work needed to cover both use cases. We're going to keep you updated over here once we know more.

@mfiedorowicz mfiedorowicz added the status: needs triage This issue is awaiting triage by a maintainer label Oct 21, 2024
@moppmans
Copy link

Hey all, any updates on this? I implemented Diode and wondered why all devices got changes from a tenant given value to tenant=None because object is not supportet. WIll this be implemented soon or will it need a permanently workaround?

BR Matthias

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs triage This issue is awaiting triage by a maintainer
Projects
None yet
Development

No branches or pull requests

3 participants