Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7966341
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T06:23:57+00:00 2026-06-04T06:23:57+00:00

I using cloud9 ide coding new project. When I deploy on cloudfoundry from cloud9ide.

  • 0

I using cloud9 ide coding new project. When I deploy on cloudfoundry from cloud9ide. I have error

Application failed to start. Please note that CloudFoundry uses a different port to listen to. When calling ‘listen()’ use it like ‘.listen(process.env.PORT || process.env.VCAP_APP_PORT)’.

This is my source

var port = (process.env.VMC_APP_PORT || 3000);

var host = (process.env.VCAP_APP_HOST || ‘localhost’);

var http = require(‘http’);

var env = process.env.VCAP_SERVICES ? JSON.parse(process.env.VCAP_SERVICES) : null;

var mongodata = env[‘mongodb-1.8’][0][‘credentials’];

http.createServer(function (req, res) {

res.writeHead(200, {‘Content-Type’: ‘text/plain’});

res.end(‘Hello World\n’ + env);
}).listen(port, host);

This source have error when I get mongo object

var mongodata = env[‘mongodb-1.8’][0][‘credentials’];

But not have this line deploy successful

Please help me !!

Thanks so much

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T06:23:59+00:00Added an answer on June 4, 2026 at 6:23 am

    As the error in the cloud9 console probably tells you (as it tells me when i try this 🙂 ):

    haalasdoallalsakdl (CloudFoundry): [5/6] Crash log
    ============/logs/stderr.log============
    node.js:201
            throw e; // process.nextTick error, or 'error' event on first tick
                  ^
    TypeError: Cannot read property '0' of undefined
        at Object.<anonymous> (/var/vcap/data/dea/apps/haalasdoallalsakdl-0-8be0d413a9ec29a79f665d388ce414bd/app/server.js:7:35)
        at Module._compile (module.js:432:26)
        at Object..js (module.js:450:10)
        at Module.load (module.js:351:31)
        at Function._load (module.js:310:12)
        at Array.0 (module.js:470:10)
    

    So there is no entry in VCAP_SERVICES called like that. When I console.log the process.env variable, there isn’t even any service listed.

    So you’ll have to install the mongodb service for your app. Fastest to do this is via the CF VMC tools (can’t run this in cloud9 at the moment, so you’ll have to install this locally):

    vmc create-service mongodb --bind your_app_name
    

    Then it’ll start up fine.

    N.B. You can probably fix this in the .yml file, but I don’t know how to do this 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using cloud9 ide for my JavaScript project. I tried a lot but
I have tried using some browser based IDE's like cloud9 IDE recently. But it
I recently tried using the Cloud9 online IDE . It starts by creating a
We're using EngineYard Cloud to deploy our Ruby on Rails application. We are running
I've been contemplating moving my project over to cloud 9 IDE but have been
I am developing a web application using Python, Django and MySql. I have a
Anyone else having luck using flatironjs with the Cloud9 ide? In my server.js file
I am very new to BeagleBone. I have been using Arduino upto now. I
I'm using Cloud9 IDE. My goal is to be able to develop applications that
In a cloud application, you would have multiple customers using your service. Is it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.