ng-demos icon indicating copy to clipboard operation
ng-demos copied to clipboard

no mondodb data in ngCodeCamper.zip

Open rohans84 opened this issue 9 years ago • 26 comments

In order to run the cc-bmean app, I started by unzipping the file ngCodeCamper.zip file, modifying the dbpath property in mongodb.config and starting up mongod daemon by using the modified mongodb.config doesn't work.

Connecting to mongo server and switching to ngCodeCamper database does not show any collelction. Does the zip file have any issues or anythign specific required to be done?

I am running this on a Mac

rohans84 avatar Dec 30 '15 00:12 rohans84

+1

When connecting to the database directly using a mongo client, there are no databases listed, and when running the cc-beam app, the last console line is:

"!!! Failed while getting MongoDb collections; is the MongoDb server running?"

Yes, it is running, but there is nothing in the DB. Did you get this resolved?

Roustalski avatar Jan 07 '16 15:01 Roustalski

I saw some wildtiger files in the unzipped folder and so I restarted mongod using the wildtiger option, but still there 0 collections connecting using a client and running db.collection.count().

Looks like the zip contains an empty database.

Roustalski avatar Jan 07 '16 17:01 Roustalski

+1 Have the same problem. After starting MongoDB and listening on port 27017 (through e.g. MongoChef i can establish connection), get "!!! Failed while getting MongoDb collections; is the MongoDb server running?" error.

vigor-rus avatar Jan 08 '16 10:01 vigor-rus

+1 me too, and can't find a solution.

AbderrahimDz24 avatar Jan 12 '16 20:01 AbderrahimDz24

+1

dinesh36 avatar Jan 19 '16 12:01 dinesh36

+1

mtaboada avatar Jan 26 '16 19:01 mtaboada

+1

hitendramalviya avatar Feb 15 '16 18:02 hitendramalviya

+1

billyroebuck avatar Mar 02 '16 11:03 billyroebuck

+1

oyeyemi avatar Mar 02 '16 21:03 oyeyemi

You should add following to the mongodb config file storageEngine=mmapv1

WiredTiger is a new storage engine for MongodDB which is now recommended over MMAPv1.

smahesaniya avatar Mar 03 '16 19:03 smahesaniya

Worked great on Linux. Got the same errors on Windows.

chsakell avatar Mar 13 '16 13:03 chsakell

It's working! thanks @smahesaniya for the solution. need to set storageEngine=mmapv1 before running the fresh extract of ngCodeCamper.zip

pancasutresna avatar Mar 20 '16 07:03 pancasutresna

+1, setting storageEngine=mmapv1 solved issue on OSX as well

ismarslomic avatar Mar 24 '16 17:03 ismarslomic

This didn't work for me received an error. 2016-04-14T06:52:41.964-0500 I STORAGE [initandlisten] exception in initAndListen: 28662 Cannot start server. Detected data files in /Users/username/development/ng-demos/cc-bmean/src/server/data/ngCodeCamper created by the 'wiredTiger' storage engine, but the specified storage engine was 'mmapv1'., terminating

I'm starting to think that the database needs to be setup via running scripts. I believe people are having issues with mongo/node version issues, but I'm not interested enough to care. I'll just follow the plural-site course with the non mongo version.

JonathanAaron avatar Apr 14 '16 11:04 JonathanAaron

@JonathanAaron: as @pancasutresna wrote, you need to set that before running the fresh extract of ngCodeCamper.zip. That means if you have extracted the zip file, you should delete the extracted folder, set storageEngine=mmapv1, and re-extract the zip file.

PhuNH avatar May 05 '16 02:05 PhuNH

I did as all you folks said, but get an error at starting cc-bmean server. Help, pls! err :)

GET /bower_components/angular/angular.js 200 11.944 ms - -
c:\Users\alex\WebstormProjects\AngularCleanCode\ng-demos\cc-bmean\node_modules\mongodb\lib\utils.js:98
    process.nextTick(function() { throw err; });
                                  ^

