PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Saturday the 25th of October, 2014

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[00:00:09] <GothAlice> (The link I provided is a day-of-the-week aggregated report of general activity levels for, usually, a two week period. Used to compare a two-week period vs. another a la http://cl.ly/image/3X2o1W0X1d2m)
[00:00:13] <GothAlice> mongoooo: ^
[00:01:00] <GothAlice> Ugh; http://cl.ly/image/3X2o1W0X1d2m in English.
[00:01:13] <GothAlice> http://cl.ly/image/0P0e0G000q0e ARG
[00:02:07] <mongoooo> thanks, very cool/helpful!
[00:03:03] <GothAlice> No worries. :)
[00:04:26] <mongoooo> how do you find python + mongo? i'm using mean stack and come from a rails background, so i wonder how mongo plays with something like ruby or python
[00:05:05] <GothAlice> I fscking love it, pardon my UNIX-ish explataive.
[00:05:06] <GothAlice> ^_^
[00:05:27] <GothAlice> You have no idea how many awesome and advanced and mind-blowing things MongoDB has let me do. ^_^
[00:05:52] <mongoooo> did you previously use an relation db?
[00:06:27] <GothAlice> Aye; Postgresql, and before that MySQL.
[00:06:36] <GothAlice> I've been a professional developer for 20+ years. ;)
[00:07:04] <mongoooo> ah, cool to hear
[00:07:59] <GothAlice> I, personally, have 24TiB or so of data in MongoDB at the moment.
[00:08:17] <GothAlice> All driven by Python code.
[00:09:47] <GothAlice> mongoooo: I pm'd you some links so as to not spam the channel. ;)
[00:29:40] <harph> I'm trying to add a replica set by doing rs.add('repl.02:27017')
[00:30:07] <harph> and I'm getting this error: set name does not match the set name host repl.02:27017 expects, Any ideas why?
[00:31:08] <GothAlice> harph: Could you pastebin the mongod.conf config file for that host and the command line? (ps aux to find the PID of mongod, cat /proc/<pid>/cmdline)
[00:32:02] <harph> this is what I got in repl.02: mongodb 2677 1 3 00:23 ? 00:00:12 /usr/bin/mongod --config /etc/mongodb.conf
[00:34:19] <GothAlice> harph: cat /proc/2677/cmdline
[00:34:36] <harph> GothAlice: http://pastebin.com/njrZHfwf
[00:35:05] <harph> GothAlice: this is the result of the cat: /usr/bin/mongod--config/etc/mongodb.conf
[00:36:30] <GothAlice> harph: That's your problem right there. Line 6: replSet=rs2
[00:36:49] <GothAlice> harph: You attempted to add that boxen to a set called "repl.02", not "rs2".
[00:37:32] <harph> GothAlice: ohh I see... let me try changing that
[00:50:50] <harph> GothAlice: same error
[00:51:50] <GothAlice> harph: Which did you change? The rs.add() line or the mongod.conf line?
[00:52:53] <harph> the conf
[00:53:34] <GothAlice> Did you restart the process?
[00:53:37] <harph> yes
[00:54:14] <GothAlice> Well, if it's the same error there's still a mismatch there. You didn't give me the commandline.
[00:57:39] <harph> GothAlice: yes, this is the cmdline /usr/bin/mongod--config/etc/mongodb.conf
[01:00:13] <GothAlice> Okay, so no --replSet on the CLI, that's good.
[01:01:01] <GothAlice> If that node doesn't contain anything, I'd recommend nuking /var/lib/mongodb/* (but keeping the folder) and restarting once more. It might have recorded the old replSet name.
[01:08:43] <Cydrobolt> Hi
[01:09:04] <Cydrobolt> I'm trying to make an app that saves to a mongo collection
[01:09:23] <Cydrobolt> although it needs to update as well as insert
[01:09:36] <Cydrobolt> how should I phrase the save to make it work/
[01:10:28] <GothAlice> Cydrobolt: We'll need to know some details in order to help you. What language? What client driver or ORM/ODM?
[01:10:41] <Cydrobolt> I'm using MongoDB on Node.js
[01:11:02] <Cydrobolt> Actually, it might be a mongoose problem
[01:11:07] <Cydrobolt> I'm using Mongoose's .save
[01:12:06] <GothAlice> But in pure MongoDB shell (which is also JS), an insert is pretty simple. db.collection.insert({…})
[01:19:07] <Synt4x`> ok in my mongoDB my _id is a dict, i.e. "_id":{'date':'date', 'name':'name', 'score:score'}
[01:19:28] <Synt4x`> when I do a .find() or .findOne() how do I get to that data? I can't just do {'id':theIDIwant}
[01:19:30] <Synt4x`> like I would usually do
[01:20:44] <GothAlice> …
[01:20:48] <GothAlice> Actually, yes you can.
[01:21:05] <GothAlice> {id: {date: …, name: …, score: …}} should work.
[01:21:15] <GothAlice> er, _id
[01:21:32] <Synt4x`> ah ok, so if I want to filter on just one part of it I can do {'_id': {'name':TheNameIWant}}
[01:21:46] <joannac> nooooo
[01:22:00] <Synt4x`> yea sorry, I just want to filter on one part of the ID, I wasn't specific**
[01:22:02] <joannac> "_id.name" : TheNameIWant
[01:22:08] <joannac> do that always always
[01:22:09] <Synt4x`> ahh perfect, thats it
[01:22:28] <Synt4x`> btw Joanna I have used aggregate like 5x more since that day, all perfectly, that day helped me a ton :)
[01:22:31] <Synt4x`> really appreciate it again
[01:22:50] <joannac> if your document is {a: {b:1, c:1}}
[01:22:58] <joannac> a: {b:1} does NOT match
[01:23:06] <joannac> a: {c:1, b:1} does NOT match
[01:23:36] <joannac> don't ever do searches like that unless you are 100% sure you know the order and types and nothing will get rearranged and ... just don't do it
[01:23:59] <joannac> do "a.b":1
[01:24:04] <joannac> </rant>
[01:24:08] <Synt4x`> got it :), ty
[01:24:18] <joannac> also yw :)
[01:24:59] <GothAlice> Ah, right, dicts don't preserve order. I keep forgetting that.
[01:25:15] <GothAlice> joannac: Sometimes I'm wrong. I enjoy being corrected! Thank you.
[01:26:19] <joannac> GothAlice: yeah, dicts don't preserve order, I think it's in the JSON spec. But matching on documents requires strict order.
[01:27:14] <joannac> I think I asked once about that but I don't remember the answer
[01:28:18] <joannac> And no problem, sorry for the rant. it's one of those things everyone gets wrong at least once and I don't want the incorrect answer propagated :)
[01:28:29] <GothAlice> joannac: Indeed! :D
[01:50:58] <GothAlice> https://gist.github.com/amcgregor/15166fd78d00c03f1592/8c4b954925da995a9c03e0c635fe22a6087348ca just made my face implode. (Assisting a MongoEngine user in another channel.)
[01:52:12] <GothAlice> There are so many anti-patterns in that it's hard to know where to start. locals()['#boxes'] assignment is not a half bad choice, though.
[02:38:41] <TheWhiteOx> Hey what's the command to update or create just one datafield of a document?
[02:39:15] <GothAlice> $set
[02:39:20] <GothAlice> TheWhiteOx: ^
[02:41:33] <TheWhiteOx> So i could do something like Collection.update({$set: {newKey: newValue}}); and it'll just insert a new key value pair without overwriting the entire document?
[02:43:09] <GothAlice> TheWhiteOx: Yes.
[02:44:02] <GothAlice> Except that exact update might not do what you think. (Assuming it's p-code, you grok the idea, but it's a bit strange.) It's important to note that MongoDB makes a distinction between update-one and update-many.
[02:46:05] <TheWhiteOx> ahhh icic thanks
[02:53:41] <GothAlice> TheWhiteOx: It never hurts to help. :)
[02:59:36] <TheWhiteOx> :)
[04:46:50] <TheWhiteOx> Hey anybody know the syntax to return a stored string value from a specific key in a mongodb document, given I had the document ID?
[04:48:19] <GothAlice> TheWhiteOx: db.collection.findOne({_id: ObjectId("…")}, {specificKey: 1}).specificKey
[04:51:48] <GothAlice> TheWhiteOx: Or, in MongoEngine (Python): MyDocument.objects.scalar('specificKey').get(id=ObjectId("…"))
[04:52:02] <TheWhiteOx> Oh man!!! It worked! What does the 1 mean? and i'm assuming the .specificKey at the end retrieves JUST the value?
[04:52:11] <GothAlice> 1 means "include it" in this instance.
[04:52:15] <TheWhiteOx> ahhhh icic
[04:52:29] <TheWhiteOx> great help! thanks! Hope for the noobs!
[04:52:36] <GothAlice> find() and findOne() take the query as the first argument, and which fields you want in the optional second.
[04:53:22] <TheWhiteOx> ahh icic
[04:54:33] <GothAlice> TheWhiteOx: (I wrote the MongoEngine .scalar() thing to avoid that ugly double field reference. I.e. {specificKey: 1} followed by .specificKey on the returned result.)
[04:57:01] <TheWhiteOx> ahhhhh icic
[10:38:49] <Synt4x`> anybody around tonight? looking for some DB advice
[10:40:54] <kali> Synt4x`: better ask
[10:41:03] <Synt4x`> yea writing it up in pastebin, it's easier
[10:43:10] <Synt4x`> http://pastebin.com/mBcPvJFC
[10:43:14] <Synt4x`> Ok there it is, my question :-p
[10:43:18] <Synt4x`> I think that will make the most sense
[10:48:59] <Synt4x`> It's basically, I have a bunch of data I'm calculating on the fly, and want to know what I should store, and what I should calculate each time
[10:52:30] <Synt4x`> nevermind too tired, will work more on it tomorrow, goodnight guys
[12:00:00] <arussel> I'm tying to run a $rename query but got that error: cannot create details for $rename mod
[12:00:03] <arussel> what does it mean ?
[13:39:50] <dreambox> hey guys, I m trying to figure out if theres any tool that works without a billion configurations to browse through a webpage my mongodb collections/databases
[15:18:01] <appleguru> anyone up for helping a mongo noob with a find() query?
[15:29:00] <redfox_> appleguru: just tell us your problem
[15:29:37] <appleguru> trying to get a result set that contains only the elements that have a key with a specific value
[15:30:12] <appleguru> but when I run my query.. I get all the other elements as well (that don't contain the value I want) that are part of the document
[15:31:41] <appleguru> example: db.stuff.find({"box.bag.pockets.items.color" : "blue"})
[15:31:54] <appleguru> I just want the blue items to be returned
[15:32:04] <appleguru> and not everything in a pocket that has a blue item
[15:34:29] <appleguru> actually, now that I look the results more closely, I'm pretty sure that query is just returning everything in box
[16:09:37] <ali_> hi.
[16:09:43] <ali_> can anyone take a look at this, please? http://stackoverflow.com/questions/26563396/mongoose-schema-sub-document-reference-with-attributes
[16:37:40] <appleguru> I am writing a python script to parse mongo's son output to find the data that I want... I feel like I'm defeating the entire purpose of having the data in a database to begin with...
[17:25:14] <rainforest> hi
[17:25:39] <rainforest> running sudo service mongod start gives me the following error:
[17:25:39] <rainforest> 2014-10-25T10:22:53.801-0700 [initandlisten] exception in initAndListen: 12596 old lock file, terminating
[17:25:44] <rainforest> i'm running ubuntu
[17:46:56] <ehershey> rainforest: do you have a mongod process running already?
[17:47:45] <rainforest> ehershey: i don't think so, the mongo client says "connection refused"
[18:21:27] <GothAlice> rainforest: ps aux | grep mongo
[18:21:57] <GothAlice> If there are no matching processes, remove the mongod.lock file in /var/lib/mongodb and re-run that sudo service line.
[18:22:12] <rainforest> yup that's what i did
[18:22:16] <rainforest> except i also repaired mongo
[18:22:23] <rainforest> not sure if repairing was necessary, but it worked
[18:22:24] <GothAlice> Indeed; if it crashed, it may have required repair.
[18:22:41] <GothAlice> Do you have journalling enabled?
[18:23:11] <rainforest> GothAlice: i'm not sure, how do I enable it?
[18:23:27] <GothAlice> rainforest: Check in your mongod.conf file (in /etc somewhere)
[18:24:15] <GothAlice> If you have journalling turned on (or turn it on) you'll very rarely actually need to run --repair; it should correct itself on next startup automatically.
[18:24:53] <GothAlice> rainforest: http://docs.mongodb.org/manual/reference/configuration-options/#storage.journal.enabled
[18:25:23] <GothAlice> http://docs.mongodb.org/manual/core/journaling/ describes journalling in more detail.
[19:21:43] <GothAlice> Hmm; pymongo seems to have changed its timeout behaviour; instead of raising ExecutionTimeout it now just returns an empty resultset. :/ Might be MongoEngine, though, capturing it upstream. Let me check.
[19:28:50] <GothAlice> Nope, MongoeEngine isn't capturing that exception. :/
[19:30:32] <GothAlice> "MongoDB doesn’t support custom timeouts for cursors…" via http://api.mongodb.org/python/current/faq.html#how-do-i-change-the-timeout-value-for-cursors — well, what the hojek happened to cursor.max_time_ms?
[20:00:10] <rainforest> i keep getting "Segmentation fault (core dumped)" when i run mongo::client::initialize();
[20:00:20] <GothAlice> rainforest: That's not good at all.
[20:00:30] <rainforest> oh nooo :(
[20:00:48] <rainforest> it took me forever to properly compile and link mongodb.. and now im getting seg fault errors :(((
[20:00:51] <GothAlice> Are you sure you're running a driver on the correct architecture and platform it was compiled for? (I.e. shared library deps.)
[20:01:03] <GothAlice> Ah, not a binary package, then.
[20:01:04] <rainforest> i think so..
[20:01:14] <GothAlice> rainforest: Why did you compile it from scratch?
[20:01:45] <rainforest> what do you mean?..
[20:02:14] <GothAlice> http://www.mongodb.org/downloads < the standard approach is to use the binary packages, usually the binary packages provided by your distribution.
[20:02:34] <GothAlice> Step one in diagnosing your segfault: try the binary packages.
[20:02:45] <GothAlice> If *they* segfault, you have a much, much bigger issue.
[20:02:49] <rainforest> i'm confused.. is this about the driver or mongodb itself
[20:03:07] <GothAlice> rainforest: "it took me forever to properly compile and link mongodb"
[20:03:13] <rainforest> oh
[20:03:14] <GothAlice> rainforest: So, you clearly indicated you *compiled mongodb*
[20:03:15] <GothAlice> ;)
[20:03:20] <rainforest> i'm referring to the driver srry!!
[20:03:23] <GothAlice> ^_^
[20:03:25] <GothAlice> No worries.
[20:03:40] <rainforest> this is the command i used to compile the driver: scons --prefix=$HOME/mongo-client-install --ssl --sharedclient --full --use-system-boost --c++11 --libc++ install-mongoclient --cxx=clang++ --disable-warnings-as-errors
[20:03:54] <GothAlice> But still; which distro are you on? Your distro should already have a package for the driver you can just drop in.
[20:03:57] <rainforest> i moved include and lib to /usr/ later
[20:03:59] <rainforest> Ubuntu
[20:04:04] <rainforest> wow really?
[20:04:27] <GothAlice> Yes.
[20:04:56] <GothAlice> For me it's: "emerge dev-libs/libmongo-client dev-python/pymongo dev-python/mongoengine"
[20:05:04] <GothAlice> (That gets me the driver suite I typically use, on Gentoo.)
[20:05:27] <GothAlice> You'll have to reference the documentation for Ubuntu (and/or #ubuntu) for assistance on searching for and installing packages, though. I'm not familiar with that system.
[20:06:09] <rainforest> there's a package called libmongo-client-dev
[20:06:27] <rainforest> it says "Development files for the alternate C driver for MongoDB"
[20:06:27] <GothAlice> rainforest: Wait; did you "move" include and lib into /usr, overwriting the ones that were there, or merging?
[20:06:46] <rainforest> GothAlice: merging I guess since they weren't already there
[20:07:35] <GothAlice> 95% of the headers on my system are in /usr/include… and /usr/lib has 473 different libraries on my system.
[20:07:42] <GothAlice> If you didn't merge, you may have just hosed your system.
[20:08:10] <GothAlice> (Explaining the segfault.)
[20:08:22] <rainforest> im pretty sure i did
[20:08:37] <rainforest> but i also moved them to /usr/local
[20:08:50] <rainforest> it's a long story
[20:08:54] <rainforest> they're still there
[20:09:02] <GothAlice> Phew.
[20:09:44] <GothAlice> Yeah; I avoid manually throwing files into a Linux tree like the plague. The likelihood of something going horribly wrong is too darn high. (Always use your system's package manager.)
[20:10:04] <GothAlice> Also… having a way to cleanly *remove* something (or upgrade it later) is far too useful.
[20:11:04] <GothAlice> Did the segfault produce a useful traceback? (I.e. did you strip symbols from the compiled libraries?)
[20:11:32] <rainforest> no (i think)
[20:12:10] <rainforest> i installed libmongo-client-dev in hopes it would solve the seg fault, but no luck :(
[20:12:19] <GothAlice> rainforest: You'd have to recompile your applciation to use it.
[20:12:37] <rainforest> i did
[20:12:45] <GothAlice> Without a stack trace / traceback, I can't really help diagnose why it may have crashed. (A traceback would point a big finger at a particular function or set of functions that died.)
[20:13:16] <rainforest> I'm not sure how or where to find a stack trace
[20:13:27] <GothAlice> (Beyond the intial call to ::initalize() — a trace would include the functions initalize() calls.)
[20:15:53] <rainforest> hmm, i really wanted to try out mongodb, but it's turning out to a a lot more work than i expected :|
[20:16:10] <GothAlice> Your situation is quite unusual.
[20:16:36] <GothAlice> First time I've heard of segfaults in a driver like that. I'd expect there's something wonky with how you are calling it or somesuch.
[20:17:57] <GothAlice> From what I can tell, however, working with MongoDB is insanely easier under an interpreted language with rich high-level objects (like attribute access dictionaries). You'll never have to worry about manually mangling SON/BSON again. ;)
[20:18:42] <GothAlice> Also pointers.
[20:18:43] <GothAlice> ;)
[20:29:11] <GothAlice> Woot, I finally got Travis to not freak out on my capped collection tailing tests.
[20:44:07] <middi> Hello
[20:44:21] <GothAlice> middi: Howdy!
[20:45:18] <middi> I am using Mongoose, which works great, but when I want to update a document I get the following exception and I am not sure what is causing it: exception: assertion src/mongo/db/structure/btree/key.cpp:597
[20:45:30] <middi> Do you have any idea what that could be?
[20:46:01] <GothAlice> middi: What is the update you are attempting to run? Sounds like you have an invalid key in one of your mappings.
[20:46:33] <GothAlice> (mappings/dictionaries/documents/sub-documents/etc)
[20:47:46] <GothAlice> Either that or it's attempting to index something it doesn't like. Either way, I'll need to see the query pastebin'd to assist.
[20:52:28] <middi> I just have a document with basically a new version. I use an update like {key: 'foo'}, {$set: {a:1, b:2, c:2}}, well an actually even more in them, like subdocuments. I tried making sure not having the key in the update and I tried using complete replace instead of $set.
[20:52:58] <GothAlice> middi: "like" is not sufficient to diagnose this problem; I need to see the *actual* update.
[20:53:58] <middi> Invalid key as in an invalid object key? I am trying to reproduce it on my end. It seems to happen only occassionally. But that really helps, if it's that what I am looking for
[20:54:17] <GothAlice> …
[20:55:02] <GothAlice> At this point it could be pretty much anything.
[20:56:52] <middi> Okay. I was just confused as of why it only say that an assertion fails in some line and I'm trying to figure out what the assertion actually states. I can't find it in the mongodb code.
[20:57:05] <middi> On GitHub that is
[20:57:17] <GothAlice> You would need to look at the code matching the version of mongodb you are running.
[20:57:57] <GothAlice> btree/key is the clue as to what may have gone wrong. (keys as in dictionary keys or keys as in indexes; I'm just not sure which)
[20:59:02] <GothAlice> But again… if I could see the actual query you are running that is exploding, I may be of more help.
[20:59:12] <GothAlice> middi: ^
[21:00:00] <middi> Okay, thank you already a lot for your help. I have a longer running process to reproduce this and of course I thought I would have it, but made a mistake. iam sorry.
[21:52:27] <Bilge> Why doesn't mongoimport have any way to import data exported with mongoexport, which by default creates a separate directory per DB
[21:53:04] <GothAlice> Do you not mean mongodump, which outputs a directory per db?
[21:53:15] <GothAlice> mongoexport exports CSV, TSV, or JSON files.
[21:53:55] <GothAlice> (It'll output a directory per DB if you tell it to, but that isn't the default.)
[21:56:28] <Bilge> Oh
[21:56:30] <Bilge> Whoops
[21:56:42] <GothAlice> ^_^
[21:56:56] <GothAlice> No worries.
[21:57:46] <Bilge> I always get them mixed up
[21:57:54] <GothAlice> So do I. XD
[21:58:11] <GothAlice> I had to check with a --help on one of 'em to answer you. ^_^;
[21:58:29] <Bilge> No shame in that