Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Unable to create Articles #1422

Closed
praneethkumarpidugu opened this issue Aug 7, 2016 · 5 comments
Closed

Unable to create Articles #1422

praneethkumarpidugu opened this issue Aug 7, 2016 · 5 comments
Assignees
Milestone

Comments

@praneethkumarpidugu
Copy link

Hello World:

I have followed the documentation to install all the requirements. Here are the below steps I have performed:

Terminal 1: grunt

Terminal 2: mongodb/bin/mondod --dbpath /data/db
2016-08-07T14:21:44.990-0400 I - [initandlisten] Detected data files in /data/db/ created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
2016-08-07T14:21:44.990-0400 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=1G,session_max=20000,eviction=(threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),checkpoint=(wait=60,log_size=2GB),statistics_log=(wait=0),
2016-08-07T14:21:52.011-0400 I NETWORK [HostnameCanonicalizationWorker] Starting hostname canonicalization worker
2016-08-07T14:21:52.011-0400 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory '/data/db/diagnostic.data'
2016-08-07T14:21:52.347-0400 I NETWORK [initandlisten] waiting for connections on port 27017
2016-08-07T14:21:54.234-0400 I NETWORK [initandlisten] connection accepted from 127.0.0.1:52497 #1 (1 connection now open)
2016-08-07T14:28:58.661-0400 I NETWORK [initandlisten] connection accepted from 127.0.0.1:52729 #2 (2 connections now open)
2016-08-07T14:29:10.700-0400 I NETWORK [initandlisten] connection accepted from 127.0.0.1:52730 #3 (3 connections now open)
2016-08-07T14:30:02.062-0400 I COMMAND [conn2] command mean-dev.sessions command: find { find: "sessions", filter: { _id: "MY_KEY", $or: [ { expires: { $exists: false } }, { expires: { $gt: new Date(1470594601929) } } ] }, limit: 1, batchSize: 1, singleBatch: true } planSummary: IXSCAN { _id: 1 } keysExamined:1 docsExamined:1 cursorExhausted:1 keyUpdates:0 writeConflicts:0 numYields:0 nreturned:1 reslen:368 locks:{ Global: { acquireCount: { r: 2 } }, Database: { acquireCount: { r: 1 } }, Collection: { acquireCount: { r: 1 } } } protocol:op_query 105ms
2016-08-07T14:36:57.177-0400 W NETWORK [HostnameCanonicalizationWorker] Failed to obtain name info for: [ (MY_IP_ADDRESS, "nodename nor servname provided, or not known"), (MY_IP_ADDRESS, "nodename nor servname provided, or not known") ]

Terminal 3: mongodb/bin/mongod
MongoDB shell version: 3.2.8
connecting to: test
Welcome to the MongoDB shell.
For interactive help, type "help".
For more comprehensive documentation, see
http://docs.mongodb.org/
Questions? Try the support group
http://groups.google.com/group/mongodb-user

show dbs;
local 0.000GB
mean-dev 0.000GB
use mean-dev
switched to db mean-dev
show collections;
sessions
users

When I go to the 0.0.0.0:3000 I see the MEAN home page. I have signed up and logged in. But I'm unable to create any article.
screen shot 2016-08-07 at 2 32 54 pm

@hyperreality
Copy link
Contributor

You need to add your user as an admin role using the mongo shell. Then you will be authenticated to view the Admin menu and page, which now contains the create article page.

@praneethkumarpidugu
Copy link
Author

@hyperreality could you provide commands in the mongo shell ?

@hyperreality
Copy link
Contributor

I'm don't have the mongo shell in front of me and am doing this from memory, but I think it should work:

use mean-dev
db.users.update( { username: 'YOUR_USERNAME' }, { $set: { roles: ['user', 'admin'] } })

But in any case I suggest you read the manual :)

@mleanos
Copy link
Member

mleanos commented Aug 8, 2016

@hyperreality's suggestion will work (not sure on the syntax though). However, as an alternative the MONGO_SEED option can be set when starting a MEANJS application to create an Admin user, if one doesn't exist. When a new user is created using the MONGO_SEED options, the password will be output in your console.

See https://github.com/meanjs/mean#running-with-user-seed for more information.

@ilanbiala
Copy link
Member

@praneethkumarpidugu can this be closed?

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

No branches or pull requests

5 participants