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

Validation Error for Commit in Firehose #17

Closed
z-clement opened this issue Nov 18, 2024 · 1 comment
Closed

Validation Error for Commit in Firehose #17

z-clement opened this issue Nov 18, 2024 · 1 comment

Comments

@z-clement
Copy link

Hi, thanks for the Python implementation, I've been enjoying experimenting with it to try and make a custom feed.

I'm not too knowledgeable with this side of programming, so apologies if this is a simple question, but I've seen in my log files that some posts are raising a ModelError because they're missing some data that is then getting caught by pydantic's validation.

This could be down to an error on my part, but any ideas or suggestions as to what might be causing this would be appreciated. Thanks in advance!

The error that's logged is as follows:

INFO:server.logger:Updated cursor for did:web:rapids.zacc.us to 3820959480
  File "/home/zclem/bluesky-feed-generator/.venv/lib/python3.12/site-packages/atproto_client/models/utils.py", line 101, in _get_or_create
     return model(**model_data)
            ^^^^^^^^^^^^^^^^^^^
  File "/home/zclem/bluesky-feed-generator/.venv/lib/python3.12/site-packages/pydantic/main.py", line 212, in __init__
     validated_self = self.__pydantic_validator__.validate_python(data, self_instance=self)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 pydantic_core._pydantic_core.ValidationError: 1 validation error for Commit blocks
 Field required [type=missing, input_value={'ops': [], 'rev': '3lb75...: False, 'tooBig': True}, input_type=dict]
   For further information visit https://errors.pydantic.dev/2.9/v/missing
 The above exception was the direct cause of the following exception:
Traceback (most recent call last):
 File "/home/zclem/bluesky-feed-generator/.venv/lib/python3.12/site-packages/atproto_firehose/client.py", line 149, in _process_message_frame
   self._on_message_callback(frame)
    commit = parse_subscribe_repos_message(message)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/zclem/bluesky-feed-generator/.venv/lib/python3.12/site-packages/atproto_firehose/firehose.py", line 58, in parse_subscribe_repos_message
    return get_or_create(message.body, model_class)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/zclem/bluesky-feed-generator/.venv/lib/python3.12/site-packages/atproto_client/models/utils.py", line 69, in get_or_create
    raise e
  File "/home/zclem/bluesky-feed-generator/.venv/lib/python3.12/site-packages/atproto_client/models/utils.py", line 62, in get_or_create
    model_instance = _get_or_create(model_data, model, strict=strict)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/zclem/bluesky-feed-generator/.venv/lib/python3.12/site-packages/atproto_client/models/utils.py", line 103, in _get_or_create
    raise ModelError(str(e)) from e
atproto_client.exceptions.ModelError: 1 validation error for Commit blocks
 Field required [type=missing, input_value={'ops': [], 'rev': '3lb75...: False, 'tooBig': True}, input_type=dict]
   For further information visit https://errors.pydantic.dev/2.9/v/missing
@MarshalX
Copy link
Owner

Hi! My pleasure! The question is great and valid. I am working on it with bsky team sometimes. Here you can find more details and the history: MarshalX/atproto#186

I am gonna close it as duplicate. Thank you!

tl;dr server side bug; still waiting for the proper fix; nothing to do, just ignore such messages

@MarshalX MarshalX closed this as not planned Won't fix, can't repro, duplicate, stale Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants