Skip to content

Unable to execute migration script #3

@marbaa

Description

@marbaa

Hi,

I'm updating prehistoric Netbox environment from v2.x to 4.x. Currently I'm stuck at migrating from v3.11 to v3.2.
I'm unable to properly run netbox_v32_migration migration script.

Netbox is running in Kubernetes. Until now all upgrades steps were fine, even with those with breaking changes.

bash-5.1# source /opt/netbox/venv/bin/activate

(venv) bash-5.1# python3 manage.py nbshell
🧬 loaded config '/etc/netbox/config/configuration.py'
🧬 loaded config '/etc/netbox/config/extra.py'
🧬 loaded config '/etc/netbox/config/logging.py'
🧬 loaded config '/etc/netbox/config/plugins.py'
### NetBox interactive shell (netbox-b4777c578-6m8xr)
### Python 3.9.5 | Django 3.2.12 | NetBox 3.1.11
### lsmodels() will show available models. Use help(<model>) for more info.
>>> from ipam.models import RIR
>>> print(RIR.objects.values('id', 'name'))
<RestrictedQuerySet [{'id': 1, 'name': 'censored-xxx'}]>
>>>
(venv) bash-5.1# python3 manage.py runscript --loglevel debug --data '{"asn_rir": 1}' netbox_v32_migration.MigrateSiteASNsScript
🧬 loaded config '/etc/netbox/config/configuration.py'
🧬 loaded config '/etc/netbox/config/extra.py'
🧬 loaded config '/etc/netbox/config/logging.py'
🧬 loaded config '/etc/netbox/config/plugins.py'
Traceback (most recent call last):
  File "/opt/netbox/netbox/manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/opt/netbox/venv/lib/python3.9/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
    utility.execute()
  File "/opt/netbox/venv/lib/python3.9/site-packages/django/core/management/__init__.py", line 413, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/opt/netbox/venv/lib/python3.9/site-packages/django/core/management/base.py", line 354, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/opt/netbox/venv/lib/python3.9/site-packages/django/core/management/base.py", line 398, in execute
    output = self.handle(*args, **options)
  File "/opt/netbox/netbox/extras/management/commands/runscript.py", line 110, in handle
    script = get_script(module, name)()
TypeError: 'NoneType' object is not callable

Testing the presence of script:

>>> from netbox_v32_migration import MigrateSiteASNsScript
>>> exit(

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions