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

OS error: 'coroutine' object has no attribute 'id' #129

Open
islepnev opened this issue Jul 21, 2023 · 3 comments
Open

OS error: 'coroutine' object has no attribute 'id' #129

islepnev opened this issue Jul 21, 2023 · 3 comments
Assignees
Labels
bug Further discussion is needed to determine this issue's scope and/or implementation under review Further discussion is needed to determine this issue's scope and/or implementation

Comments

@islepnev
Copy link

islepnev commented Jul 21, 2023

Hello,
installed from git devel, followed the instructions.
NetBox 3.5.6
Proxmox 8.0.3, 7.4.16 (same problems)

There are already nodes in netbox, it should not be a problem, but something went wrong and I got empty result after pressing "Proxmox Update" button:

[
    {
        "message": "OS error: 'coroutine' object has no attribute 'id'"
    }
]

Here is the log:

Jul 21 20:12:11 netbox.example.com gunicorn[122137]: Start process Sequential
Jul 21 20:12:11 netbox.example.com gunicorn[122137]: Processing data for: pve1.example.com
Jul 21 20:12:11 netbox.example.com gunicorn[122137]: [Proxbox - Netbox plugin | Update All]
Jul 21 20:12:11 netbox.example.com gunicorn[122137]: /opt/netbox/netbox/netbox-proxbox/netbox_proxbox/proxbox_api/create/virtualization.py:86: RuntimeWarning: coroutine 'tag' was never awaited
Jul 21 20:12:11 netbox.example.com gunicorn[122137]:   search_tag = cluster_proxbox.tags.index(extras.tag())
Jul 21 20:12:11 netbox.example.com gunicorn[122137]: RuntimeWarning: Enable tracemalloc to get the object allocation traceback
Jul 21 20:12:11 netbox.example.com gunicorn[122137]: WARNING:root:[WARNING] Cluster with the same name as C5 already exists.
Jul 21 20:12:11 netbox.example.com gunicorn[122137]: > Proxbox will create another one with (2) in the name
Jul 21 20:12:11 netbox.example.com gunicorn[122137]: <coroutine object tag at 0x7fc3f25dbcc0> is not in list
Jul 21 20:12:11 netbox.example.com gunicorn[122137]: /opt/netbox/netbox/netbox-proxbox/netbox_proxbox/proxbox_api/create/virtualization.py:117: RuntimeWarning: coroutine 'tag' was never awaited
Jul 21 20:12:11 netbox.example.com gunicorn[122137]:   tags = [extras.tag().id]
Jul 21 20:12:11 netbox.example.com gunicorn[122137]: RuntimeWarning: Enable tracemalloc to get the object allocation traceback
Jul 21 20:12:11 netbox.example.com gunicorn[122137]: CLUSTER...
Jul 21 20:12:11 netbox.example.com gunicorn[122137]: NODES...
Jul 21 20:12:12 netbox.example.com gunicorn[122137]: /opt/netbox/netbox/netbox-proxbox/netbox_proxbox/proxbox_api/update.py:425: RuntimeWarning: coroutine 'tag' was never awaited
Jul 21 20:12:12 netbox.example.com gunicorn[122137]:   search_tag = netbox_search.tags.index(extras.tag())
Jul 21 20:12:12 netbox.example.com gunicorn[122137]: RuntimeWarning: Enable tracemalloc to get the object allocation traceback
Jul 21 20:12:12 netbox.example.com gunicorn[122137]: WARNING:root:[WARNING] Device with the same name as pve1 already exists.
Jul 21 20:12:12 netbox.example.com gunicorn[122137]: > Proxbox will create another one with (2) in the name
Jul 21 20:12:12 netbox.example.com gunicorn[122137]: <coroutine object tag at 0x7fc3f1c4dbc0> is not in list
Jul 21 20:12:12 netbox.example.com gunicorn[122137]: /opt/netbox/netbox/netbox-proxbox/netbox_proxbox/proxbox_api/create/dcim.py:137: RuntimeWarning: coroutine 'role' was never awaited
Jul 21 20:12:12 netbox.example.com gunicorn[122137]:   node_json["device_role"] = extras.role(role_id = NETBOX_NODE_ROLE_ID).id
Jul 21 20:12:12 netbox.example.com gunicorn[122137]: RuntimeWarning: Enable tracemalloc to get the object allocation traceback
Jul 21 20:12:12 netbox.example.com gunicorn[122137]: OS error: 'coroutine' object has no attribute 'id'
Jul 21 20:12:12 netbox.example.com gunicorn[122137]: --- 0.5793492794036865 seconds ---
@emersonfelipesp emersonfelipesp self-assigned this Jul 21, 2023
@emersonfelipesp emersonfelipesp added bug Further discussion is needed to determine this issue's scope and/or implementation under review Further discussion is needed to determine this issue's scope and/or implementation labels Jul 21, 2023
@emersonfelipesp emersonfelipesp added this to To do in Proxbox Plugin - Project Plan via automation Jul 21, 2023
@emersonfelipesp
Copy link
Member

