-
Notifications
You must be signed in to change notification settings - Fork 37
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
Synchronisation error when importing from MongoDB #17
Comments
I have been able to recreate this error with bad connection information to MongoDB (I used port 2701 instead of 27017, but any bad information would do it). I can't say for sure this is the issue here, but what I can say is in situations like this I think the real cause of the error may getting masked at try:
async with asyncio.TaskGroup() as tg:
tg.create_task(_())
tg.create_task(interval())
except* ServerSelectionTimeoutError as e:
logger.exception(e)
logger.error(f"Error occurred while syncing: {e}") In this case I now see both the error from @alallema can you verify that your connection information is correct in your config, and you are able to connect with it? @long2ice As a guess, #18 is probably a similar issue. |
Thank you so much @sanders41! I've re-tested and checked my configuration but everything seems ok, I've probably missed something. I've also switched everything over to Python 3.11 just in case. |
@alallema since you are on 3.11 now can you try my modification to task groups to see if any new error information comes out? If you need help with that let me know and I can make a branch for you to test with. |
Yes of course! I tried it and I get this error:
I put the full error in this file output_error.txt but it's seems that it came from my configuration no |
Yes, this is a Pydantic validation error saying your config is missing values. At a quick glance through I don't see which values are missing though. |
Interesting, when I load your config I don't get an error. If you run this do you get an error or does it load? import yaml
from meilisync.settings import Settings
with open("test.yml") as f: # replace test.yml with the path to your config
config = f.read()
settings = Settings.parse_obj(yaml.safe_load(config))
print(settings) |
Alright, my bad ... I had to modify my config without taking care to do too many tests it works well now thank you very much for the script it helped me a lot.
|
I expect it will still error, but I'm hoping to get more error information. I was expecting to see something like this with the change. I purposefully created an error here so yours will look different, but I was expecting to see an > File "/home/paul/development/python/meilisync/meilisync/main.py", line 130, in run
async with asyncio.TaskGroup() as tg:
│ │ └ <TaskGroup cancelling>
│ └ <class 'asyncio.taskgroups.TaskGroup'>
└ <module 'asyncio' from '/home/paul/.pyenv/versions/3.11.4/lib/python3.11/asyncio/__init__.py'>
File "/home/paul/.pyenv/versions/3.11.4/lib/python3.11/asyncio/taskgroups.py", line 147, in __aexit__
raise me from None
└ ExceptionGroup('unhandled errors in a TaskGroup', [ServerSelectionTimeoutError("127.0.0.1:2701: [Errno 111] Connection refuse...
ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
2023-08-22 12:13:57.559 | ERROR | meilisync.main:run:135 - Error occurred while syncing: unhandled errors in a TaskGroup (1 sub-exception) Just to be sure we made the same change, my async def run():
nonlocal lock
lock = asyncio.Lock()
from pymongo.errors import ServerSelectionTimeoutError
try:
async with asyncio.TaskGroup() as tg:
tg.create_task(_())
tg.create_task(interval())
except* ServerSelectionTimeoutError as e:
logger.exception(e)
logger.error(f"Error occurred while syncing: {e}") |
Yes, me too, to be honest but I just get this:
We get exactly the same instead I put the import at the beginning of the file. I will try to keep digging but thank you so much for your help. Did synchronization work well with Mongo for you? |
I have not gotten it to work, mine always fails with Mongodb and the replication set setup. It has nothing to do with Meilisync, just my lack of MongoDB sys admin knowledge 😄 |
Me too! I've used the free version of MongoDB Cloud, and I've also finally managed to create a docker-compose that seems to work in replication. |
You need to define the file path to a dummy json with {} in it... or you could setup redis and use type: redis |
Hi @babarburiro, |
Yes but it doesn't create the file for MongoDB. |
Thanks, @babarburiro, your suggestion solved my issue. I believe this is a bug. |
Description
I tried to import documents with meilisync from the MongoDB and got an error:
Data format:
I used this sample data:
Configuration file
Screenshots & Logs:
I put my logs in a file in case:
output_error.txt
The text was updated successfully, but these errors were encountered: