jina-ai / jina

☁️ Build multimodal AI applications with cloud-native stack
https://docs.jina.ai
Apache License 2.0
20.87k stars 2.22k forks source link

Getting endpoints failed: 'definitions'. Waiting for another trial #6019

Closed Song-Gy closed 1 year ago

Song-Gy commented 1 year ago

Describe your proposal/problem

When the docs structure of the set access node involves nesting, the service will fail to start normally;

Environment

jina- 3.19.1 docarray-0.37.0 Screenshots

class RectMeta(BaseDoc):
    top: float
    left: float
    width: float
    height: float

class ObjMeta(BaseDoc):
    classId: Optional[int]
    objectId: Optional[int]
    confidence: Optional[float]
    rectParams: Optional[RectMeta]

class FrameMeata(BaseDoc):
    taskId: str
    # Path of source
    dataPath: str
    # Current frame number of source
    frameNum: Optional[int]
    # List of objects of type VizorObjectMetaDoc in usr for give frame
    objMetaList: Optional[List[ObjMeta]]
class BLSExec(Executor):
    def __init__(self,

                 *args,
                 **kwargs):
        super().__init__(*args, **kwargs)

    @requests(on="/submit")
    async def submit(self,
                     docs: DocList[FrameMeata],
                     **kwargs) -> DocList[ResponseDoc]:
        print(docs)
        for doc in docs:
            doc.summary()
        rets = DocList[ResponseDoc]()
        # for  in docs:
        # doc.summary()
        # rets.append(self.controller.process_submit(doc=doc))
        return rets

bls_flow = (Flow(log_config=str(log_cfg.absolute()))
                        .add(name='inference',
                             needs='gateway',
                             uses=BLSExec)
                        )
bls_flow = bls_flow.config_gateway(protocol='http', ports=11777)
bls_flow.start()

After starting the service according to the above code, the console keeps outputting the following information, and the client cannot access the service normally

2023-08-07 02:49:31,484 topology_graph.py[161] DEBUG Getting Endpoints data from viznrn_bls
2023-08-07 02:49:31,485 request_handling.py[881] DEBUG got an endpoint discovery request
2023-08-07 02:49:31,510 topology_graph.py[608] WARNING Getting endpoints failed: 'definitions'. Waiting for another trial
2023-08-07 02:49:32,512 topology_graph.py[161] DEBUG Getting Endpoints data from viznrn_bls
2023-08-07 02:49:32,513 request_handling.py[881] DEBUG got an endpoint discovery request
2023-08-07 02:49:32,529 topology_graph.py[608] WARNING Getting endpoints failed: 'definitions'. Waiting for another trial
2023-08-07 02:49:33,531 topology_graph.py[161] DEBUG Getting Endpoints data from viznrn_bls
2023-08-07 02:49:33,532 request_handling.py[881] DEBUG got an endpoint discovery request
2023-08-07 02:49:33,559 topology_graph.py[608] WARNING Getting endpoints failed: 'definitions'. Waiting for another trial
JoanFM commented 1 year ago

Hello @Song-Gy,

Could you share the logs when setting JINA_LOG_LEVEL=DEBUG?

and could u try to update to the 3.20.0 version? There is a fix that may help here

JoanFM commented 1 year ago

But what I see is that ResponseDoc is not defined. This may be the cause of the problem

Song-Gy commented 1 year ago
class ResponseDoc(BaseDoc):
    success: bool
    errCode: int
    errMessage: str
Song-Gy commented 1 year ago

I have tried to upgrade jina to 3.20.0, but the service still cannot be started normally.

Hello @Song-Gy,

Could you share the logs when setting JINA_LOG_LEVEL=DEBUG?

and could u try to update to the 3.20.0 version? There is a fix that may help here

Song-Gy commented 1 year ago

JINA_LOG_LEVEL

I have set JINA_LOG_LEVEL=DEBUG here, the output information is the same as the above console output, there is no other additional information.

JoanFM commented 1 year ago
class ResponseDoc(BaseDoc):
    success: bool
    errCode: int
    errMessage: str

Is this defined where? in the first code it is not

JoanFM commented 1 year ago

Hey @Song-Gy,

This has been released in the latest patch release https://github.com/jina-ai/jina/releases/tag/v3.20.1

Pleaas, give it a try.

Thanks