I'm aware of this error, try using v0.0.5 while I solve it

@chodorenko
Copy link

@emersonfelipesp
Have the same issue on developer version.
I test multi-cluster and revert netbox_proxbox/proxbox_api/init.py to old version for normal load function load work as there
redefine 'password': None in plugins.py for use token and retrieve same error

netbox2_netbox.    | Start process Sequential
netbox2_netbox.    | Processing data for: 85.206.X.X
netbox2_netbox.    | [Proxbox - Netbox plugin | Update All]
netbox2_netbox.    | 🧬 loaded config '/etc/netbox/config/ldap/ldap_config.py'
netbox2_netbox.    | 🧬 loaded config '/etc/netbox/config/ldap/extra.py'
netbox2_netbox.    | 127.0.0.1 - - [31/Jul/2023:14:51:24 +0000] "GET /api/virtualization/cluster-types/?name=Proxmox&slug=proxmox&limit=0 HTTP/1.1" 200 396 "-" "python-requests/2.31.0"
netbox2_netbox.    | 127.0.0.1 - - [31/Jul/2023:14:51:24 +0000] "GET /api/virtualization/clusters/?name=DC-101&type=proxmox&limit=0 HTTP/1.1" 200 52 "-" "python-requests/2.31.0"
netbox2_netbox.    | 127.0.0.1 - - [31/Jul/2023:14:51:24 +0000] "GET /api/virtualization/cluster-types/?name=Proxmox&slug=proxmox&limit=0 HTTP/1.1" 200 396 "-" "python-requests/2.31.0"
netbox2_netbox.    | /opt/netbox/netbox/netbox-proxbox/netbox_proxbox/proxbox_api/create/virtualization.py:134: RuntimeWarning: coroutine 'tag' was never awaited
netbox2_netbox.    |   return f"Error creating the '{proxmox_cluster_name}' cluster. Possible errors: the name '{proxmox_cluster_name}' is already used."
netbox2_netbox.    | RuntimeWarning: Enable tracemalloc to get the object allocation traceback
netbox2_netbox.    |
netbox2_netbox.    |
netbox2_netbox.    |
netbox2_netbox.    | CLUSTER...
netbox2_netbox.    | [OK] Cluster created. -> Error creating the 'DC-101' cluster. Possible errors: the name 'DC-101' is already used.
netbox2_netbox.    |
netbox2_netbox.    |
netbox2_netbox.    |
netbox2_netbox.    | NODES...
netbox2_netbox.    | 127.0.0.1 - - [31/Jul/2023:14:51:24 +0000] "GET /api/dcim/devices/?name=prx1&limit=0 HTTP/1.1" 200 52 "-" "python-requests/2.31.0"
netbox2_netbox.    | OS error: 'coroutine' object has no attribute 'id'
netbox2_netbox.    | /opt/netbox/netbox/netbox-proxbox/netbox_proxbox/proxbox_api/update.py:531: RuntimeWarning: coroutine 'role' was never awaited
netbox2_netbox.    |   results.append(output)
netbox2_netbox.    | RuntimeWarning: Enable tracemalloc to get the object allocation traceback
netbox2_netbox.    | --- 0.33696579933166504 seconds ---
netbox2_netbox.    | 10.0.0.2 - - [31/Jul/2023:14:51:25 +0000] "POST /plugins/proxbox/single_update/ HTTP/1.0" 200 85509 "https://netbox/plugins/proxbox/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 
netbox2_netbox.    | 127.0.0.1 - - [31/Jul/2023:14:51:28 +0000] "GET /api/ HTTP/1.1" 200 510 "-" "curl/7.81.0"

alryaz added a commit to alryaz/netbox-proxbox that referenced this issue Oct 10, 2023
@alryaz
Copy link

alryaz commented Oct 10, 2023

This regression is introduced by 42a2bc5

Code is shared between pynetbox calls and FastAPI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Further discussion is needed to determine this issue's scope and/or implementation under review Further discussion is needed to determine this issue's scope and/or implementation
Development

No branches or pull requests

4 participants