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

Using a specific host and port ("failed to load my db") #1

Closed
travislaborde opened this issue Apr 26, 2012 · 14 comments
Closed

Using a specific host and port ("failed to load my db") #1

travislaborde opened this issue Apr 26, 2012 · 14 comments
Assignees

Comments

@travislaborde
Copy link

I'm encountering an error trying to use this. Most likely I'm doing something wrong. I barely ever use the command line or "shell" for anything. I use the C# driver and MongoVue for all of my Mongo interactions. But this is compelling enough to want to take a look :)

On my local dev box I have Mongo installed on port 9123 and have a number of databases. Here is what I've typed at the commandline:

E:\mongo\binaries>mongo 127.0.0.1:9123 phillynjnet --eval "var collection = 'speaker'" variety.js

As far as I understand it, I'm running Mongo, connecting to the local server telling it to evaluate the phillynjnet database and the "speaker" collection. I'm getting the following output including the error:

MongoDB shell version: 2.0.2
connecting to: 127.0.0.1:9123/test
loading file: phillynjnet
Thu Apr 26 09:03:33 file [phillynjnet] doesn't exist
failed to load: phillynjnet

Can you please tell me what I'm doing wrong?

@JamesCropcho
Copy link
Member

Glad to hear you're interested in Variety!

Yes, this is a syntax issue. You can tell, because

mongo 127.0.0.1:27017 phillynjnet

does not work, and Variety is not yet involved. Here's what Mongo shell says:

james@laptop:~/variety$ mongo -h
MongoDB shell version: 2.0.4
usage: mongo [options] [db address] [file names (ending in .js)]
db address can be:
  foo                   foo database on local machine
  192.169.0.5/foo       foo database on 192.168.0.5 machine
  192.169.0.5:9999/foo  foo database on 192.168.0.5 machine on port 9999

...and so if you try

mongo 127.0.0.1:9123/phillynjnet --eval "var collection = 'speaker'" variety.js

...it should work. Does it? Definitely let me know, especially if not.

I hope you have a great experience using Variety. Please do get in touch with any more issues, concerns or opinions you might have.

Best of Luck,
James

@travislaborde
Copy link
Author

Thanks for the quick response! Unfortunately, I tried that first. And changed it to what I reported here because it seemed like I had it wrong based on your example. Here is what I ran then and now, and the new error:

E:\mongo\binaries>mongo 127.0.0.1:9123/phillynjnet --eval "var collection = 'speaker'" variety.js

the error is about "db already exists":

MongoDB shell version: 2.0.2
connecting to: 127.0.0.1:9123/phillynjnet
Variety: A MongoDB Schema Analyzer
Version 1.0, released 10 April 2012
Thu Apr 26 09:35:56 uncaught exception: count failed: {
"assertion" : "db already exists with different case other: [phillyNJnet
] me [phillynjnet]",
"assertionCode" : 13297,
"errmsg" : "db assertion failure",
"ok" : 0
}
failed to load: variety.js

@ghost ghost assigned JamesCropcho Apr 26, 2012
@travislaborde
Copy link
Author

doh! case sensitivity? can it be? looks like it. I realized it after typing the above comment. But now I'm getting a different error :(

E:\mongo\binaries>mongo 127.0.0.1:9123/phillyNJnet --eval "var collection = 'speaker'" variety.js

MongoDB shell version: 2.0.2
connecting to: 127.0.0.1:9123/phillyNJnet
Variety: A MongoDB Schema Analyzer
Version 1.0, released 10 April 2012
Using limit of 0
Thu Apr 26 09:39:15 uncaught exception: map reduce failed:{ "errmsg" : "ns doesn
't exist", "ok" : 0 }
failed to load: variety.js

@JamesCropcho
Copy link
Member

I see. I don't suppose it's a case issue, and that

mongo 127.0.0.1:9123/phillyNJnet --eval "var collection = 'speaker'" variety.js

might work for you? Let me know.

Godspeed,
James

@travislaborde
Copy link
Author

yes, but fixing the case sensitivity thing only brought me to a new error :)

@JamesCropcho
Copy link
Member

Could you log into the shell via

mongo 127.0.0.1:9123

and run

show dbs;

and provide the output?

For what it's worth, I am personally able to use this "specific host and port" syntax and get results, locally, so think we're on some kind of right track.

J

@travislaborde
Copy link
Author

show dbs;
LEData 0.078125GB
LEData_auditing 0.078125GB
TemplateData 0.078125GB
TraceRecords 0.078125GB
bar 0.078125GB
foo 0.078125GB
local (empty)
phillyNJnet 0.078125GB
sampletests 0.078125GB
test 0.078125GB
varietyResults (empty)

@JamesCropcho
Copy link
Member

Okay, I could only guess it has to do with the capitalization? I'm exploring that now, and seeing if I can reproduce.

@JamesCropcho
Copy link
Member

...maybe you could in the meantime try running Variety on "bar" or "foo" or an all-lowercase db?

@JamesCropcho
Copy link
Member

Yep! I've confirmed it's a capitalization issue.

@JamesCropcho
Copy link
Member

Gah, spoke too soon... looking further.

@JamesCropcho
Copy link
Member

Travis,

I've noticed the error one receives when a database can't be found, is identical to the one received when a collection can't be found. Since it looks like your database can be found, maybe your collection is misidentified?

Could you log into the shell via

mongo 127.0.0.1:9123/phillyNJnet

and run

show collections;

to ensure we're not supposed to call it "speakers" or something like that?

@travislaborde
Copy link
Author

gotcha! my collection name is "Speaker" not "speaker" - sorry for all the troubles. I never expect case sensitivity and it always drives me through times like this.

thanks again!

@JamesCropcho
Copy link
Member

Very good to hear. Get in touch again if you need anything else. ~James

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