title: Error connecting to compute engine MongoDB instance from app engine node.js and mongoose
body: <p>So at this point I am running the app by the command: nodemon server.js, I did not deploy. I created a Bitnami powered compute engine machine that has MongoDB installed, and it works when I log in to it.</p>
  
  <p>From my nodejs App engine I connect like this:</p>
  
  <pre><code>mongoose.connect('mongodb://XXX.XXX.XXX.XXX:27017/myDB',{user: 'root', pass: 'password', useMongoClient: true});
  </code></pre>
  
  <p>The error I get is:</p>
  
  <pre><code>failed to connect to server [XXX.XXX.XXX.XXX:27017] on first connect
  </code></pre>
  
  <p>I tried ssh-ing into the compute engine and I did the following:</p>
  
  <ul>
  <li><p>adding perimision for port 27017:</p>
  
  <p><code>gcloud compute firewall-rules create allow-mongodb --allow tcp:27017</code> </p></li>
  </ul>
  
  <p>It said it already exist.</p>
  
  <ul>
  <li>I changed in mongodb.config in bind_ip to 0.0.0.0. Still nothing.</li>
  </ul>
  
  <p>This is very frustating, if you have any idea I would very much apreciate it. As a mention, I do not have a lot of experience with this, so please be explicit.</p>