alexanderfefelov / nav-add-ons

Various stuff for use with NAV (https://nav.uninett.no, https://github.com/Uninett/nav)
MIT License
0 stars 0 forks source link

Job 'inventory' for xxx aborted: Job aborted due to save failure (cause=ValueError('A string literal cannot contain NUL (0x00) characters.')) #1

Closed alexanderfefelov closed 3 years ago

alexanderfefelov commented 4 years ago

Device:

SNR-S2985G-24T#show version
  SNR-S2985G-24T Device, Compiled on Jan 13 21:16:58 2016
  sysLocation Building 57/2,Predelnaya st, Ekaterinburg, Russia
  CPU Mac f8:f0:82:77:12:79
  Vlan MAC f8:f0:82:77:12:78
  SoftWare Version 7.0.3.5(R0241.0085)
  BootRom Version 7.2.25
  HardWare Version 1.0.2
  CPLD Version N/A
  Serial No.:SW067210H503000112
  Copyright (C) 2016 NAG LLC
  All rights reserved
  Last reboot is cold reset.
  Uptime is 0 weeks, 2 days, 8 hours, 12 minutes

nav-add-ons version: c5e62d2

NAV version: 5.0.6 (Uninett/nav@36819dfbcab797ec127ad490e5165cfb2285a70a)

ipdevpolld.log:

2020-09-17 17:46:12,044 [ERROR jobs.jobhandler] [inventory 192-168-98-197.internal] Caught exception during save. Last manager = DefaultManager(<class 'nav.ipdevpoll.shadows.Vlan'>, 'ContainerRepository'(...)). Last model = <class 'nav.ipdevpoll.shadows.Vlan'>
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/nav/ipdevpoll/jobs.py", line 442, in _perform_save
    manager.save()
  File "/usr/local/lib/python3.7/site-packages/nav/ipdevpoll/storage.py", line 87, in save
    obj.save(self.containers)
  File "/usr/local/lib/python3.7/site-packages/nav/ipdevpoll/shadows/__init__.py", line 289, in save
    if (self._revert_vlan_on_type_change_to_scope(containers) or
  File "/usr/local/lib/python3.7/site-packages/nav/ipdevpoll/shadows/__init__.py", line 349, in _revert_vlan_on_type_change_to_scope
    mdl = self.get_existing_model(containers)
  File "/usr/local/lib/python3.7/site-packages/nav/ipdevpoll/shadows/__init__.py", line 328, in get_existing_model
    if vlans:
  File "/usr/local/lib/python3.7/site-packages/django/db/models/query.py", line 254, in __bool__
    self._fetch_all()
  File "/usr/local/lib/python3.7/site-packages/django/db/models/query.py", line 1121, in _fetch_all
    self._result_cache = list(self._iterable_class(self))
  File "/usr/local/lib/python3.7/site-packages/django/db/models/query.py", line 53, in __iter__
    results = compiler.execute_sql(chunked_fetch=self.chunked_fetch)
  File "/usr/local/lib/python3.7/site-packages/django/db/models/sql/compiler.py", line 899, in execute_sql
    raise original_exception
  File "/usr/local/lib/python3.7/site-packages/django/db/models/sql/compiler.py", line 889, in execute_sql
    cursor.execute(sql, params)
  File "/usr/local/lib/python3.7/site-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
ValueError: A string literal cannot contain NUL (0x00) characters.
2020-09-17 17:46:12,047 [ERROR jobs.jobhandler] [inventory 192-168-98-197.internal] Save stage failed with unhandled error
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/threading.py", line 926, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.7/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.7/site-packages/twisted/_threads/_threadworker.py", line 46, in work
    task()
  File "/usr/local/lib/python3.7/site-packages/twisted/_threads/_team.py", line 190, in doWork
    task()
--- <exception caught here> ---
  File "/usr/local/lib/python3.7/site-packages/twisted/python/threadpool.py", line 250, in inContext
    result = inContext.theWork()
  File "/usr/local/lib/python3.7/site-packages/twisted/python/threadpool.py", line 266, in <lambda>
    inContext.theWork = lambda: context.call(ctx, func, *args, **kw)
  File "/usr/local/lib/python3.7/site-packages/twisted/python/context.py", line 122, in callWithContext
    return self.currentContext().callWithContext(ctx, func, *args, **kw)
  File "/usr/local/lib/python3.7/site-packages/twisted/python/context.py", line 85, in callWithContext
    return func(*args,**kw)
  File "/usr/local/lib/python3.7/site-packages/nav/ipdevpoll/db.py", line 100, in _reset
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/nav/ipdevpoll/db.py", line 78, in _cleanup
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/nav/ipdevpoll/jobs.py", line 397, in complete_save_cycle
    result = self._perform_save()
  File "/usr/local/lib/python3.7/site-packages/nav/ipdevpoll/jobs.py", line 442, in _perform_save
    manager.save()
  File "/usr/local/lib/python3.7/site-packages/nav/ipdevpoll/storage.py", line 87, in save
    obj.save(self.containers)
  File "/usr/local/lib/python3.7/site-packages/nav/ipdevpoll/shadows/__init__.py", line 289, in save
    if (self._revert_vlan_on_type_change_to_scope(containers) or
  File "/usr/local/lib/python3.7/site-packages/nav/ipdevpoll/shadows/__init__.py", line 349, in _revert_vlan_on_type_change_to_scope
    mdl = self.get_existing_model(containers)
  File "/usr/local/lib/python3.7/site-packages/nav/ipdevpoll/shadows/__init__.py", line 328, in get_existing_model
    if vlans:
  File "/usr/local/lib/python3.7/site-packages/django/db/models/query.py", line 254, in __bool__
    self._fetch_all()
  File "/usr/local/lib/python3.7/site-packages/django/db/models/query.py", line 1121, in _fetch_all
    self._result_cache = list(self._iterable_class(self))
  File "/usr/local/lib/python3.7/site-packages/django/db/models/query.py", line 53, in __iter__
    results = compiler.execute_sql(chunked_fetch=self.chunked_fetch)
  File "/usr/local/lib/python3.7/site-packages/django/db/models/sql/compiler.py", line 899, in execute_sql
    raise original_exception
  File "/usr/local/lib/python3.7/site-packages/django/db/models/sql/compiler.py", line 889, in execute_sql
    cursor.execute(sql, params)
  File "/usr/local/lib/python3.7/site-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
builtins.ValueError: A string literal cannot contain NUL (0x00) characters.

2020-09-17 17:46:12,048 [ERROR jobs.jobhandler] [inventory 192-168-98-197.internal] Job 'inventory' for 192-168-98-197.internal aborted: Job aborted due to save failure (cause=ValueError('A string literal cannot contain NUL (0x00) characters.'))
2020-09-17 17:46:12,051 [INFO schedule.netboxjobscheduler] [inventory 192-168-98-197.internal] inventory for 192-168-98-197.internal failed in 0:00:06.303356. next run in 0:08:41.999886.
alexanderfefelov commented 4 years ago

Found Uninett/nav#2176 and Uninett/nav#2047.

alexanderfefelov commented 4 years ago

Device firmware upgraded:

SNR-S2985G-24T#show version
  SNR-S2985G-24T Device, Compiled on Sep 12 14:59:03 2020
  sysLocation Building 57/2,Predelnaya st, Ekaterinburg, Russia
  CPU Mac f8:f0:82:77:12:79
  Vlan MAC f8:f0:82:77:12:78
  SoftWare Version 7.0.3.5(R0241.0369)
  BootRom Version 7.2.40
  HardWare Version 1.0.2
  CPLD Version N/A
  Serial No.:SW067210H503000112
  Copyright (C) 2020 NAG LLC
  All rights reserved
  Last reboot is warm reset.
  Uptime is 0 weeks, 0 days, 22 hours, 8 minutes

Results are the same.

alexanderfefelov commented 3 years ago

Device: see above

nav-add-ons version: 794dfdd

NAV version: 5.1.2 (Uninett/nav@90d9a11)

ipdevpolld.log:

2021-03-11 14:34:56,750 [ERROR jobs.jobhandler] [inventory 192-168-98-197.internal] Caught exception during save. Last manager = DefaultManager(<class 'nav.ipdevpoll.shadows.Vlan'>, 'ContainerRepository'(...)). Last model = <class 'nav.ipdevpoll.shadows.Vlan'>
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/nav/ipdevpoll/jobs.py", line 442, in _perform_save
    manager.save()
  File "/usr/local/lib/python3.7/site-packages/nav/ipdevpoll/storage.py", line 87, in save
    obj.save(self.containers)
  File "/usr/local/lib/python3.7/site-packages/nav/ipdevpoll/shadows/__init__.py", line 289, in save
    if (self._revert_vlan_on_type_change_to_scope(containers) or
  File "/usr/local/lib/python3.7/site-packages/nav/ipdevpoll/shadows/__init__.py", line 349, in _revert_vlan_on_type_change_to_scope
    mdl = self.get_existing_model(containers)
  File "/usr/local/lib/python3.7/site-packages/nav/ipdevpoll/shadows/__init__.py", line 328, in get_existing_model
    if vlans:
  File "/usr/local/lib/python3.7/site-packages/django/db/models/query.py", line 278, in __bool__
    self._fetch_all()
  File "/usr/local/lib/python3.7/site-packages/django/db/models/query.py", line 1242, in _fetch_all
    self._result_cache = list(self._iterable_class(self))
  File "/usr/local/lib/python3.7/site-packages/django/db/models/query.py", line 55, in __iter__
    results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
  File "/usr/local/lib/python3.7/site-packages/django/db/models/sql/compiler.py", line 1142, in execute_sql
    cursor.execute(sql, params)
  File "/usr/local/lib/python3.7/site-packages/django/db/backends/utils.py", line 67, in execute
    return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
  File "/usr/local/lib/python3.7/site-packages/django/db/backends/utils.py", line 76, in _execute_with_wrappers
    return executor(sql, params, many, context)
  File "/usr/local/lib/python3.7/site-packages/django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
ValueError: A string literal cannot contain NUL (0x00) characters.
2021-03-11 14:34:56,799 [ERROR jobs.jobhandler] [inventory 192-168-98-197.internal] Save stage failed with unhandled error
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/threading.py", line 926, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.7/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.7/site-packages/twisted/_threads/_threadworker.py", line 46, in work
    task()
  File "/usr/local/lib/python3.7/site-packages/twisted/_threads/_team.py", line 190, in doWork
    task()
--- <exception caught here> ---
2021-03-11 14:34:56,750 [ERROR jobs.jobhandler] [inventory 192-168-98-197.internal] Caught exception during save. Last manager = DefaultManager(<class 'nav.ipdevpoll.shadows.Vlan'>, 'ContainerRepository'(...)). Last model = <class 'nav.ipdevpoll.shadows.Vlan'>
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/nav/ipdevpoll/jobs.py", line 442, in _perform_save
    manager.save()
  File "/usr/local/lib/python3.7/site-packages/nav/ipdevpoll/storage.py", line 87, in save
    obj.save(self.containers)
  File "/usr/local/lib/python3.7/site-packages/nav/ipdevpoll/shadows/__init__.py", line 289, in save
    if (self._revert_vlan_on_type_change_to_scope(containers) or
  File "/usr/local/lib/python3.7/site-packages/nav/ipdevpoll/shadows/__init__.py", line 349, in _revert_vlan_on_type_change_to_scope
    mdl = self.get_existing_model(containers)
  File "/usr/local/lib/python3.7/site-packages/nav/ipdevpoll/shadows/__init__.py", line 328, in get_existing_model
    if vlans:
  File "/usr/local/lib/python3.7/site-packages/django/db/models/query.py", line 278, in __bool__
    self._fetch_all()
  File "/usr/local/lib/python3.7/site-packages/django/db/models/query.py", line 1242, in _fetch_all
    self._result_cache = list(self._iterable_class(self))
  File "/usr/local/lib/python3.7/site-packages/django/db/models/query.py", line 55, in __iter__
    results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
  File "/usr/local/lib/python3.7/site-packages/django/db/models/sql/compiler.py", line 1142, in execute_sql
    cursor.execute(sql, params)
  File "/usr/local/lib/python3.7/site-packages/django/db/backends/utils.py", line 67, in execute
    return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
  File "/usr/local/lib/python3.7/site-packages/django/db/backends/utils.py", line 76, in _execute_with_wrappers
    return executor(sql, params, many, context)
  File "/usr/local/lib/python3.7/site-packages/django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
ValueError: A string literal cannot contain NUL (0x00) characters.
2021-03-11 14:34:56,799 [ERROR jobs.jobhandler] [inventory 192-168-98-197.internal] Save stage failed with unhandled error
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/threading.py", line 926, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.7/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.7/site-packages/twisted/_threads/_threadworker.py", line 46, in work
    task()
  File "/usr/local/lib/python3.7/site-packages/twisted/_threads/_team.py", line 190, in doWork
    task()
--- <exception caught here> ---
  File "/usr/local/lib/python3.7/site-packages/twisted/python/threadpool.py", line 250, in inContext
    result = inContext.theWork()
  File "/usr/local/lib/python3.7/site-packages/twisted/python/threadpool.py", line 266, in <lambda>
    inContext.theWork = lambda: context.call(ctx, func, *args, **kw)
  File "/usr/local/lib/python3.7/site-packages/twisted/python/context.py", line 122, in callWithContext
    return self.currentContext().callWithContext(ctx, func, *args, **kw)
  File "/usr/local/lib/python3.7/site-packages/twisted/python/context.py", line 85, in callWithContext
    return func(*args,**kw)
  File "/usr/local/lib/python3.7/site-packages/nav/ipdevpoll/db.py", line 100, in _reset
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/nav/ipdevpoll/db.py", line 78, in _cleanup
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/nav/ipdevpoll/jobs.py", line 397, in complete_save_cycle
    result = self._perform_save()
  File "/usr/local/lib/python3.7/site-packages/nav/ipdevpoll/jobs.py", line 442, in _perform_save
    manager.save()
  File "/usr/local/lib/python3.7/site-packages/nav/ipdevpoll/storage.py", line 87, in save
    obj.save(self.containers)
  File "/usr/local/lib/python3.7/site-packages/nav/ipdevpoll/shadows/__init__.py", line 289, in save
    if (self._revert_vlan_on_type_change_to_scope(containers) or
  File "/usr/local/lib/python3.7/site-packages/nav/ipdevpoll/shadows/__init__.py", line 349, in _revert_vlan_on_type_change_to_scope
    mdl = self.get_existing_model(containers)
  File "/usr/local/lib/python3.7/site-packages/nav/ipdevpoll/shadows/__init__.py", line 328, in get_existing_model
    if vlans:
  File "/usr/local/lib/python3.7/site-packages/django/db/models/query.py", line 278, in __bool__
    self._fetch_all()
  File "/usr/local/lib/python3.7/site-packages/django/db/models/query.py", line 1242, in _fetch_all
    self._result_cache = list(self._iterable_class(self))
  File "/usr/local/lib/python3.7/site-packages/django/db/models/query.py", line 55, in __iter__
    results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
  File "/usr/local/lib/python3.7/site-packages/django/db/models/sql/compiler.py", line 1142, in execute_sql
    cursor.execute(sql, params)
  File "/usr/local/lib/python3.7/site-packages/django/db/backends/utils.py", line 67, in execute
    return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
  File "/usr/local/lib/python3.7/site-packages/django/db/backends/utils.py", line 76, in _execute_with_wrappers
    return executor(sql, params, many, context)
  File "/usr/local/lib/python3.7/site-packages/django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
builtins.ValueError: A string literal cannot contain NUL (0x00) characters.

2021-03-11 14:34:56,803 [ERROR jobs.jobhandler] [inventory 192-168-98-197.internal] Job 'inventory' for 192-168-98-197.internal aborted: Job aborted due to save failure (cause=ValueError('A string literal cannot contain NUL (0x00) characters.'))
2021-03-11 14:34:56,818 [INFO schedule.netboxjobscheduler] [inventory 192-168-98-197.internal] inventory for 192-168-98-197.internal failed in 0:00:07.153820. next run in 0:09:07.999979.