Oops, sorry, I forgot to post a follow-up.
In my case, the server logs did not tell me much.
However, the problem was with the PG server.
It was short of memory, and was crashing when scanning some big projects.
I allocated it more memory, and now all is fine.
Thanks for your support @ganncamp !