toncenter / ton-indexer

TON Indexer system to store and serve blockchain data using SQL-database
https://toncenter.com/api/v3/
GNU General Public License v3.0
69 stars 34 forks source link

TypeError: issubclass() arg 1 must be a class during server startup #26

Closed UranusLin closed 12 months ago

UranusLin commented 1 year ago

Hello,

I encountered an error while trying to start up the server. The error message is: TypeError: issubclass() arg 1 must be a class, and it appears to be related to Pydantic model configuration. Here are the details:

File "/usr/src/ton-indexer/api/main.py", line 11, in <module>
    from api.api_v1.main import router as router_v1
  File "/usr/src/ton-indexer/api/api_v1/main.py", line 11, in <module>
    from . import schemas
  File "/usr/src/ton-indexer/api/api_v1/schemas.py", line 35, in <module>
    class MsgAddressInt(BaseModel):
  File "pydantic/main.py", line 197, in pydantic.main.ModelMetaclass.__new__
  File "pydantic/fields.py", line 506, in pydantic.fields.ModelField.infer
  File "pydantic/fields.py", line 436, in pydantic.fields.ModelField.__init__
  File "pydantic/fields.py", line 552, in pydantic.fields.ModelField.prepare
  File "pydantic/fields.py", line 668, in pydantic.fields.ModelField._type_analysis
  File "/usr/lib/python3.8/typing.py", line 774, in __subclasscheck__
    return issubclass(cls, self.__origin__)
TypeError: issubclass() arg 1 must be a class

This error occurs when I attempt to start the server with gunicorn. The error seems to originate from /usr/src/ton-indexer/api/api_v1/schemas.py where MsgAddressInt class is defined.

I have tried to resolve this issue by verifying my Python environment and dependencies, but the issue persists.

Any assistance or guidance to resolve this issue would be greatly appreciated.

Thank you.

dungeon-master-666 commented 12 months ago

It was caused by updated dependencies. We have fixed the versions.