mp-co-ru / mpc-peresvet

Data acqusition, GUI, decision making. IoT, SCADA, dispatching and monitoring.
https://mp-co-ru.github.io/mpc-peresvet/
Apache License 2.0
0 stars 0 forks source link

Ошибка создания тега #329

Closed Vovaman closed 3 months ago

Vovaman commented 3 months ago

POST http://localhost/v1/tags/

{
    "parentId": "00a8e980-725f-103e-9249-a5021ec2dae1",
    "attributes": {
        "cn": "Список причин простоя",
        "prsValueTypeCode": 4,
        "description": "JSON вида {'код причины простоя': 'Название причины простоя'}"
    }
}

зависает Ошибка:

2024-05-22 19:25:56.734 ERROR    :: Exception in callback <function _task_done at 0x7fca8f280820>
handle: <Handle _task_done>
Traceback (most recent call last):

  File "/usr/src/mpc-peresvet/src/services/one_app/one_app.py", line 314, in <module>
    uvicorn.run(app, host="0.0.0.0", port=8000, log_level="info")
    │       │   └ <fastapi.applications.FastAPI object at 0x7fca91613d60>
    │       └ <function run at 0x7fca8f72d510>
    └ <module 'uvicorn' from '/usr/local/lib/python3.10/site-packages/uvicorn/__init__.py'>

  File "/usr/local/lib/python3.10/site-packages/uvicorn/main.py", line 587, in run
    server.run()
    │      └ <function Server.run at 0x7fca8f72d7e0>
    └ <uvicorn.server.Server object at 0x7fca7cccc8e0>
  File "/usr/local/lib/python3.10/site-packages/uvicorn/server.py", line 61, in run
    return asyncio.run(self.serve(sockets=sockets))
           │       │   │    │             └ None
           │       │   │    └ <function Server.serve at 0x7fca8f72d870>
           │       │   └ <uvicorn.server.Server object at 0x7fca7cccc8e0>
           │       └ <function run at 0x7fca914e6830>
           └ <module 'asyncio' from '/usr/local/lib/python3.10/asyncio/__init__.py'>
  File "/usr/local/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
           │    │                  └ <coroutine object Server.serve at 0x7fca7ce6a8f0>
           │    └ <method 'run_until_complete' of 'uvloop.loop.Loop' objects>
           └ <uvloop.Loop running=True closed=False debug=False>
> File "uvloop/cbhandles.pyx", line 63, in uvloop.loop.Handle._run
    callback(*args)
  File "/usr/local/lib/python3.10/site-packages/aio_pika/tools.py", line 47, in _task_done
    raise exc
          └ TypeError("argument of type 'NoneType' is not iterable")

  File "/usr/src/mpc-peresvet/./src/common/base_svc.py", line 149, in _process_message
    res = await func(mes)
                │    └ {'action': 'tags.create', 'data': {'parentId': '00a8e980-725f-103e-9249-a5021ec2dae1', 'attributes': {'cn': 'Список причин пр...
                └ <bound method ModelCRUDSvc._create of <src.services.tags.model_crud.tags_model_crud_svc.TagsModelCRUD object at 0x7fca7cf6db10>>

  File "/usr/src/mpc-peresvet/./src/common/model_crud_svc.py", line 735, in _create
    if (parent_node in mes['data'].get("initiatedBy")) and (mes['data'].get("initiatedBy") != None):
        │              │                                    └ {'action': 'tags.create', 'data': {'parentId': '00a8e980-725f-103e-9249-a5021ec2dae1', 'attributes': {'cn': 'Список причин пр...
        │              └ {'action': 'tags.create', 'data': {'parentId': '00a8e980-725f-103e-9249-a5021ec2dae1', 'attributes': {'cn': 'Список причин пр...
        └ '00a8e980-725f-103e-9249-a5021ec2dae1'

TypeError: argument of type 'NoneType' is not iterable
2024-05-22 19:25:56.739 ERROR    :: Task exception was never retrieved
future: <Task finished name='Task-1568656' coro=<consumer() done, defined at /usr/local/lib/python3.10/site-packages/aio_pika/queue.py:31> exception=TypeError("argument of type 'NoneType' is not iterable")>
Traceback (most recent call last):

> File "/usr/local/lib/python3.10/site-packages/aio_pika/queue.py", line 37, in consumer
    return await create_task(callback, message)
                 │           │         └ IncomingMessage:{'app_id': None,
                 │           │            'body_size': 560,
                 │           │            'cluster_id': '',
                 │           │            'consumer_tag': 'ctag1.97786fb2bc9249de8f8551333c29b0...
                 │           └ <bound method BaseSvc._process_message of <src.services.tags.model_crud.tags_model_crud_svc.TagsModelCRUD object at 0x7fca7cf...
                 └ <function create_task at 0x7fca8f2808b0>

  File "/usr/src/mpc-peresvet/./src/common/base_svc.py", line 149, in _process_message
    res = await func(mes)
                │    └ {'action': 'tags.create', 'data': {'parentId': '00a8e980-725f-103e-9249-a5021ec2dae1', 'attributes': {'cn': 'Список причин пр...
                └ <bound method ModelCRUDSvc._create of <src.services.tags.model_crud.tags_model_crud_svc.TagsModelCRUD object at 0x7fca7cf6db10>>

  File "/usr/src/mpc-peresvet/./src/common/model_crud_svc.py", line 735, in _create
    if (parent_node in mes['data'].get("initiatedBy")) and (mes['data'].get("initiatedBy") != None):
        │              │                                    └ {'action': 'tags.create', 'data': {'parentId': '00a8e980-725f-103e-9249-a5021ec2dae1', 'attributes': {'cn': 'Список причин пр...
        │              └ {'action': 'tags.create', 'data': {'parentId': '00a8e980-725f-103e-9249-a5021ec2dae1', 'attributes': {'cn': 'Список причин пр...
        └ '00a8e980-725f-103e-9249-a5021ec2dae1'

TypeError: argument of type 'NoneType' is not iterable