KeyError: 'interface:type' #141

Closed
opened 2020-06-30 18:51:45 +02:00 by strus38 · 10 comments
strus38 commented 2020-06-30 18:51:45 +02:00 (Migrated from github.com)

Hi

Running on virtualbox.

Traceback (most recent call last): File "/usr/local/bin/netbox_agent", line 11, in <module> sys.exit(main()) File "/usr/local/lib/python3.6/dist-packages/netbox_agent/cli.py", line 44, in main return run(config) File "/usr/local/lib/python3.6/dist-packages/netbox_agent/cli.py", line 39, in run server.netbox_create_or_update(config) File "/usr/local/lib/python3.6/dist-packages/netbox_agent/virtualmachine.py", line 76, in netbox_create_or_update self.network.create_or_update_netbox_network_cards() File "/usr/local/lib/python3.6/dist-packages/netbox_agent/network.py", line 399, in create_or_update_netbox_network_cards interface = self.create_netbox_nic(nic) File "/usr/local/lib/python3.6/dist-packages/netbox_agent/network.py", line 246, in create_netbox_nic type = self.get_netbox_type_for_nic(nic) File "/usr/local/lib/python3.6/dist-packages/netbox_agent/network.py", line 162, in get_netbox_type_for_nic return self.dcim_choices['interface:type']['Virtual'] KeyError: 'interface:type'

Hi Running on virtualbox. `Traceback (most recent call last): File "/usr/local/bin/netbox_agent", line 11, in <module> sys.exit(main()) File "/usr/local/lib/python3.6/dist-packages/netbox_agent/cli.py", line 44, in main return run(config) File "/usr/local/lib/python3.6/dist-packages/netbox_agent/cli.py", line 39, in run server.netbox_create_or_update(config) File "/usr/local/lib/python3.6/dist-packages/netbox_agent/virtualmachine.py", line 76, in netbox_create_or_update self.network.create_or_update_netbox_network_cards() File "/usr/local/lib/python3.6/dist-packages/netbox_agent/network.py", line 399, in create_or_update_netbox_network_cards interface = self.create_netbox_nic(nic) File "/usr/local/lib/python3.6/dist-packages/netbox_agent/network.py", line 246, in create_netbox_nic type = self.get_netbox_type_for_nic(nic) File "/usr/local/lib/python3.6/dist-packages/netbox_agent/network.py", line 162, in get_netbox_type_for_nic return self.dcim_choices['interface:type']['Virtual'] KeyError: 'interface:type'`
Solvik commented 2020-07-01 12:45:36 +02:00 (Migrated from github.com)

Hi @strus38

I'll test this today

Hi @strus38 I'll test this today
strus38 commented 2020-07-01 19:24:53 +02:00 (Migrated from github.com)

Any luck? ;-)

Any luck? ;-)
Solvik commented 2020-07-01 19:48:47 +02:00 (Migrated from github.com)

I haven't been able to reproduce your issue. Which netbox version are you using ?

I haven't been able to reproduce your issue. Which netbox version are you using ?
strus38 commented 2020-07-01 19:51:16 +02:00 (Migrated from github.com)

Netbox 2.2.6, let me upgrade and I come back to you.
Thanks!

Le mer. 1 juil. 2020 à 19:49, Solvik notifications@github.com a écrit :

I haven't been able to reproduce your issue. Which netbox version are you
using ?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/Solvik/netbox-agent/issues/141#issuecomment-652560538,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ABM6DUZUZOV3CR77LKPL3DDRZNZI5ANCNFSM4OMOMW3A
.

Netbox 2.2.6, let me upgrade and I come back to you. Thanks! Le mer. 1 juil. 2020 à 19:49, Solvik <notifications@github.com> a écrit : > I haven't been able to reproduce your issue. Which netbox version are you > using ? > > — > You are receiving this because you were mentioned. > Reply to this email directly, view it on GitHub > <https://github.com/Solvik/netbox-agent/issues/141#issuecomment-652560538>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/ABM6DUZUZOV3CR77LKPL3DDRZNZI5ANCNFSM4OMOMW3A> > . >
Solvik commented 2020-07-01 19:54:28 +02:00 (Migrated from github.com)

