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

Pysolr 3.9.0 error JSON serializing datetime #922

Open
jazzdup opened this issue Apr 22, 2021 · 1 comment
Open

Pysolr 3.9.0 error JSON serializing datetime #922

jazzdup opened this issue Apr 22, 2021 · 1 comment

Comments

@jazzdup
Copy link

jazzdup commented Apr 22, 2021

2021-04-22 09:50:12,129 [DEBUG] pysolr:1003 - Starting to build add request... 2021-04-22 09:50:37,744 [CRITICAL] mongo_connector.oplog_manager:713 - Exception during collection dump Traceback (most recent call last): File "/home/al/dev/zapper/projects/etl2/lib/python3.8/site-packages/mongo_connector/oplog_manager.py", line 668, in do_dump upsert_all(dm) File "/home/al/dev/zapper/projects/etl2/lib/python3.8/site-packages/mongo_connector/oplog_manager.py", line 651, in upsert_all dm.bulk_upsert(docs_to_dump(from_coll), mapped_ns, long_ts) File "/home/al/dev/zapper/projects/etl2/lib/python3.8/site-packages/mongo_connector/util.py", line 33, in wrapped return f(*args, **kwargs) File "/home/al/dev/zapper/projects/etl2/lib/python3.8/site-packages/mongo_connector/doc_managers/solr_doc_manager.py", line 299, in bulk_upsert self.solr.add(batch, **add_kwargs) File "/home/al/dev/zapper/projects/etl2/lib/python3.8/site-packages/pysolr.py", line 1018, in add m = json.dumps(message).encode("utf-8") File "/usr/lib/python3.8/json/__init__.py", line 231, in dumps return _default_encoder.encode(obj) File "/usr/lib/python3.8/json/encoder.py", line 199, in encode chunks = self.iterencode(o, _one_shot=True) File "/usr/lib/python3.8/json/encoder.py", line 257, in iterencode return _iterencode(o, 0) File "/usr/lib/python3.8/json/encoder.py", line 179, in default raise TypeError(f'Object of type {o.__class__.__name__} ' TypeError: Object of type datetime is not JSON serializable 2021-04-22 09:50:37,747 [ERROR] mongo_connector.oplog_manager:723 - OplogThread: Failed during dump collection cannot recover!

@jazzdup
Copy link
Author

jazzdup commented Apr 22, 2021

this is fixed by downgrading pysolr to 3.8.1

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

1 participant