graphql.error.graphql_error.GraphQLError: Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but '1200' does not. #5421

Closed
opened 2025-12-29 19:27:45 +01:00 by adam · 5 comments
Owner

Originally created by @alarig on GitHub (Sep 23, 2021).

NetBox version

v3.0.3

Python version

3.9

Steps to Reproduce

  1. Upgrade from 2.11.12
  2. Run the upgrade script

Expected Behavior

Migrations

Observed Behavior

graphql.error.graphql_error.GraphQLError

netbox@roucool /opt/netbox-3.0.3 $ python3 netbox/manage.py showmigrations
Traceback (most recent call last):
  File "/opt/netbox-3.0.3/netbox/manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/lib/python3.9/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
    utility.execute()
  File "/usr/lib/python3.9/site-packages/django/core/management/__init__.py", line 413, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/lib/python3.9/site-packages/django/core/management/base.py", line 354, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/lib/python3.9/site-packages/django/core/management/base.py", line 393, in execute
    self.check()
  File "/usr/lib/python3.9/site-packages/django/core/management/base.py", line 419, in check
    all_issues = checks.run_checks(
  File "/usr/lib/python3.9/site-packages/django/core/checks/registry.py", line 76, in run_checks
    new_errors = check(app_configs=app_configs, databases=databases)
  File "/usr/lib/python3.9/site-packages/django/core/checks/urls.py", line 13, in check_url_config
    return check_resolver(resolver)
  File "/usr/lib/python3.9/site-packages/django/core/checks/urls.py", line 23, in check_resolver
    return check_method()
  File "/usr/lib/python3.9/site-packages/django/urls/resolvers.py", line 412, in check
    for pattern in self.url_patterns:
  File "/usr/lib/python3.9/site-packages/django/utils/functional.py", line 48, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/usr/lib/python3.9/site-packages/django/urls/resolvers.py", line 598, in url_patterns
    patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
  File "/usr/lib/python3.9/site-packages/django/utils/functional.py", line 48, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/usr/lib/python3.9/site-packages/django/urls/resolvers.py", line 591, in urlconf_module
    return import_module(self.urlconf_name)
  File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/opt/netbox-3.0.3/netbox/netbox/urls.py", line 11, in <module>
    from netbox.graphql.schema import schema
  File "/opt/netbox-3.0.3/netbox/netbox/graphql/schema.py", line 4, in <module>
    from dcim.graphql.schema import DCIMQuery
  File "/opt/netbox-3.0.3/netbox/dcim/graphql/schema.py", line 4, in <module>
    from .types import *
  File "/opt/netbox-3.0.3/netbox/dcim/graphql/types.py", line 93, in <module>
    class ConsolePortType(ComponentObjectType):
  File "/usr/lib/python3.9/site-packages/graphene/types/objecttype.py", line 30, in __new__
    base_cls = super().__new__(
  File "/usr/lib/python3.9/site-packages/graphene/utils/subclass_with_meta.py", line 46, in __init_subclass__
    super_class.__init_subclass_with_meta__(**options)
  File "/usr/lib/python3.9/site-packages/graphene_django/types.py", line 227, in __init_subclass_with_meta__
    construct_fields(model, registry, fields, exclude, convert_choices_to_enum),
  File "/usr/lib/python3.9/site-packages/graphene_django/types.py", line 63, in construct_fields
    converted = convert_django_field_with_choices(
  File "/usr/lib/python3.9/site-packages/graphene_django/converter.py", line 109, in convert_django_field_with_choices
    enum = convert_choice_field_to_enum(field)
  File "/usr/lib/python3.9/site-packages/graphene_django/converter.py", line 97, in convert_choice_field_to_enum
    return convert_choices_to_named_enum_with_descriptions(name, choices)
  File "/usr/lib/python3.9/site-packages/graphene_django/converter.py", line 63, in convert_choices_to_named_enum_with_descriptions
    choices = list(get_choices(choices))
  File "/usr/lib/python3.9/site-packages/graphene_django/converter.py", line 54, in get_choices
    name = convert_choice_name(value)
  File "/usr/lib/python3.9/site-packages/graphene_django/converter.py", line 39, in convert_choice_name
    assert_valid_name(name)
  File "/usr/lib/python3.9/site-packages/graphql/utilities/assert_valid_name.py", line 16, in assert_valid_name
    raise error
graphql.error.graphql_error.GraphQLError: Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but '1200' does not.
Originally created by @alarig on GitHub (Sep 23, 2021). ### NetBox version v3.0.3 ### Python version 3.9 ### Steps to Reproduce 1. Upgrade from 2.11.12 2. Run the upgrade script ### Expected Behavior Migrations ### Observed Behavior graphql.error.graphql_error.GraphQLError ```python netbox@roucool /opt/netbox-3.0.3 $ python3 netbox/manage.py showmigrations Traceback (most recent call last): File "/opt/netbox-3.0.3/netbox/manage.py", line 10, in <module> execute_from_command_line(sys.argv) File "/usr/lib/python3.9/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line utility.execute() File "/usr/lib/python3.9/site-packages/django/core/management/__init__.py", line 413, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/usr/lib/python3.9/site-packages/django/core/management/base.py", line 354, in run_from_argv self.execute(*args, **cmd_options) File "/usr/lib/python3.9/site-packages/django/core/management/base.py", line 393, in execute self.check() File "/usr/lib/python3.9/site-packages/django/core/management/base.py", line 419, in check all_issues = checks.run_checks( File "/usr/lib/python3.9/site-packages/django/core/checks/registry.py", line 76, in run_checks new_errors = check(app_configs=app_configs, databases=databases) File "/usr/lib/python3.9/site-packages/django/core/checks/urls.py", line 13, in check_url_config return check_resolver(resolver) File "/usr/lib/python3.9/site-packages/django/core/checks/urls.py", line 23, in check_resolver return check_method() File "/usr/lib/python3.9/site-packages/django/urls/resolvers.py", line 412, in check for pattern in self.url_patterns: File "/usr/lib/python3.9/site-packages/django/utils/functional.py", line 48, in __get__ res = instance.__dict__[self.name] = self.func(instance) File "/usr/lib/python3.9/site-packages/django/urls/resolvers.py", line 598, in url_patterns patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module) File "/usr/lib/python3.9/site-packages/django/utils/functional.py", line 48, in __get__ res = instance.__dict__[self.name] = self.func(instance) File "/usr/lib/python3.9/site-packages/django/urls/resolvers.py", line 591, in urlconf_module return import_module(self.urlconf_name) File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1030, in _gcd_import File "<frozen importlib._bootstrap>", line 1007, in _find_and_load File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 680, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 850, in exec_module File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed File "/opt/netbox-3.0.3/netbox/netbox/urls.py", line 11, in <module> from netbox.graphql.schema import schema File "/opt/netbox-3.0.3/netbox/netbox/graphql/schema.py", line 4, in <module> from dcim.graphql.schema import DCIMQuery File "/opt/netbox-3.0.3/netbox/dcim/graphql/schema.py", line 4, in <module> from .types import * File "/opt/netbox-3.0.3/netbox/dcim/graphql/types.py", line 93, in <module> class ConsolePortType(ComponentObjectType): File "/usr/lib/python3.9/site-packages/graphene/types/objecttype.py", line 30, in __new__ base_cls = super().__new__( File "/usr/lib/python3.9/site-packages/graphene/utils/subclass_with_meta.py", line 46, in __init_subclass__ super_class.__init_subclass_with_meta__(**options) File "/usr/lib/python3.9/site-packages/graphene_django/types.py", line 227, in __init_subclass_with_meta__ construct_fields(model, registry, fields, exclude, convert_choices_to_enum), File "/usr/lib/python3.9/site-packages/graphene_django/types.py", line 63, in construct_fields converted = convert_django_field_with_choices( File "/usr/lib/python3.9/site-packages/graphene_django/converter.py", line 109, in convert_django_field_with_choices enum = convert_choice_field_to_enum(field) File "/usr/lib/python3.9/site-packages/graphene_django/converter.py", line 97, in convert_choice_field_to_enum return convert_choices_to_named_enum_with_descriptions(name, choices) File "/usr/lib/python3.9/site-packages/graphene_django/converter.py", line 63, in convert_choices_to_named_enum_with_descriptions choices = list(get_choices(choices)) File "/usr/lib/python3.9/site-packages/graphene_django/converter.py", line 54, in get_choices name = convert_choice_name(value) File "/usr/lib/python3.9/site-packages/graphene_django/converter.py", line 39, in convert_choice_name assert_valid_name(name) File "/usr/lib/python3.9/site-packages/graphql/utilities/assert_valid_name.py", line 16, in assert_valid_name raise error graphql.error.graphql_error.GraphQLError: Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but '1200' does not. ```
adam added the type: bugstatus: revisions needed labels 2025-12-29 19:27:45 +01:00
adam closed this issue 2025-12-29 19:27:45 +01:00
Author
Owner

@jeremystretch commented on GitHub (Sep 26, 2021):

Thank you for opening a bug report. Unfortunately, the information you have provided is not sufficient for someone else to attempt to reproduce the reported behavior. Remember, each bug report must include detailed steps that someone else can follow on a clean, empty NetBox installation to reproduce the exact problem you're experiencing. These instructions should include the creation of any involved objects, any configuration changes, and complete accounting of the actions being taken. Also be sure that your report does not reference data on the public NetBox demo, as that is subject to change at any time by an outside party and cannot be relied upon for bug reports.

@jeremystretch commented on GitHub (Sep 26, 2021): Thank you for opening a bug report. Unfortunately, the information you have provided is not sufficient for someone else to attempt to reproduce the reported behavior. Remember, each bug report must include detailed steps that someone else can follow on a clean, empty NetBox installation to reproduce the exact problem you're experiencing. These instructions should include the creation of any involved objects, any configuration changes, and complete accounting of the actions being taken. Also be sure that your report does not reference data on the public NetBox demo, as that is subject to change at any time by an outside party and cannot be relied upon for bug reports.
Author
Owner

@alarig commented on GitHub (Sep 26, 2021):

What else do you need?

@alarig commented on GitHub (Sep 26, 2021): What else do you need?
Author
Owner

@jeremystretch commented on GitHub (Sep 26, 2021):

If you want anyone to look into this, you're going to need to provide much, much more detail than "upgrade from v2.11.12." Obviously, many people have done so and did not encounter the reported bug. So, you'll need to figure out what's different about your setup and update your post accordingly.

@jeremystretch commented on GitHub (Sep 26, 2021): If you want anyone to look into this, you're going to need to provide much, much more detail than "upgrade from v2.11.12." Obviously, _many_ people have done so and did not encounter the reported bug. So, you'll need to figure out what's different about your setup and update your post accordingly.
Author
Owner

@jeremystretch commented on GitHub (Oct 4, 2021):

Closing as there hasn't been any further response.

@jeremystretch commented on GitHub (Oct 4, 2021): Closing as there hasn't been any further response.
Author
Owner

@alarig commented on GitHub (Oct 5, 2021):

There hasn't been any further response because you didn’t told me what to look for… I have absolutely no idea how graphql is supposed to work.

@alarig commented on GitHub (Oct 5, 2021): There hasn't been any further response because you didn’t told me what to look for… I have absolutely no idea how graphql is supposed to work.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#5421