Docker MongoDB error : Can't call something

I have Dockerized MongoDB and trying to access it from another container running on the same host. But i am getting the following error on the container:

com.mongodb.MongoException$Network: can't call something : /1.2.3.4:27017/admin
        at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:227)
        at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:305)
        at com.mongodb.DB.command(DB.java:160)
        at com.mongodb.DB.command(DB.java:183)
        at com.mongodb.DB.command(DB.java:144)
        at com.mongodb.DB.command(DB.java:195)
        at com.mmi.epg.utils.MongoDB.getDbVersion(MongoDB.java:117)
        at com.mmi.epg.utils.MongoDB.<init>(MongoDB.java:73)
        at com.mmi.epg.utils.MongoDB.getInstance(MongoDB.java:105)
Caused by: java.io.EOFException
        at org.bson.io.Bits.readFully(Bits.java:37)
        at org.bson.io.Bits.readFully(Bits.java:28)
        at com.mongodb.Response.<init>(Response.java:39)
        at com.mongodb.DBPort.go(DBPort.java:128)
        at com.mongodb.DBPort.call(DBPort.java:79)
        at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:218)
        ... 13 more

Where fcdfd39baedb is the service container which access the mongoDB. I have this line in mongod.conf.

  • Cannot link to a running container started by docker-compose
  • Docker - Prometheus container dies immediatly
  • Container cannot be started from bootlocal.sh
  • Sorl4 failing to index when using EBS volume in ECS
  • How to place files on shared volume from within Dockerfile?
  • Troubleshoot docker connectivity to external network
  • #bind_ip=127.0.0.1
    

    Why did the service use an Internal IP address and had container ID before that to call MongoDB instance ? Am i doing something wrong here ?

    Update: Please find my Dockerfile below

    FROM tveuser/tve-repository:tve-centos
    MAINTAINER karthik.jayaraman "karthik.jayaraman@xyz.com"
    
    VOLUME ["/data/db"]
    
    # Expose port #27017 from the container to the host
    EXPOSE 27017
    
    ADD /scripts/mongodb.repo /etc/yum.repos.d/
    
    ADD /conf/mongod.conf /etc/
    
    ADD supervisord.conf /etc/
    
    RUN yum install -y mongo-10gen mongo-10gen-server &&\
        mkdir -p /data/db
    
    CMD supervisord -c /etc/supervisord.conf
    

    Update

    I have updated my question. I could telnet the IP and Port number from my service but unable to connect to MongoDB. Would appreciate some help.

  • Not able to switch my Docker's automatic build repository to a private repository for an Organisation
  • Can not connect nodes to docker swarm master (using zookeeper)
  • How to Install Hadoop slaves in docker make a master node on local computer to handle these slave nodes?
  • Docker unable to ping container from host
  • Is Docker for Mac Open Source? [closed]
  • Docker and HttpCallback
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.