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

ModelError: 1 validation error for Commit. blocks field is required #14

Closed
mockthebear opened this issue Oct 18, 2024 · 3 comments
Closed

Comments

@mockthebear
Copy link

I was running the server with little modifications on the data_filter (changed the condition to a regexp)

And i keep getting those tracebacks:

Traceback (most recent call last):
  File "/root/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 "/root/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': '3l6sj...: 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 "/root/bluesky-feed-generator/.venv/lib/python3.12/site-packages/atproto_firehose/client.py", line 149, in _process_message_frame
    self._on_message_callback(frame)
  File "/root/bluesky-feed-generator/server/data_stream.py", line 76, in on_message_handler
    commit = parse_subscribe_repos_message(message)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/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 "/root/bluesky-feed-generator/.venv/lib/python3.12/site-packages/atproto_client/models/utils.py", line 69, in get_or_create
    raise e
  File "/root/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 "/root/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': '3l6sj...: False, 'tooBig': True}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.9/v/missing
Traceback (most recent call last):
  File "/root/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 "/root/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': '3l6sj...: 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 "/root/bluesky-feed-generator/.venv/lib/python3.12/site-packages/atproto_firehose/client.py", line 149, in _process_message_frame
    self._on_message_callback(frame)
  File "/root/bluesky-feed-generator/server/data_stream.py", line 76, in on_message_handler
    commit = parse_subscribe_repos_message(message)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/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 "/root/bluesky-feed-generator/.venv/lib/python3.12/site-packages/atproto_client/models/utils.py", line 69, in get_or_create
    raise e
  File "/root/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 "/root/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': '3l6sj...: False, 'tooBig': True}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.9/v/missing
Traceback (most recent call last):
  File "/root/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 "/root/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': '22222...: 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 "/root/bluesky-feed-generator/.venv/lib/python3.12/site-packages/atproto_firehose/client.py", line 149, in _process_message_frame
    self._on_message_callback(frame)
  File "/root/bluesky-feed-generator/server/data_stream.py", line 76, in on_message_handler
    commit = parse_subscribe_repos_message(message)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/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 "/root/bluesky-feed-generator/.venv/lib/python3.12/site-packages/atproto_client/models/utils.py", line 69, in get_or_create
    raise e
  File "/root/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 "/root/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': '22222...: False, 'tooBig': True}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.9/v/missing
```
@MarshalX
Copy link
Owner

pls make sure that you are syncing your feed server with the code from this repository

if not commit.blocks:
return

@mockthebear
Copy link
Author

Yep, i am. I cloned the repository earlier this day

image

@MarshalX
Copy link
Owner

Understood. I will close this as a duplicate. You can follow progress here: MarshalX/atproto#186

@MarshalX MarshalX closed this as not planned Won't fix, can't repro, duplicate, stale Oct 19, 2024
@MarshalX MarshalX changed the title Tracebacks ModelError: 1 validation error for Commit. blocks field is required Oct 19, 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