Oh, it's a very old version.
You have this error because in the latest release I've upgraded netbox-agent to be able to use the deprecation of the choice method (https://github.com/Solvik/netbox-agent/pull/127) that happened in 2.8 :)

Oh, it's a very old version. You have this error because in the latest release I've upgraded `netbox-agent` to be able to use the deprecation of the choice method (https://github.com/Solvik/netbox-agent/pull/127) that happened in 2.8 :)
strus38 commented 2020-07-01 19:56:20 +02:00 (Migrated from github.com)

Reinstalling the 2.8 as we speak. Thanks!

Le mer. 1 juil. 2020 à 19:54, Solvik notifications@github.com a écrit :

Oh, it's a very old version.
You have this error because in the latest release I've upgraded
netbox-agent to be able to use the deprecation of the choice method (#127
https://github.com/Solvik/netbox-agent/pull/127) that happened in 2.8 :)


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/Solvik/netbox-agent/issues/141#issuecomment-652563130,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ABM6DU7NGDUQQJMKH4O6NT3RZNZ6FANCNFSM4OMOMW3A
.

Reinstalling the 2.8 as we speak. Thanks! Le mer. 1 juil. 2020 à 19:54, Solvik <notifications@github.com> a écrit : > Oh, it's a very old version. > You have this error because in the latest release I've upgraded > netbox-agent to be able to use the deprecation of the choice method (#127 > <https://github.com/Solvik/netbox-agent/pull/127>) that happened in 2.8 :) > > — > You are receiving this because you were mentioned. > Reply to this email directly, view it on GitHub > <https://github.com/Solvik/netbox-agent/issues/141#issuecomment-652563130>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/ABM6DU7NGDUQQJMKH4O6NT3RZNZ6FANCNFSM4OMOMW3A> > . >
strus38 commented 2020-07-01 20:08:35 +02:00 (Migrated from github.com)

Works like a charm, except the 'tun0' interfaces ... But I skipped them for
now.
Thanks!

Le mer. 1 juil. 2020 à 19:56, Indigo Ping indigoping4cgmi@gmail.com a
écrit :

Reinstalling the 2.8 as we speak. Thanks!

Le mer. 1 juil. 2020 à 19:54, Solvik notifications@github.com a écrit :

Oh, it's a very old version.
You have this error because in the latest release I've upgraded
netbox-agent to be able to use the deprecation of the choice method (#127
https://github.com/Solvik/netbox-agent/pull/127) that happened in 2.8
:)


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/Solvik/netbox-agent/issues/141#issuecomment-652563130,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ABM6DU7NGDUQQJMKH4O6NT3RZNZ6FANCNFSM4OMOMW3A
.

Works like a charm, except the 'tun0' interfaces ... But I skipped them for now. Thanks! Le mer. 1 juil. 2020 à 19:56, Indigo Ping <indigoping4cgmi@gmail.com> a écrit : > Reinstalling the 2.8 as we speak. Thanks! > > Le mer. 1 juil. 2020 à 19:54, Solvik <notifications@github.com> a écrit : > >> Oh, it's a very old version. >> You have this error because in the latest release I've upgraded >> netbox-agent to be able to use the deprecation of the choice method (#127 >> <https://github.com/Solvik/netbox-agent/pull/127>) that happened in 2.8 >> :) >> >> — >> You are receiving this because you were mentioned. >> Reply to this email directly, view it on GitHub >> <https://github.com/Solvik/netbox-agent/issues/141#issuecomment-652563130>, >> or unsubscribe >> <https://github.com/notifications/unsubscribe-auth/ABM6DU7NGDUQQJMKH4O6NT3RZNZ6FANCNFSM4OMOMW3A> >> . >> >
Solvik commented 2020-07-01 20:28:28 +02:00 (Migrated from github.com)

I'd be happy to know why and fix it if necessary

Le mer. 1 juil. 2020 à 20:08, strus38 notifications@github.com a écrit :

Works like a charm, except the 'tun0' interfaces ... But I skipped them for
now.
Thanks!

Le mer. 1 juil. 2020 à 19:56, Indigo Ping indigoping4cgmi@gmail.com a
écrit :

Reinstalling the 2.8 as we speak. Thanks!

Le mer. 1 juil. 2020 à 19:54, Solvik notifications@github.com a écrit
:

Oh, it's a very old version.
You have this error because in the latest release I've upgraded
netbox-agent to be able to use the deprecation of the choice method
(#127
https://github.com/Solvik/netbox-agent/pull/127) that happened in 2.8
:)


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<
https://github.com/Solvik/netbox-agent/issues/141#issuecomment-652563130>,
or unsubscribe
<
https://github.com/notifications/unsubscribe-auth/ABM6DU7NGDUQQJMKH4O6NT3RZNZ6FANCNFSM4OMOMW3A

.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/Solvik/netbox-agent/issues/141#issuecomment-652569721,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AABRIILKVDLDCLZZ76W5JQLRZN3THANCNFSM4OMOMW3A
.

I'd be happy to know why and fix it if necessary Le mer. 1 juil. 2020 à 20:08, strus38 <notifications@github.com> a écrit : > Works like a charm, except the 'tun0' interfaces ... But I skipped them for > now. > Thanks! > > Le mer. 1 juil. 2020 à 19:56, Indigo Ping <indigoping4cgmi@gmail.com> a > écrit : > > > Reinstalling the 2.8 as we speak. Thanks! > > > > Le mer. 1 juil. 2020 à 19:54, Solvik <notifications@github.com> a écrit > : > > > >> Oh, it's a very old version. > >> You have this error because in the latest release I've upgraded > >> netbox-agent to be able to use the deprecation of the choice method > (#127 > >> <https://github.com/Solvik/netbox-agent/pull/127>) that happened in 2.8 > >> :) > >> > >> — > >> You are receiving this because you were mentioned. > >> Reply to this email directly, view it on GitHub > >> < > https://github.com/Solvik/netbox-agent/issues/141#issuecomment-652563130>, > >> or unsubscribe > >> < > https://github.com/notifications/unsubscribe-auth/ABM6DU7NGDUQQJMKH4O6NT3RZNZ6FANCNFSM4OMOMW3A > > > >> . > >> > > > > — > You are receiving this because you commented. > Reply to this email directly, view it on GitHub > <https://github.com/Solvik/netbox-agent/issues/141#issuecomment-652569721>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AABRIILKVDLDCLZZ76W5JQLRZN3THANCNFSM4OMOMW3A> > . >
strus38 commented 2020-07-01 20:37:29 +02:00 (Migrated from github.com)

Here is the error when those kind of interfacees are up:

8: tunl0@NONE: <NOARP,UP,LOWER_UP> mtu 1440 qdisc noqueue state UNKNOWN group default qlen 1000
    link/ipip 0.0.0.0 brd 0.0.0.0
    inet 172.18.134.0/32 brd 172.18.134.0 scope global tunl0
       valid_lft forever preferred_lft forever
DEBUG:urllib3.connectionpool:http://10.103.23.86:80 "GET /api/virtualization/interfaces/?mac_address=00%3A00%3A00%3A00&name=tunl0&virtual_machine_id=2 HTTP/1.1" 500 1791
Traceback (most recent call last):
  File "/usr/local/bin/netbox_agent", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.6/dist-packages/netbox_agent/cli.py", line 44, in main
    return run(config)
  File "/usr/local/lib/python3.6/dist-packages/netbox_agent/cli.py", line 39, in run
    server.netbox_create_or_update(config)
  File "/usr/local/lib/python3.6/dist-packages/netbox_agent/virtualmachine.py", line 76, in netbox_create_or_update
    self.network.create_or_update_netbox_network_cards()
  File "/usr/local/lib/python3.6/dist-packages/netbox_agent/network.py", line 394, in create_or_update_netbox_network_cards
    interface = self.get_netbox_network_card(nic)
  File "/usr/local/lib/python3.6/dist-packages/netbox_agent/network.py", line 151, in get_netbox_network_card
    **self.custom_arg_id,
  File "/usr/local/lib/python3.6/dist-packages/pynetbox/core/endpoint.py", line 139, in get
    filter_lookup = self.filter(**kwargs)
  File "/usr/local/lib/python3.6/dist-packages/pynetbox/core/endpoint.py", line 227, in filter
    ret = [self._response_loader(i) for i in req.get()]
  File "/usr/local/lib/python3.6/dist-packages/pynetbox/core/query.py", line 350, in get
    return req_all()
  File "/usr/local/lib/python3.6/dist-packages/pynetbox/core/query.py", line 303, in req_all
    req = self._make_call(add_params=add_params)
  File "/usr/local/lib/python3.6/dist-packages/pynetbox/core/query.py", line 274, in _make_call
    raise RequestError(req)
pynetbox.core.query.RequestError: The request failed with code 500 Internal Server Error but more specific details were not returned in json. Check the NetBox Logs or investigate this exception's error attribute.```
Here is the error when those kind of interfacees are up: ``` 8: tunl0@NONE: <NOARP,UP,LOWER_UP> mtu 1440 qdisc noqueue state UNKNOWN group default qlen 1000 link/ipip 0.0.0.0 brd 0.0.0.0 inet 172.18.134.0/32 brd 172.18.134.0 scope global tunl0 valid_lft forever preferred_lft forever ``` ``` DEBUG:urllib3.connectionpool:http://10.103.23.86:80 "GET /api/virtualization/interfaces/?mac_address=00%3A00%3A00%3A00&name=tunl0&virtual_machine_id=2 HTTP/1.1" 500 1791 Traceback (most recent call last): File "/usr/local/bin/netbox_agent", line 11, in <module> sys.exit(main()) File "/usr/local/lib/python3.6/dist-packages/netbox_agent/cli.py", line 44, in main return run(config) File "/usr/local/lib/python3.6/dist-packages/netbox_agent/cli.py", line 39, in run server.netbox_create_or_update(config) File "/usr/local/lib/python3.6/dist-packages/netbox_agent/virtualmachine.py", line 76, in netbox_create_or_update self.network.create_or_update_netbox_network_cards() File "/usr/local/lib/python3.6/dist-packages/netbox_agent/network.py", line 394, in create_or_update_netbox_network_cards interface = self.get_netbox_network_card(nic) File "/usr/local/lib/python3.6/dist-packages/netbox_agent/network.py", line 151, in get_netbox_network_card **self.custom_arg_id, File "/usr/local/lib/python3.6/dist-packages/pynetbox/core/endpoint.py", line 139, in get filter_lookup = self.filter(**kwargs) File "/usr/local/lib/python3.6/dist-packages/pynetbox/core/endpoint.py", line 227, in filter ret = [self._response_loader(i) for i in req.get()] File "/usr/local/lib/python3.6/dist-packages/pynetbox/core/query.py", line 350, in get return req_all() File "/usr/local/lib/python3.6/dist-packages/pynetbox/core/query.py", line 303, in req_all req = self._make_call(add_params=add_params) File "/usr/local/lib/python3.6/dist-packages/pynetbox/core/query.py", line 274, in _make_call raise RequestError(req) pynetbox.core.query.RequestError: The request failed with code 500 Internal Server Error but more specific details were not returned in json. Check the NetBox Logs or investigate this exception's error attribute.```
Solvik commented 2020-07-02 12:23:22 +02:00 (Migrated from github.com)

Ok so there's in fact a buf for TUN interface on virtual machine

Interface's type with VM can only be virtual, we'll have to fix this

Ok so there's in fact a buf for TUN interface on virtual machine Interface's type with VM can only be virtual, we'll have to fix this
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: DGNum/netbox-agent#141
No description provided.