ots-share-app icon indicating copy to clipboard operation
ots-share-app copied to clipboard

Error while bringing up project: address already in use

Open TwoBrake opened this issue 1 year ago • 4 comments

Hey there! I am having an issue while setting up the project with the default database as either MongoDB is installed or isn't. I just want to make sure I have the error understanding correctly or if there is another fix before I do anything that may or may not mess up something on my system.

Here are the error logs:

make: [Makefile:16: build] Error 1 (ignored)
docker-compose -f ./docker-compose.yml run --service-ports --rm --name ots-share-run-app --entrypoint "npm run start" ots-share-run
Starting ots-share-mongo-local ... 
Starting ots-share-mongo-local ... error

ERROR: for ots-share-mongo-local  Cannot start service ots-share-mongo-local: driver failed programming external connectivity on endpoint ots-share-mongo-local (a52a7fa2ec0c1ca125cd030da00b47f8ec502990e88413f3bd32e1005e77e124): Error starting userland proxy: listen tcp4 0.0.0.0:27017: bind: address already in use

ERROR: for ots-share-mongo-local  Cannot start service ots-share-mongo-local: driver failed programming external connectivity on endpoint ots-share-mongo-local (a52a7fa2ec0c1ca125cd030da00b47f8ec502990e88413f3bd32e1005e77e124): Error starting userland proxy: listen tcp4 0.0.0.0:27017: bind: address already in use
ERROR: Encountered errors while bringing up the project.
make: *** [Makefile:45: execute] Error 1

Thank you in advance.

TwoBrake avatar Feb 28 '23 19:02 TwoBrake

@TwoBrake Sorry for the late reply. I'll look into this and provide a fix ASAP.

rpgeeganage avatar Mar 03 '23 08:03 rpgeeganage

@TwoBrake , I think it causes by this line. https://github.com/rpgeeganage/ots-share-app/blob/main/docker-compose.yml#L56 In that I expose the mongo port to the host machine. Can u comment it out and retry.

rpgeeganage avatar Mar 03 '23 16:03 rpgeeganage

Do you want me to just comment out line 56? Also, I am running from the source, not with docker; I don't know if that would change anything, just letting you know.

TwoBrake avatar Mar 03 '23 16:03 TwoBrake

And try make clean. It will close the running docker containers. Then try commenting. Because that line expose 27017 port to the host. So if another instance is using it, docker will fail. My apologies for mess of a docker files, compose files and make file. I'm planning to clean them up soon

rpgeeganage avatar Mar 03 '23 20:03 rpgeeganage