Skip to content

PatchPanel extension and Modules Extensions are incompatible #41

@BeArchiTek

Description

@BeArchiTek

In the "Patch Panel extension,DcimPatchPanel inherits from DcimPhysicalDevice and DcimPatchPanel have a relationship named "modules" to DcimPatchPanelModule

In the "Modules" extension, we add a relationship named "modules" in DcimPhysicalDevice to DeviceGenericModule.

As both relationships are named the same but the target is not the same node this is failing.

Logs on the server :

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/uvicorn/protocols/http/httptools_impl.py", line 401, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in __call__
    return await self.app(scope, receive, send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/fastapi/applications.py", line 1054, in __call__
    await super().__call__(scope, receive, send)
  File "/usr/local/lib/python3.12/site-packages/starlette/applications.py", line 113, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/usr/local/lib/python3.12/site-packages/starlette/middleware/errors.py", line 187, in __call__
    raise exc
  File "/usr/local/lib/python3.12/site-packages/starlette/middleware/errors.py", line 165, in __call__
    await self.app(scope, receive, _send)
  File "/usr/local/lib/python3.12/site-packages/starlette/middleware/gzip.py", line 20, in __call__
    await responder(scope, receive, send)
  File "/usr/local/lib/python3.12/site-packages/starlette/middleware/gzip.py", line 39, in __call__
    await self.app(scope, receive, self.send_with_gzip)
  File "/usr/local/lib/python3.12/site-packages/starlette/middleware/cors.py", line 85, in __call__
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.12/site-packages/starlette_exporter/middleware.py", line 499, in __call__
    raise exception
  File "/usr/local/lib/python3.12/site-packages/starlette_exporter/middleware.py", line 405, in __call__
    await self.app(scope, receive, wrapped_send)
  File "/usr/local/lib/python3.12/site-packages/asgi_correlation_id/middleware.py", line 90, in __call__
    await self.app(scope, receive, handle_outgoing_request)
  File "/usr/local/lib/python3.12/site-packages/starlette/middleware/base.py", line 185, in __call__
    with collapse_excgroups():
         ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/contextlib.py", line 158, in __exit__
    self.gen.throw(value)
  File "/usr/local/lib/python3.12/site-packages/starlette/_utils.py", line 82, in collapse_excgroups
    raise exc
  File "/usr/local/lib/python3.12/site-packages/starlette/middleware/base.py", line 187, in __call__
    response = await self.dispatch_func(request, call_next)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/source/backend/infrahub/server.py", line 175, in add_telemetry_span_exception
    return await call_next(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/starlette/middleware/base.py", line 163, in call_next
    raise app_exc
  File "/usr/local/lib/python3.12/site-packages/starlette/middleware/base.py", line 149, in coro
    await self.app(scope, receive_or_disconnect, send_no_error)
  File "/usr/local/lib/python3.12/site-packages/starlette/middleware/base.py", line 185, in __call__
    with collapse_excgroups():
         ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/contextlib.py", line 158, in __exit__
    self.gen.throw(value)
  File "/usr/local/lib/python3.12/site-packages/starlette/_utils.py", line 82, in collapse_excgroups
    raise exc
  File "/usr/local/lib/python3.12/site-packages/starlette/middleware/base.py", line 187, in __call__
    response = await self.dispatch_func(request, call_next)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/source/backend/infrahub/server.py", line 164, in add_process_time_header
    response = await call_next(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/starlette/middleware/base.py", line 163, in call_next
    raise app_exc
  File "/usr/local/lib/python3.12/site-packages/starlette/middleware/base.py", line 149, in coro
    await self.app(scope, receive_or_disconnect, send_no_error)
  File "/usr/local/lib/python3.12/site-packages/starlette/middleware/base.py", line 185, in __call__
    with collapse_excgroups():
         ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/contextlib.py", line 158, in __exit__
    self.gen.throw(value)
  File "/usr/local/lib/python3.12/site-packages/starlette/_utils.py", line 82, in collapse_excgroups
    raise exc
  File "/usr/local/lib/python3.12/site-packages/starlette/middleware/base.py", line 187, in __call__
    response = await self.dispatch_func(request, call_next)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/source/backend/infrahub/server.py", line 157, in logging_middleware
    response = await call_next(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/starlette/middleware/base.py", line 163, in call_next
    raise app_exc
  File "/usr/local/lib/python3.12/site-packages/starlette/middleware/base.py", line 149, in coro
    await self.app(scope, receive_or_disconnect, send_no_error)
  File "/usr/local/lib/python3.12/site-packages/opentelemetry/instrumentation/asgi/__init__.py", line 743, in __call__
    await self.app(scope, otel_receive, otel_send)
  File "/usr/local/lib/python3.12/site-packages/starlette/middleware/exceptions.py", line 62, in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
  File "/usr/local/lib/python3.12/site-packages/starlette/_exception_handler.py", line 62, in wrapped_app
    raise exc
  File "/usr/local/lib/python3.12/site-packages/starlette/_exception_handler.py", line 51, in wrapped_app
    await app(scope, receive, sender)
  File "/usr/local/lib/python3.12/site-packages/starlette/routing.py", line 715, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/usr/local/lib/python3.12/site-packages/starlette/routing.py", line 735, in app
    await route.handle(scope, receive, send)
  File "/usr/local/lib/python3.12/site-packages/starlette/routing.py", line 288, in handle
    await self.app(scope, receive, send)
  File "/source/backend/infrahub/graphql/app.py", line 144, in __call__
    response = await self._handle_http_request(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/source/backend/infrahub/graphql/app.py", line 279, in _handle_http_request
    valid, errors = analyzed_query.is_valid
                    ^^^^^^^^^^^^^^^^^^^^^^^
  File "/source/python_sdk/infrahub_sdk/analyzer.py", line 44, in is_valid
    errors = validate(schema=self.schema, document_ast=self.document)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/graphql/validation/validate.py", line 47, in validate
    assert_valid_schema(schema)
  File "/usr/local/lib/python3.12/site-packages/graphql/type/validate.py", line 90, in assert_valid_schema
    raise TypeError("\n\n".join(error.message for error in errors))
TypeError: Interface field DcimPhysicalDevice.modules expects type NestedPaginatedDeviceGenericModule but DcimPatchPanel.modules is type NestedPaginatedDcimPatchPanelModule.

Interface field argument DcimPhysicalDevice.modules(status__value:) expected but DcimPatchPanel.modules does not provide it.

Interface field argument DcimPhysicalDevice.modules(status__values:) expected but DcimPatchPanel.modules does not provide it.

Interface field argument DcimPhysicalDevice.modules(status__source__id:) expected but DcimPatchPanel.modules does not provide it.

Interface field argument DcimPhysicalDevice.modules(status__owner__id:) expected but DcimPatchPanel.modules does not provide it.

Interface field argument DcimPhysicalDevice.modules(status__is_visible:) expected but DcimPatchPanel.modules does not provide it.

Interface field argument DcimPhysicalDevice.modules(status__is_protected:) expected but DcimPatchPanel.modules does not provide it.

Interface field argument DcimPhysicalDevice.modules(serial_number__value:) expected but DcimPatchPanel.modules does not provide it.

Interface field argument DcimPhysicalDevice.modules(serial_number__values:) expected but DcimPatchPanel.modules does not provide it.

Interface field argument DcimPhysicalDevice.modules(serial_number__source__id:) expected but DcimPatchPanel.modules does not provide it.

Interface field argument DcimPhysicalDevice.modules(serial_number__owner__id:) expected but DcimPatchPanel.modules does not provide it.

Interface field argument DcimPhysicalDevice.modules(serial_number__is_visible:) expected but DcimPatchPanel.modules does not provide it.

Interface field argument DcimPhysicalDevice.modules(serial_number__is_protected:) expected but DcimPatchPanel.modules does not provide it.

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