Apparently it yielded the socket before the DB is ready... I added a 5s sleep but it's only a temporary hack