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

[BUG] ipdevinfo shows empty Function-field for some hosts #2269

Closed
ingeborgoh opened this issue Mar 18, 2021 · 3 comments · Fixed by #2279 or #2952
Closed

[BUG] ipdevinfo shows empty Function-field for some hosts #2269

ingeborgoh opened this issue Mar 18, 2021 · 3 comments · Fixed by #2279 or #2952
Assignees
Labels
Milestone

Comments

@ingeborgoh
Copy link
Contributor

NAV 5.1.2
python37-3.7.9_1
FreeBSD 11.4-RELEASE-p3
postgresql96-server-9.6.20

(Also reported on [email protected] at 16 Dec 2020)

We have several devices where /ipdevinfo shows "Function N/A", but "Edit IP device" (and database queries) shows that data is present. No special characters in the string. No obvious differences from other devices when I look directly in the database. The last batch of these devices were inserted via bulk import.

I have also tried to change the Function string, but still displays as N/A.

It also seems like it is impossible to empty the Function field (both on these devices and others where Function displays properly). If you delete what's written and click Save the text reappears.

@lunkwill42 lunkwill42 self-assigned this Mar 26, 2021
@lunkwill42 lunkwill42 added this to the 5.1.3 milestone Mar 26, 2021
@lunkwill42
Copy link
Member

It appears bulk import stores the function value differently than using the single-netbox edit form in SeedDB.
Also, the value is fetched differently in SeedDB and in ipdevinfo.

The issue seems to be that bulk imports save function as key=NULL, var='function', value='...' into netboxinfo. SeedDB fetches the value through custom code, only keyed by var='function'. ipdevinfo, however, fetches the value in the standard library way, keyed by key='' AND var='function'.

The key difference is that sometimes key is a NULL value, and sometimes it's an empty string, but ipdevinfo will only use a value where key is an empty string 😛

@lunkwill42
Copy link
Member

lunkwill42 commented Mar 26, 2021

Also, apologies that your post to nav-users seems to have gone under the radar, @ingeborgoh

@ingeborgoh
Copy link
Contributor Author

We are now on NAV 5.8.4, but it stills look like this part of the bug is still present:

It is impossible to empty the Function field. If you delete what's written and click Save the text reappears.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment