c0c0n3 / kitt4sme.live

On a mission to bring AI to the shop floor: https://kitt4sme.eu/
MIT License
1 stars 27 forks source link

Platform-configurator/Datasheets/RAMP integration bug #409

Closed karikolehmainen closed 6 months ago

karikolehmainen commented 7 months ago

Filling out the adaptive questionnaire and trying to search for a kit produced an error in pltaform configurator: datasheets = self._client.datasheets_get(StrictInt(ramp_only)).data File "pydantic/decorator.py", line 40, in pydantic.decorator.validate_arguments.validate.wrapper_function File "pydantic/decorator.py", line 134, in pydantic.decorator.ValidatedFunction.call File "pydantic/decorator.py", line 206, in pydantic.decorator.ValidatedFunction.execute File "/app/.venv/lib/python3.10/site-packages/datasheets_openapi_client/api/datasheets_api.py", line 75, in datasheets_get return self.datasheets_get_with_http_info(validate_, **kwargs) # noqa: E501 File "pydantic/decorator.py", line 40, in pydantic.decorator.validate_arguments.validate.wrapper_function File "pydantic/decorator.py", line 134, in pydantic.decorator.ValidatedFunction.call File "pydantic/decorator.py", line 206, in pydantic.decorator.ValidatedFunction.execute File "/app/.venv/lib/python3.10/site-packages/datasheets_openapi_client/api/datasheets_api.py", line 170, in datasheets_get_with_http_info return self.api_client.call_api( File "/app/.venv/lib/python3.10/site-packages/datasheets_openapi_client/api_client.py", line 410, in call_api return self.__call_api(resource_path, method, File "/app/.venv/lib/python3.10/site-packages/datasheets_openapi_client/api_client.py", line 248, in __call_api return_data = self.deserialize(response_data, response_type) File "/app/.venv/lib/python3.10/site-packages/datasheets_openapi_client/api_client.py", line 320, in deserialize return self.__deserialize(data, response_type) File "/app/.venv/lib/python3.10/site-packages/datasheets_openapi_client/api_client.py", line 359, in __deserialize return self.__deserialize_model(data, klass) File "/app/.venv/lib/python3.10/site-packages/datasheets_openapi_client/api_client.py", line 759, in __deserialize_model return klass.from_dict(data) File "/app/.venv/lib/python3.10/site-packages/datasheets_openapi_client/models/api_response.py", line 88, in from_dict "data": [Datasheet.from_dict(_item) for _item in obj.get("data")] if obj.get("data") is not None else None, File "/app/.venv/lib/python3.10/site-packages/datasheets_openapi_client/models/api_response.py", line 88, in <listcomp> "data": [Datasheet.from_dict(_item) for _item in obj.get("data")] if obj.get("data") is not None else None, File "/app/.venv/lib/python3.10/site-packages/datasheets_openapi_client/models/datasheet.py", line 137, in from_dict "public_endpoints": PublicEndpoints.from_dict(obj.get("public_endpoints")) if obj.get("public_endpoints") is not None else None, File "/app/.venv/lib/python3.10/site-packages/datasheets_openapi_client/models/public_endpoints.py", line 70, in from_dict raise ValueError("Error due to additional fields (not defined in PublicEndpoints) in the input: " + obj) TypeError: can only concatenate str (not "dict") to str INFO: 127.0.0.6:50925 - "GET /kits-ramp?sid=02baca9d-a11a-4bd5-be1e-99703c04396c HTTP/1.1" 500 Internal Server Error ERROR: Exception in ASGI application Traceback (most recent call last): File "/app/.venv/lib/python3.10/site-packages/uvicorn/protocols/http/h11_impl.py", line 429, in run_asgi result = await app( # type: ignore[func-returns-value] File "/app/.venv/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__ return await self.app(scope, receive, send) File "/app/.venv/lib/python3.10/site-packages/fastapi/applications.py", line 276, in __call__ await super().__call__(scope, receive, send) File "/app/.venv/lib/python3.10/site-packages/starlette/applications.py", line 122, in __call__ await self.middleware_stack(scope, receive, send) File "/app/.venv/lib/python3.10/site-packages/starlette/middleware/errors.py", line 184, in __call__ raise exc File "/app/.venv/lib/python3.10/site-packages/starlette/middleware/errors.py", line 162, in __call__ await self.app(scope, receive, _send) File "/app/.venv/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 79, in __call__ raise exc File "/app/.venv/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 68, in __call__ await self.app(scope, receive, sender) File "/app/.venv/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 21, in __call__ raise e File "/app/.venv/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__ await self.app(scope, receive, send) File "/app/.venv/lib/python3.10/site-packages/starlette/routing.py", line 718, in __call__ await route.handle(scope, receive, send) File "/app/.venv/lib/python3.10/site-packages/starlette/routing.py", line 276, in handle await self.app(scope, receive, send) File "/app/.venv/lib/python3.10/site-packages/starlette/routing.py", line 66, in app response = await func(request) File "/app/.venv/lib/python3.10/site-packages/fastapi/routing.py", line 237, in app raw_response = await run_endpoint_function( File "/app/.venv/lib/python3.10/site-packages/fastapi/routing.py", line 163, in run_endpoint_function return await dependant.call(**values) File "/app/platform_configurator/web/kits.py", line 79, in handle_kits_request_redirect kit_set, user = _kits(sid) File "/app/platform_configurator/web/kits.py", line 39, in _kits tools = ds_svc.get_ramp_tools() File "/app/platform_configurator/service/tools.py", line 27, in get_ramp_tools return self._get_tools(True) File "/app/platform_configurator/service/tools.py", line 19, in _get_tools datasheets = self._client.datasheets_get(StrictInt(ramp_only)).data File "pydantic/decorator.py", line 40, in pydantic.decorator.validate_arguments.validate.wrapper_function File "pydantic/decorator.py", line 134, in pydantic.decorator.ValidatedFunction.call File "pydantic/decorator.py", line 206, in pydantic.decorator.ValidatedFunction.execute File "/app/.venv/lib/python3.10/site-packages/datasheets_openapi_client/api/datasheets_api.py", line 75, in datasheets_get return self.datasheets_get_with_http_info(validate_, **kwargs) # noqa: E501 File "pydantic/decorator.py", line 40, in pydantic.decorator.validate_arguments.validate.wrapper_function File "pydantic/decorator.py", line 134, in pydantic.decorator.ValidatedFunction.call File "pydantic/decorator.py", line 206, in pydantic.decorator.ValidatedFunction.execute File "/app/.venv/lib/python3.10/site-packages/datasheets_openapi_client/api/datasheets_api.py", line 170, in datasheets_get_with_http_info return self.api_client.call_api( File "/app/.venv/lib/python3.10/site-packages/datasheets_openapi_client/api_client.py", line 410, in call_api return self.__call_api(resource_path, method, File "/app/.venv/lib/python3.10/site-packages/datasheets_openapi_client/api_client.py", line 248, in __call_api return_data = self.deserialize(response_data, response_type) File "/app/.venv/lib/python3.10/site-packages/datasheets_openapi_client/api_client.py", line 320, in deserialize return self.__deserialize(data, response_type) File "/app/.venv/lib/python3.10/site-packages/datasheets_openapi_client/api_client.py", line 359, in __deserialize return self.__deserialize_model(data, klass) File "/app/.venv/lib/python3.10/site-packages/datasheets_openapi_client/api_client.py", line 759, in __deserialize_model return klass.from_dict(data) File "/app/.venv/lib/python3.10/site-packages/datasheets_openapi_client/models/api_response.py", line 88, in from_dict "data": [Datasheet.from_dict(_item) for _item in obj.get("data")] if obj.get("data") is not None else None, File "/app/.venv/lib/python3.10/site-packages/datasheets_openapi_client/models/api_response.py", line 88, in <listcomp> "data": [Datasheet.from_dict(_item) for _item in obj.get("data")] if obj.get("data") is not None else None, File "/app/.venv/lib/python3.10/site-packages/datasheets_openapi_client/models/datasheet.py", line 137, in from_dict "public_endpoints": PublicEndpoints.from_dict(obj.get("public_endpoints")) if obj.get("public_endpoints") is not None else None, File "/app/.venv/lib/python3.10/site-packages/datasheets_openapi_client/models/public_endpoints.py", line 70, in from_dict raise ValueError("Error due to additional fields (not defined in PublicEndpoints) in the input: " + obj) TypeError: can only concatenate str (not "dict") to str

vcutrona commented 6 months ago

The error was related some datasheets not specifying a proper version (which PC assumes to be a mandatory field). The new PC version (0.8.0) fixes this error.