Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install instructions not working #3

Closed
bigdoods opened this issue Mar 8, 2017 · 12 comments
Closed

Install instructions not working #3

bigdoods opened this issue Mar 8, 2017 · 12 comments

Comments

@bigdoods
Copy link

bigdoods commented Mar 8, 2017

HI Phillipe,

Thanks for the great work done on this app so far. I am in the process of trying to write a dockerize it so that I can easily deploy it to any infrastructure but first I am trying to deploy it locally.

I have followed your steps to build the app i.e clone, npm install I get nothing. npm run dev and npm run build-dev throws missing script errors.

So, I have setup mongo on my machine to listen on port 27017 and run npm start and I get a connection timed warning.

Can you help me get setup please?

@leefsmp
Copy link

leefsmp commented Mar 8, 2017

Can you clarify what you mean by "npm install I get nothing" ?! Does this install the required packages locally? ... also tell me more about the errors, a dump of your console would be useful

@bigdoods
Copy link
Author

bigdoods commented Mar 8, 2017

Sorry about not being clearer. npm install runs fine and finishes ok. However, when I run npm run dev I get npm ERR! missing script: dev and for run build-dev I get npm ERR! missing script: build-dev

@leefsmp
Copy link

leefsmp commented Mar 8, 2017

sorry I forgot to update the readme to reflect the changes I did recently. To build and run the dev version simply do "npm start" this should start webpack-dev-server and build dynamically the client in memory. For a production build do "npm run build-prod": this will output the files in /dist. You also need to check the config/ directory and adapt to your local database setup. At the moment my demo requires to connect to 2 DBs but you may only want one for testing. You will also need to adapt the records in the DB as described in the readme.

@bigdoods
Copy link
Author

bigdoods commented Mar 8, 2017

Cheers!

@leefsmp
Copy link

leefsmp commented Mar 8, 2017

let me know if you have further trouble... can be a bit challenging to set up this sample depending on your experience with those tools

@bigdoods
Copy link
Author

bigdoods commented Mar 9, 2017

I have just run the mongod using resource/db as the path for my database on port 27107 but when I try to connect to it, I get a MongoError: authentication failed. I have setup a user in the db and updated the config to use the new user and pw but its still giving the same error with code:18.
Is a user setup for the db required? Do I need to configure the db to use auth in the mongo.conf file?

@leefsmp
Copy link

leefsmp commented Mar 9, 2017

you should not set the DB path to the resource/db of the sample, the path of the DB must be a path on your machine independent of any samples. Once you have setup the DB you can use the .json files in resource/db to import the records. You don't need to setup a user/pwd when you run mongo locally. I'm using an admin tool such as studio3T to manage my locals and remote databases without hassle ...

@bigdoods
Copy link
Author

bigdoods commented Mar 9, 2017

Ok, I am not using any proprietary management tools unfortunately as my goal is to run this on a private cloud behind a proxy.

mongoSvc cannot authenticate with mongo itself for rcdb but somehow succeeds to create forge-configurator.

Steps I have taken to run this so far:
1 - $ npm install
2 - (update forge keys env variables)
3 - Run mongo with new data/db path

Console output when I run $ npm start :

Server listening on: 
{ address: '::', family: 'IPv6', port: 3000 }
ENV: undefined
MongoDbSvc: connected to forge-rcdb
uncaughtException
{ MongoError: Authentication failed.
    at Function.MongoError.create (/home/bigdoods/yano/jenca/apps/forge-rcdb.nodejs/node_modules/mongodb-core/lib/error.js:31:11)
    at /home/bigdoods/yano/jenca/apps/forge-rcdb.nodejs/node_modules/mongodb-core/lib/connection/pool.js:483:72
    at authenticateStragglers (/home/bigdoods/yano/jenca/apps/forge-rcdb.nodejs/node_modules/mongodb-core/lib/connection/pool.js:429:16)
    at Connection.messageHandler (/home/bigdoods/yano/jenca/apps/forge-rcdb.nodejs/node_modules/mongodb-core/lib/connection/pool.js:463:5)
    at Socket.<anonymous> (/home/bigdoods/yano/jenca/apps/forge-rcdb.nodejs/node_modules/mongodb-core/lib/connection/connection.js:319:22)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:189:7)
    at readableAddChunk (_stream_readable.js:176:18)
    at Socket.Readable.push (_stream_readable.js:134:10)
    at TCP.onread (net.js:551:20)
  name: 'MongoError',
  message: 'Authentication failed.',
  ok: 0,
  code: 18,
  errmsg: 'Authentication failed.' }
MongoError: Authentication failed.
    at Function.MongoError.create (/home/bigdoods/yano/jenca/apps/forge-rcdb.nodejs/node_modules/mongodb-core/lib/error.js:31:11)
    at /home/bigdoods/yano/jenca/apps/forge-rcdb.nodejs/node_modules/mongodb-core/lib/connection/pool.js:483:72
    at authenticateStragglers (/home/bigdoods/yano/jenca/apps/forge-rcdb.nodejs/node_modules/mongodb-core/lib/connection/pool.js:429:16)
    at Connection.messageHandler (/home/bigdoods/yano/jenca/apps/forge-rcdb.nodejs/node_modules/mongodb-core/lib/connection/pool.js:463:5)
    at Socket.<anonymous> (/home/bigdoods/yano/jenca/apps/forge-rcdb.nodejs/node_modules/mongodb-core/lib/connection/connection.js:319:22)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:189:7)
    at readableAddChunk (_stream_readable.js:176:18)
    at Socket.Readable.push (_stream_readable.js:134:10)
    at TCP.onread (net.js:551:20)
MongoDbSvc: connected to forge-configurator

@leefsmp
Copy link

leefsmp commented Mar 9, 2017

You can keep just one DB in the /config/development.config.js so it would look like this:

databases: [
    {
      type: 'mongo',
      dbName: 'forge-rcdb',
      user: '',
      pass: '',
      dbhost: 'localhost',
      port: 27017,
      collections: {
        materials: 'rcdb.materials',
        models: 'rcdb.models'
      }
    }
  ]

So you need to create a local DB in mongo called "forge-rcdb" which contains two collections "rcdb.materials" and "rcdb.models" that you can easily import using an admin tool like the one mentioned above. You can of course import the collections programmatically but it will be more work.

I don't know why this would fail, but I would first use the tool to make sure the DB is working correctly and that you can connect to it before running the sample.

@leefsmp
Copy link

leefsmp commented Mar 13, 2017

I assume you got this sorted out so I will close the issue, if not let me know.

@leefsmp leefsmp closed this as completed Mar 13, 2017
@bigdoods
Copy link
Author

Hi Phillipe,

I sorted it but not without many hours of debugging. This is the screenshot for the errors I encountered in the browser once I got the mongo db setup.

error

In order to get any model to appear, I had to go to the Autodesk model derivative API and upload/convert my own model (the service at https://models.autodesk.io/ didnt work), then updated the rcdb.models collections with the new values for the converted models.

A learning experience but with some hiccups!

Thanks :)

@leefsmp
Copy link

leefsmp commented Mar 14, 2017

Deploying Project #5 of my forge boilers on Heroku, as indicated in the readme instructions, would have allowed you to upload and manage your models in minutes ...

Another option would be to deploy to heroku the Forge boiler plate sample #5. Make sure you deploy Project #5. This set up is more straightforward since it doesn't require any Cloud database or pre-translated models. It will let you upload, translate and manage further models as well

I'm glad you could sort it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants