OpenSign icon indicating copy to clipboard operation
OpenSign copied to clipboard

[Bug]: Opensignserver container exiting after compose up.

Open RajGuru878 opened this issue 1 year ago • 22 comments

Issue Description

After doing compose up, OpenSignServer container exiting with the error: MongoNetworkTimeoutError: connection timed out OpenSignServer-container | at connectionFailureError (/usr/src/app/node_modules/parse-server/node_modules/mongodb/lib/cmap. Can anybody please help me in this.

Expected Behavior

unable to create user

Current Behavior

container exiting

Steps to reproduce

na

Screenshots of the issue(optional)

na

Operating System [e.g. MacOS Sonoma 14.1, Windows 11]

ubuntu 22

What browsers are you seeing the problem on?

No response

What version of OpenSignâ„¢ are you seeing this issue on? [e.g. 1.0.6]

latest

What environment are you seeing the problem on?

No response

Please check the boxes that apply to this issue report.

  • [X] I have searched the existing issues & discussions to make sure that this is not a duplicate.

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct
  • [X] I have searched the existing issues & discussions to make sure that this is not a duplicate.

RajGuru878 avatar Dec 20 '23 05:12 RajGuru878

Try running "make build" instead

nxglabs avatar Dec 20 '23 12:12 nxglabs

@nxglabs tried make build, but still same issue. trying this from one weak. after this build opensignserver exiting. It is unable to communicating with mongo container.

RajGuru878 avatar Dec 20 '23 13:12 RajGuru878

This happens when your OpenSign server is not able to connect with mongodb due to some issue with network settings etc.

nxglabs avatar Dec 20 '23 13:12 nxglabs

@nxglabs , can u plz explain how should i resolve this .

RajGuru878 avatar Dec 21 '23 09:12 RajGuru878

Can you share more details about your setup?

nxglabs avatar Dec 21 '23 09:12 nxglabs

@nxglabs What can i share?, means error or my env file

RajGuru878 avatar Dec 21 '23 10:12 RajGuru878

You are trying to setup in your local machine or AWS or Digital ocean? Your .env? And exact steps you followed.

nxglabs avatar Dec 21 '23 10:12 nxglabs

@nxglabs i am installing it in local machine ( docker based ) I am attaching my env file here, and i tried this with public ip also. first i cloned repository and then i changed .env.local_dev file as per our requirement and then ran command make build. It automaticall converted .env.local_dev file to .env and made containers up. Screenshot from 2023-12-21 15-38-41 Screenshot from 2023-12-21 15-39-00 Screenshot from 2023-12-21 15-39-08 Screenshot from 2023-12-21 15-39-14

RajGuru878 avatar Dec 21 '23 10:12 RajGuru878

You dont need to change anything other than smtp or mailgun parameters in .env.local_dev and running "make build" from the root of the cloned directory. Keep everything else as it is.

nxglabs avatar Dec 21 '23 11:12 nxglabs

@nxglabs I wanted to host mongo and everything from our host only, not with any UAT server. Soo i mentioned all our host address there.

RajGuru878 avatar Dec 21 '23 11:12 RajGuru878

Hello @RajGuru878 The IP added in mongo DB is your localhost?

rishabjasrotia avatar Dec 22 '23 07:12 rishabjasrotia

@rishabjasrotia Yess. thats my localhost.

RajGuru878 avatar Dec 22 '23 07:12 RajGuru878

This was not working in your local ? MONGODB_URI=mongodb://host.docker.internal:27017/OpenSignDB

rishabjasrotia avatar Dec 22 '23 08:12 rishabjasrotia

@rishabjasrotia No that is not working.

RajGuru878 avatar Dec 22 '23 08:12 RajGuru878

Try this: MONGODB_URI=mongodb://mongo:27017/OpenSignDB
Docker should auto-route to the mongo container (you can verify the name of the container in the docker compose file)

mrinc avatar Dec 27 '23 17:12 mrinc

@mrinc Tried with mentioned line, same error ( error screenshot is mentioned below ) Screenshot from 2023-12-28 10-58-54 Screenshot from 2023-12-28 10-58-11

RajGuru878 avatar Dec 28 '23 05:12 RajGuru878

hi there, same problem i have meet. This is a bug, and i solved it by making a mongo database named 'OpenSignDB' manually. The main reason cause this bug is the mongo/mongo-init.sh script is not running when mongo start. And you should import the default data manually when mongo server start.

creampnx-x avatar Dec 29 '23 07:12 creampnx-x

@creampnx-x Hi, Can yo plz brief about import the default data manually when mongo server start.

RajGuru878 avatar Dec 29 '23 07:12 RajGuru878

When you started your docker(run make build), the mongo server is actually running. So I just

  • use the mongo compass to connect the database server localhost:27017.
  • use it create OpenSignDB database
  • open the apps\mongo\default-data file finder
  • create collections as the json file name, and import the json file in the collection. this is the compass UI: image

BTW

  • The right way to solve this bug is write correct code in the dockerfile, but this way is the easy way to run it.
  • And, you should check your .env_local_dev file to make sure your env vars are right.

creampnx-x avatar Dec 29 '23 07:12 creampnx-x

@RajGuru878 hi bro, I discovered several new ways on it. It may be caused by docker net work.

  • link mongo to parse server. image

  • change mongo uri to 'mongo://mongo:27017/OpenSignDB' image

See it on stackoverflow: https://stackoverflow.com/questions/45257581/parse-mongo-db-can-not-connect-to-server

creampnx-x avatar Dec 30 '23 13:12 creampnx-x

@creampnx-x not working, opensign server container exiting again.

RajGuru878 avatar Jan 04 '24 10:01 RajGuru878

Hey @RajGuru878

Are you still facing issues with the last release ?

If not i will mark this issue as solved

Zathiel avatar Jun 02 '24 02:06 Zathiel