Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pydantic.error_wrappers.ValidationError: 1 validation error for GetByIdResponse #743

Open
3 tasks done
mrtnvgr opened this issue Jun 18, 2023 · 2 comments
Open
3 tasks done
Assignees
Labels
bug Something isn't working vkbottle-types

Comments

@mrtnvgr
Copy link
Contributor

mrtnvgr commented Jun 18, 2023

Checklist

  • Я уверен, что это баг фреймворка
  • Я искал похожие баги в issues
  • Я установил последнюю версию (pip3 install -U https://github.com/vkbottle/vkbottle/archive/dev.zip) и проблема осталась

Описание

.

Пример кода

No response

Логи

2023-06-18 14:19:22.057 | ERROR    | vkbottle.exception_factory.error_handler.error_handler:handle:48 - 1 validation error for GetByIdResponse
response -> items -> 0 -> attachments -> 0 -> type
  value is not a valid enumeration member; permitted: 'photo', 'audio', 'video', 'doc', 'link', 'market', 'market_album', 'gift', 'sticker', 'wall', 'wall_reply', 'article', 'poll', 'call', 'graffiti', 'audio_message', 'story', 'group_call_in_progress', 'mini_app' (type=type_error.enum; enum_values=[<MessagesMessageAttachmentType.PHOTO: 'photo'>, <MessagesMessageAttachmentType.AUDIO: 'audio'>, <MessagesMessageAttachmentType.VIDEO: 'video'>, <MessagesMessageAttachmentType.DOC: 'doc'>, <MessagesMessageAttachmentType.LINK: 'link'>, <MessagesMessageAttachmentType.MARKET: 'market'>, <MessagesMessageAttachmentType.MARKET_ALBUM: 'market_album'>, <MessagesMessageAttachmentType.GIFT: 'gift'>, <MessagesMessageAttachmentType.STICKER: 'sticker'>, <MessagesMessageAttachmentType.WALL: 'wall'>, <MessagesMessageAttachmentType.WALL_REPLY: 'wall_reply'>, <MessagesMessageAttachmentType.ARTICLE: 'article'>, <MessagesMessageAttachmentType.POLL: 'poll'>, <MessagesMessageAttachmentType.CALL: 'call'>, <MessagesMessageAttachmentType.GRAFFITI: 'graffiti'>, <MessagesMessageAttachmentType.AUDIO_MESSAGE: 'audio_message'>, <MessagesMessageAttachmentType.STORY: 'story'>, <MessagesMessageAttachmentType.GROUP_CALL_IN_PROGRESS: 'group_call_in_progress'>, <MessagesMessageAttachmentType.MINI_APP: 'mini_app'>])
Traceback (most recent call last):

  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code

  File "/app/vkreborn/__main__.py", line 35, in <module>
    main()
    └ <function main at 0x7f89b29589a0>

  File "/app/vkreborn/__main__.py", line 31, in main
    user.run_forever()
    │    └ <function User.run_forever at 0x7f89b435f6a0><vkbottle.framework.user.user.User object at 0x7f89b62c4bd0>

  File "/usr/local/lib/python3.11/site-packages/vkbottle/framework/user/user.py", line 152, in run_forever
    self.loop_wrapper.run()
    │    │            └ <function LoopWrapper.run at 0x7f89b2ca2520>
    │    └ <vkbottle.tools.loop_wrapper.LoopWrapper object at 0x7f89b3f3a450><vkbottle.framework.user.user.User object at 0x7f89b62c4bd0>
  File "/usr/local/lib/python3.11/site-packages/vkbottle/tools/loop_wrapper.py", line 75, in run
    results = self.loop.run_until_complete(
              │    │    └ <function BaseEventLoop.run_until_complete at 0x7f89b7aec040>
              │    └ <_UnixSelectorEventLoop running=True closed=False debug=False><vkbottle.tools.loop_wrapper.LoopWrapper object at 0x7f89b3f3a450>
  File "/usr/local/lib/python3.11/asyncio/base_events.py", line 640, in run_until_complete
    self.run_forever()
    │    └ <function BaseEventLoop.run_forever at 0x7f89b7ae7f60><_UnixSelectorEventLoop running=True closed=False debug=False>
  File "/usr/local/lib/python3.11/asyncio/base_events.py", line 607, in run_forever
    self._run_once()
    │    └ <function BaseEventLoop._run_once at 0x7f89b7aedda0><_UnixSelectorEventLoop running=True closed=False debug=False>
  File "/usr/local/lib/python3.11/asyncio/base_events.py", line 1922, in _run_once
    handle._run()
    │      └ <function Handle._run at 0x7f89b81f0400><Handle Task.task_wakeup(<Future finished result=None>)>
  File "/usr/local/lib/python3.11/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
    │    │            │    │           │    └ <member '_args' of 'Handle' objects>
    │    │            │    │           └ <Handle Task.task_wakeup(<Future finished result=None>)>
    │    │            │    └ <member '_callback' of 'Handle' objects>
    │    │            └ <Handle Task.task_wakeup(<Future finished result=None>)>
    │    └ <member '_context' of 'Handle' objects><Handle Task.task_wakeup(<Future finished result=None>)>
> File "/usr/local/lib/python3.11/site-packages/vkbottle/dispatch/base.py", line 22, in route
    await view.handle_event(event, ctx_api, self.state_dispenser)
          │    │            │      │        │    └ <vkbottle.dispatch.dispenser.builtin.BuiltinStateDispenser object at 0x7f89b244ab50>
          │    │            │      │        └ <vkbottle.dispatch.base.Router object at 0x7f89b244ac10>
          │    │            │      └ <API token_generator=<<class 'vkbottle.api.token_generator.single.SingleTokenGenerator'>>...>
          │    │            └ [4, 12....3, 53...81, 2000...02., 168...7961, '...', '', {'attach1_type': 'audio_playlist', 'attach1': '-122....64_7...0...
          │    └ <function ABCMessageView.handle_event at 0x7f89b2c74220>
          └ <UserMessageView handlers=[<FromFuncHandler invite_handler blocking=True rules=(<PeerRule>, <AliasRule>, <ModerRule>)>, <From...
  File "/usr/local/lib/python3.11/site-packages/vkbottle/dispatch/views/abc/message.py", line 49, in handle_event
    message = await self.get_message(event, ctx_api, self.replace_mention)
                    │    │           │      │        │    └ False
                    │    │           │      │        └ <UserMessageView handlers=[<FromFuncHandler invite_handler blocking=True rules=(<PeerRule>, <AliasRule>, <ModerRule>)>, <From...
                    │    │           │      └ <API token_generator=<<class 'vkbottle.api.token_generator.single.SingleTokenGenerator'>>...>
                    │    │           └ [4, 126...13, 53...1, 20..0000.., 168....961, '...', '', {'attach1_type': 'audio_playlist', 'attach1': '-122...764_7...0...
                    │    └ <staticmethod(<function ABCUserMessageView.get_message at 0x7f89b437ade0>)>
                    └ <UserMessageView handlers=[<FromFuncHandler invite_handler blocking=True rules=(<PeerRule>, <AliasRule>, <ModerRule>)>, <From...
  File "/usr/local/lib/python3.11/site-packages/vkbottle/dispatch/views/user/message.py", line 29, in get_message
    return await message_min(event[1], ctx_api, replace_mention)
                 │           │         │        └ False
                 │           │         └ <API token_generator=<<class 'vkbottle.api.token_generator.single.SingleTokenGenerator'>>...>
                 │           └ [4, 12...13, 53...81, 200..000.., 168....961, '...', '', {'attach1_type': 'audio_playlist', 'attach1': '-122...64_7..20...
                 └ <function message_min at 0x7f89b3b82200>
  File "/usr/local/lib/python3.11/site-packages/vkbottle/tools/mini_types/user/message.py", line 45, in message_min
    response = await ctx_api.messages.get_by_id(message_ids=[message_id])
                     │       │                               └ 126...13
                     │       └ <property object at 0x7f89b3c40270>
                     └ <API token_generator=<<class 'vkbottle.api.token_generator.single.SingleTokenGenerator'>>...>
  File "/usr/local/lib/python3.11/site-packages/vkbottle_types/codegen/methods/messages.py", line 355, in get_by_id
    return model(**response).response
           │       └ {'response': {'count': 1, 'items': [{'date': 168709...1, 'from_id': 572....25, 'id': 126...3, 'out': 0, 'attachments': [{'typ...
           └ <class 'vkbottle_types.codegen.responses.messages.GetByIdResponse'>

  File "pydantic/main.py", line 341, in pydantic.main.BaseModel.__init__
    raise validation_error

pydantic.error_wrappers.ValidationError: 1 validation error for GetByIdResponse
response -> items -> 0 -> attachments -> 0 -> type
  value is not a valid enumeration member; permitted: 'photo', 'audio', 'video', 'doc', 'link', 'market', 'market_album', 'gift', 'sticker', 'wall', 'wall_reply', 'article', 'poll', 'call', 'graffiti', 'audio_message', 'story', 'group_call_in_progress', 'mini_app' (type=type_error.enum; enum_values=[<MessagesMessageAttachmentType.PHOTO: 'photo'>, <MessagesMessageAttachmentType.AUDIO: 'audio'>, <MessagesMessageAttachmentType.VIDEO: 'video'>, <MessagesMessageAttachmentType.DOC: 'doc'>, <MessagesMessageAttachmentType.LINK: 'link'>, <MessagesMessageAttachmentType.MARKET: 'market'>, <MessagesMessageAttachmentType.MARKET_ALBUM: 'market_album'>, <MessagesMessageAttachmentType.GIFT: 'gift'>, <MessagesMessageAttachmentType.STICKER: 'sticker'>, <MessagesMessageAttachmentType.WALL: 'wall'>, <MessagesMessageAttachmentType.WALL_REPLY: 'wall_reply'>, <MessagesMessageAttachmentType.ARTICLE: 'article'>, <MessagesMessageAttachmentType.POLL: 'poll'>, <MessagesMessageAttachmentType.CALL: 'call'>, <MessagesMessageAttachmentType.GRAFFITI: 'graffiti'>, <MessagesMessageAttachmentType.AUDIO_MESSAGE: 'audio_message'>, <MessagesMessageAttachmentType.STORY: 'story'>, <MessagesMessageAttachmentType.GROUP_CALL_IN_PROGRESS: 'group_call_in_progress'>, <MessagesMessageAttachmentType.MINI_APP: 'mini_app'>])
@mrtnvgr mrtnvgr added the bug Something isn't working label Jun 18, 2023
@FeeeeK FeeeeK removed their assignment Jul 9, 2023
@timoniq timoniq self-assigned this Jul 12, 2023
@timoniq
Copy link
Member

timoniq commented Jul 12, 2023

привет, проблема решится не раньше чем когда будет выложена новая схема vk api
может быть стоит рассмотреть возможность создания временных rolling diff исправлений потому что vk подходит к обновлению схемы недобросовестно

@mrtnvgr
Copy link
Contributor Author

mrtnvgr commented Jul 19, 2023

привет, проблема решится не раньше чем когда будет выложена новая схема vk api
может быть стоит рассмотреть возможность создания временных rolling diff исправлений потому что vk подходит к обновлению схемы недобросовестно

Можно ли использовать тот же подход как и в #672?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working vkbottle-types
Projects
None yet
Development

No branches or pull requests

3 participants