TypeError: Trailer name must be a valid HTTP Token ["Content-Type:"]
    at ServerResponse.OutgoingMessage.setHeader (_http_outgoing.js:347:13)
    . . .

Process finished with exit code 1

aleksmaksiuta avatar May 18 '16 06:05 aleksmaksiuta

@aleksmaksiuta: please always have Google by your side. The first result of searching "Trailer name must be a valid HTTP Token ["Content-Type:"]" should solve your problem. Or if it's not the first result, here you are https://github.com/johnpapa/ng-demos/issues/84

PhuNH avatar May 18 '16 06:05 PhuNH

Thank you @smahesaniya, setting storageEngine=mmapv1 solved the issue on OSX for me!

sstoehr avatar May 21 '16 22:05 sstoehr

Having the same problem in Windows 10. The steps that i have tried:

  1. Installed MongoDB 3.2
  2. Download fresh copy of data files.
  3. Added storageEngine=mmapv1 to my mongodb.config file. The file is now like that:

#logpath=c:\mongodb\log\mongo.log #dbpath=C:\Projects\AngularJSPatterns\ng-demos\cc-bmean\src\server\data #rest=true #storageEngine=mmapv1

  1. Added mongodb the my PATH
  2. Run this command mongod.exe --dbpath C:\Projects\AngularJSPatterns\ng-demos\cc-bmean\src\server\data

and it said "data created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'" and [initandlisten] waiting for connections on port 27017

  1. When i type http://localhost:27017/ to Chrome, i get an Error: "It looks like you are trying to access MongoDB over HTTP on the native driver port."
  2. When i try to gulp serve-dev command in project folder, i also get an error:

!!! Failed while getting MongoDb collections; is the MongoDb server running? C:\Projects\AngularJSPatterns\ng-demos\cc-bmean\node_modules\mongodb\lib\utils.js:98 process.nextTick(function() { throw err; }); ^ Error: Unable to locate collection Persons: MongoError: Collection Persons does not exist. Currently in strict mode.

FatihBekdemir avatar Oct 19 '16 10:10 FatihBekdemir

For the previous problem that i wrote above, HTTP interface deprecated since version 3.2 of mongo db https://docs.mongodb.com/ecosystem/tools/http-interfaces/

So if you are able to do, could you please update the course or mention a workaround in here. @johnpapa

FatihBekdemir avatar Oct 19 '16 11:10 FatihBekdemir

This also worked for me on Windows 7. Had to add storage line to mongodb.config file, delete extracted ngCodeCamper folder, unzip it again and restart the server.

Thanks!

thiagonsiq avatar Nov 28 '16 05:11 thiagonsiq

Please could someone describe step by step how to make this work on windows 10? I'm not getting any ... :-(

jfelix10 avatar Jan 03 '17 16:01 jfelix10

+1 I have the same problem first i installed the mongoDB from site and make it as a service running now but when try to run the configuration it give me this error: "Unable to locate collection Persons: MongoError: Collection Persons does not exist. Currently in strict mode."

Is there any solution for this issue @johnpapa

moawadallah avatar Apr 06 '17 13:04 moawadallah

@mawadallah same problem doing Angularjs clean code course on pluralsight.

I create my own mongo database that pointing to data/ngCodeCamper directory.

Error: Unable to locate collection Persons: MongoError: Collection Persons does not exist. Currently in strict mode

I hope any solution for this issue of the @johnpapa because doesn't exist script of creation to this table.

francisrod01 avatar Jun 13 '17 13:06 francisrod01

A few of the solutions above work for some folks, but not others.

The course is not reliant on the mongodb, and I may just remove it from the course entirely since the course is about Angular and not messing with configuring mongo :)

johnpapa avatar Jun 17 '17 04:06 johnpapa

+1 Thank you @smahesaniya Setting storageEngine=mmapv1 solved the issue on my OSX as well

jefo2k avatar Oct 11 '17 14:10 jefo2k