Git Product home page Git Product logo

Comments (5)

GeoffreyBooth avatar GeoffreyBooth commented on July 28, 2024

Is it possible that the mongodb package isn't getting installed and available globally?

The deprecation warning in your output comes from that package. But it was never intended to be available globally, it's installed under the folder where that script is run.

from meteor-base.

tomcardoso avatar tomcardoso commented on July 28, 2024

Oh, I'm not worried about the deprecation warning. But the fact the docker-compose up command never makes it past the Mongo check is a bit frustrating. Could it be a race condition of some sort?

from meteor-base.

GeoffreyBooth avatar GeoffreyBooth commented on July 28, 2024

Yes, that's why the script is there to poll until Mongo is ready. The Node container usually starts up faster than Mongo in my experience.

from meteor-base.

tomcardoso avatar tomcardoso commented on July 28, 2024

Right, but what I'm saying is the poll never ends. It just polls and polls and polls…

from meteor-base.

tomcardoso avatar tomcardoso commented on July 28, 2024

Oh, good lord, I think I figured it out. I had a misconfigured port, so I wasn't able to access the app. For some reason, the "Starting app…" message never appeared in my console, so while the app was running, it was just inaccessible. Could I suggest adding a console statement inside the connect-to-mongo.sh declaring a successful connection? Might help when reviewing logs in the future. Something like:

const mongoClient = require('mongodb').MongoClient;
setInterval(function() {
  console.log('Polling for Mongo connection…');
  mongoClient.connect(process.env.MONGO_URL, function(err, client) {
    if (client) {
      console.log('Mongo connected.');
      client.close();
    }
    if (err) {
      console.error(err);
    } else {
      process.exit(0);
    }
  });
}, 1000);

A bit odd that the "Starting app…" message never pops up — not sure why that's happening. Sorry for the confusion.

from meteor-base.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.