PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Monday the 14th of December, 2015

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[01:16:35] <C0nundrum> Hello
[01:19:13] <C0nundrum> A power event occured and now there are dirty journal files. how do i recover my documents --repair fails
[02:38:52] <C0nundrum> can i do more than one expresion to a field ?
[08:29:06] <smokeysea> I am getting following error on start mogod after a fresh install /usr/bin/mongod: symbol lookup error: /usr/bin/mongod: undefined symbol: _ZN7pcrecpp2RE4InitERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPKNS_10RE_OptionsE
[08:29:16] <smokeysea> this comes on archlinux
[08:41:03] <C0nundrum> Hello
[08:41:10] <C0nundrum> how do i use a project field in a match
[08:44:47] <C0nundrum> O wow cool you can just keep adding to it
[08:45:39] <C0nundrum> How could something so good be so bad
[09:37:08] <dabomongo> hi friends , looking for a way to filter a query by time difference between a timestamp field in the documents and a given date
[09:37:32] <dabomongo> meaning "WHERE timedifference > 0"
[09:43:48] <KekSi> should be something like { "yourfield" : { $gt : new Date("2015-12-14T00:00:00.000Z") } }
[09:44:00] <KekSi> or just the timestamp if you haven't used a Date or ISODate
[10:03:12] <C0nundrum> KekSi mongodb automatically convert a array to an object if it size only 1 ?
[10:04:27] <C0nundrum> well a projection
[10:13:27] <Derick> C0nundrum: no
[10:15:33] <C0nundrum> ok i know what happend i used unwind on an array
[10:15:45] <C0nundrum> now i need to put it back together
[10:17:24] <C0nundrum> so if i use group how do i sepcift that certains fields have to be the same before it pushes it to an array
[10:18:13] <C0nundrum> so that i get it back to the state before i unwounded it
[10:37:08] <C0nundrum> or maybe i can avoid unwinding ?
[10:37:20] <C0nundrum> i'm tryign to select array.0.date
[10:37:31] <C0nundrum> well match that its greater than another date
[11:08:13] <C0nundrum> @Derick still there /
[11:10:05] <C0nundrum> i got group to work except when a array of documents is unwound and the array size is 1 at that point it just returns ok
[12:24:38] <C0nundrum> the wierdest thing is happening
[12:25:23] <C0nundrum> an array in my docuemt returns different between aggregation and find(). Does that my journal is corrupted :/
[12:28:22] <C0nundrum> nope flushed db and it still happens x.x
[12:49:44] <C0nundrum> OMG.........
[12:50:02] <C0nundrum> It was a bug in the admin UI this whole time x.x
[12:54:51] <StephenLynx> and now you know why I only use the terminal
[12:54:52] <StephenLynx> kek
[12:57:42] <C0nundrum> YES lol...
[12:58:01] <C0nundrum> or your own written ui :/ its hard to visulize data in a terminal
[12:58:24] <StephenLynx> is not
[12:58:32] <StephenLynx> use .pretty()
[13:05:27] <watmm> Hi, i've recently upgraded 2.4 to 2.8 and i'd like to try WiredTiger before going to 3.0. Is this simply a case of enablin git in the conf and restarting? Most of the docs just talk about upgrading version numbers
[13:05:40] <watmm> *enabling it
[13:24:19] <watmm> Also trying to find out if i can go from 2.6 to 3.2, or just 3.0 first
[13:28:13] <cheeser> skipping versions is usually not a good idea.
[13:35:05] <wawrek> hello, I would like to ask if there are good examples showing map-reduce in use with pymongo. I want to get an overview on how to structure code that makes imports of javascript functions (i.e. map)
[13:41:17] <C0nundrum> if i have docuemtsn that have a "tags" field which [String] what the most effcient way to get a unique array of tags ?
[13:44:32] <C0nundrum> Is there a faster way than this ? http://pastebin.com/X327eKwM
[13:45:52] <StephenLynx> $addToSet
[13:46:16] <C0nundrum> thats possible without unwinding ?
[13:46:22] <StephenLynx> works similar to $push but won't add a duplicate value.
[13:46:40] <StephenLynx> I think you can use it in a group
[13:46:54] <StephenLynx> not sure.
[13:47:08] <StephenLynx> hm, you wish to combine the arrays, is that it?
[13:47:14] <C0nundrum> yea
[13:47:32] <StephenLynx> nvm what I said then.
[13:48:21] <StephenLynx> I saw someone mentioning "distinct"
[13:48:26] <StephenLynx> it could help you
[13:55:52] <C0nundrum> hm, will check that out then
[15:36:38] <deathanchor> C0nundrum: avoid distinct and that aggregation, it's just annoying, but there is no faster way other than manage a separate dataset of "tags" somewhere else.
[15:37:17] <deathanchor> something like a separate collection of tags where you $inc : 1 each time you add it, and $inc : -1 when you remove it
[17:53:37] <StephenLynx> support for what
[17:53:41] <GothAlice> MongoDB.
[17:53:44] <StephenLynx> where
[17:53:53] <GothAlice> From 10gen/MongoDB Inc.
[17:53:56] <StephenLynx> ah
[17:54:04] <StephenLynx> you signed for their services?
[17:54:22] <GothAlice> Indirectly, aye. It's good to have an SLA in a DC just down the street. :D
[17:54:41] <StephenLynx> what are SLA and DC?
[17:54:48] <GothAlice> Service Level Agreement, and Data Center.
[17:55:09] <deathanchor> Slave Labor Agreement as I like to call it.
[17:55:30] <deathanchor> Dungeon Center
[17:55:33] <StephenLynx> have you ever needed support? I would assume you know more than the average support person :v
[17:55:42] <GothAlice> SLA means there's a contract with specific guarantees (i.e. uptime) and penalties for failing to meet those requirements. Included in the general data center SLA was 10gen support for our MongoDB nodes.
[17:56:03] <StephenLynx> ah, it includes physical stuff
[17:56:10] <GothAlice> StephenLynx: There are times, yes, where it would have been advantageous.
[17:56:45] <GothAlice> Alas, I'm moving into doing some work for Rather Large Corporations™, and they demand SLAs.
[18:50:00] <nikitosiusis> how can i preheat my collection in wiredtiger?
[18:50:16] <nikitosiusis> there is no touch there and count() or explain() doesn't make a fullscan
[19:56:53] <jbrhbr> hey. does mongo support somewhat arbitrary integrity constraints, such as enforcing a range on a value, for example?
[19:57:31] <jbrhbr> or making certain values illegal
[19:59:31] <jbrhbr> from googling, all i see that's similar to this are the unique indexes
[20:00:11] <cheeser> jbrhbr: https://docs.mongodb.org/manual/core/document-validation/
[20:00:30] <jbrhbr> thank you!
[20:01:02] <jbrhbr> wow very recent haha
[20:01:04] <jbrhbr> no wonder :)
[20:13:57] <cheeser> jbrhbr: still has that new car smell
[20:15:38] <m3t4lukas> hey guys. I have a question: Wouldn't it be nice to have a type just like ObjectID just with a few random bytes prepended for having an ID type with good variance for sharding?
[20:16:25] <m3t4lukas> I mean one random byte prepended would be more than sufficient
[20:17:03] <m3t4lukas> It would still be guaranteed to be unique since it kinda incorporates ObjectID
[20:20:38] <Derick> m3t4lukas: there is a hashed shard key for that
[20:21:28] <m3t4lukas> really? great :D I'll look for it and try it out
[20:22:22] <m3t4lukas> what BSON type is it?
[20:23:03] <Derick> none, it's something you configure when you shard
[20:23:20] <Derick> https://docs.mongodb.org/v3.0/tutorial/shard-collection-with-a-hashed-shard-key/
[20:23:24] <m3t4lukas> aaah, just found it https://docs.mongodb.org/v3.0/tutorial/shard-collection-with-a-hashed-shard-key/
[20:23:31] <m3t4lukas> thanks :)
[20:23:47] <m3t4lukas> so I don't need to change my model, that's really good news
[20:24:09] <Derick> to be honest, I would shard on something more natural if you can
[20:24:20] <Derick> you must have your own values that you could shard on
[20:24:36] <Derick> depending on how you query, that could be much better than a hashed shard key
[20:25:56] <m3t4lukas> okay, but if I query mostly for ObjectID's?
[20:27:18] <m3t4lukas> and could you please consider to put this piece of information into M102 since it would fit nicely into the "how to choose the shard key" chapter
[20:42:57] <jbrhbr> cheeser: is there a way to refer to the "self" document in these validations? i essentially want `{ validator: { field_a: { $ne: $self.field_b } } }`
[20:49:13] <cheeser> i don't think so
[20:49:33] <cheeser> i haven't dug too deeply in to that part yet but it's basically just a query
[20:49:47] <jbrhbr> yeah, i can't find anything myself
[20:50:00] <jbrhbr> some queries seem to have some degree of self-referential ability though so it's a bit confusing
[20:50:17] <jbrhbr> ex: $sizes in this doc example:
[20:50:17] <jbrhbr> https://docs.mongodb.org/v3.0/reference/operator/aggregation/unwind/#pipe._S_unwind
[20:53:11] <yopp> "Address already in use - bind - Connection refused"
[20:53:17] <yopp> What does that mean in the ruby driver?
[20:54:06] <yopp> Before it's "Adding localhost:27017 to the cluster." and then that
[20:55:02] <jbrhbr> check ps, your thing is probably already running
[20:56:19] <yopp> jbrhbr, um, that is emited by the mongo driver, not the app
[20:56:35] <jbrhbr> i chose the word "thing" intentionally
[20:56:59] <Derick> the mongo driver does not listen, and hence shouldn't bind
[20:57:12] <jbrhbr> yea that bit sounds fishy
[20:57:14] <Derick> (at least, not any driver I'm aware of)
[20:59:46] <yopp> Yeah
[20:59:55] <jbrhbr> yopp: lsof -n |grep 27017
[20:59:58] <jbrhbr> something must be there
[21:00:19] <yopp> um
[21:00:35] <yopp> question is not who is already listening on the 27017
[21:00:44] <yopp> question is why the driver even attempts to bind to that port
[21:01:03] <Derick> yopp: how do you run your script?
[21:01:03] <jbrhbr> not sure about Derick, but i'm questioning that what you say is happening is actually happening
[21:01:18] <Derick> ruby scriptname.rb ?
[21:01:35] <jbrhbr> that is the mongo port so most likely there's some sort of output misinterpretation and the driver is not trying to bind to that port at all
[21:01:49] <Derick> jbrhbr: I don't speculate on that, I would strace it.
[21:02:06] <yopp> Derick, this is rails app with mongoid. This one is randomly happening on CI
[21:02:28] <Derick> you can't reproduce it in a simple - run one command - way?
[21:02:42] <yopp> rake spec :B
[21:02:50] <jbrhbr> :p
[21:02:53] <Derick> i don't know what those words mean
[21:03:05] <cheeser> rake is a ruby build tool
[21:03:05] <jbrhbr> it invokes more magic than disneyland
[21:03:11] <cheeser> ruby make
[21:03:18] <Derick> cheeser: yeah, I did know that :P - Just not what to do with it
[21:03:37] <yopp> Derick, any attempt to establish the connection using ruby driver ends with this
[21:03:47] <yopp> simple model access, for example.
[21:03:54] <yopp> (access == query)
[21:04:24] <Derick> yopp: so, on CI, would you be able to do something akin to "strace -o /tmp/strace.log ruby script.rb && cat /tmp/strace.log" ?
[21:05:59] <jbrhbr> might need an option to follow forks since ruby is probably some sort of rbenv version delegator
[21:06:32] <yopp> jbrhbr, nope, it's just plain jruby, without version management
[21:06:38] <jbrhbr> cool
[21:06:45] <jbrhbr> any bind call in that strace output then?
[21:06:47] <yopp> I'm not sure about strace on the build agents
[21:06:50] <Derick> (otherwise, add "-f")
[21:06:53] <yopp> but lemme check
[21:07:33] <jbrhbr> gotta eat, i'd love to hear the result of this mystery if you guys are around when i get back!
[21:32:03] <yopp> Derick, no strace
[21:32:18] <Derick> install it? :D
[21:32:58] <yopp> I've tried, but strace can't work in unpriveleged docker containers :|
[21:34:35] <Derick> ah, yeah - needs root to be really useful
[21:35:01] <yopp> Anything else?
[21:35:17] <yopp> I've updated app to the latest mongoid (and ruby driver)
[21:35:54] <Derick> ... debugging you do with tools, not by guessing :-/
[21:40:00] <yopp> Derick, any other tools? :)
[21:41:25] <yopp> I'm a bit confused, there no strings in the ruby driver, matching this one
[21:41:42] <yopp> https://github.com/mongodb/mongo-ruby-driver/search?p=2&q=%22to+the+cluster%22&type=Code&utf8=✓
[21:42:12] <StephenLynx> it might be returning the error from the server
[21:42:24] <yopp> huuuuum
[21:42:41] <yopp> and mongo binds to the localhost by default?
[21:43:03] <yopp> or to 0.0.0.0?
[21:44:05] <StephenLynx> 127.0.0.1
[21:47:51] <yopp> oookay
[21:49:55] <m3t4lukas> I have a bug in the newest morphia 1.0.1. Executing BasicDAO.findOne drops the found document
[21:51:57] <cheeser> i doubt that. can you post a test to a pastebin?
[21:52:13] <m3t4lukas> the code worked fine yesterday. Nothing changed except that I reloaded the gradle project.
[21:52:26] <cheeser> you're seeing documents get dropped from the database?
[21:52:40] <cheeser> so you didn't change morphia versions and suddenly things break?
[21:53:57] <m3t4lukas> cheeser: yep, they get dropped. there is no change in git for this code for like two weeks (it's in the authentication routine, so it is used every day several times), the gradle file also did not change and I fixed morphia to version 1.0.1
[21:54:37] <m3t4lukas> I will try versions 1.1.0-alpha and 1.0.0 now
[21:55:19] <m3t4lukas> if they don't work I will post a test tomorrow, It's almost 11pm here
[21:57:57] <m3t4lukas> cheeser: this code is executed when the account is dropped that authenticates: http://pastebin.com/rUWCuAkS
[21:58:03] <m3t4lukas> it's rather short
[21:58:27] <m3t4lukas> accountDAO is just a simple derived class from BasicDAO, nothing fancy
[21:58:51] <cheeser> so it worked yesterday but not today?
[21:59:11] <m3t4lukas> yep
[21:59:39] <m3t4lukas> it even worked two hours earlier this day
[21:59:45] <cheeser> it's not morphia then
[21:59:54] <m3t4lukas> just I after refreshed dependencies in gradle it stopped working
[21:59:56] <cheeser> something in your test setup perhaps.
[22:00:07] <cheeser> findOne() just does a find().get()
[22:00:16] <cheeser> there's nothing there that would lead to a delete
[22:00:29] <m3t4lukas> meeeh, I hate such errors
[22:00:48] <m3t4lukas> I will run it through profilers and debuggers tomorrow
[22:01:09] <m3t4lukas> and I will write a small test
[22:02:25] <m3t4lukas> code from commits a week ago does not work any longer, either... Thing is the setup did not change. It is as simple as a wildfly application server and a mongodb server
[22:05:50] <cheeser> i'd be really surprised if morphia was at fault.
[22:06:33] <darkPassenger> hi all
[22:07:01] <darkPassenger> Im new to sharding, do I need to modify my code in order to shard as replica set over a network of nodes ?
[22:07:15] <darkPassenger> or is it only at mongo level that sharding occurs
[22:10:28] <cheeser> your app won't know the difference
[22:11:04] <m3t4lukas> cheeser: it is only sporadically. Approximately 1 time out of 2 times. But as I said, I will debug this stuff tomorrow. My eyes hurt.
[22:13:03] <darkPassenger> cheeser: thanks
[22:13:12] <darkPassenger> so its mostly a config challenge
[22:13:16] <darkPassenger> if a challenge at all
[22:16:33] <m3t4lukas> naaaah, f**k I found the code that causes the problems...
[22:16:46] <m3t4lukas> but it is also code that should not delete anything
[22:17:49] <m3t4lukas> cheeser: it is the code that is commented out http://pastebin.com/wVy6dRXu
[22:18:12] <m3t4lukas> it is an aggregation
[22:18:54] <m3t4lukas> now with this piece commented out everything works as expected
[22:22:22] <cheeser> m3t4lukas: haha. yeah. you're using $out to write to the collection mapped on Account
[22:22:33] <cheeser> $out will wipe out any existing data
[22:22:41] <m3t4lukas> ooh...
[22:22:42] <cheeser> there isn't an update option for $out
[22:23:17] <m3t4lukas> time to go to bed :D
[22:27:09] <m3t4lukas> bye
[22:27:19] <cheeser> g'night
[22:30:36] <yopp> oh my
[22:32:49] <jbrhbr> yopp: figured it out?
[22:33:03] <yopp> yeah
[22:33:22] <jbrhbr> what's the scoop?
[22:35:02] <yopp> localhost:27017 sneaked in da driver config
[22:35:51] <yopp> instead of the mongodb host
[22:36:17] <yopp> I have no idea why it fails with "bind" errors, instead of simple conn refused
[22:36:20] <jbrhbr> woops. what does the driver need to bind for?
[22:36:25] <yopp> no idea
[22:36:56] <yopp> I've dropped an issue in our tracker to drop an issue to the mongo tracker.
[22:37:12] <yopp> I think I can make a repro docker-compose
[22:47:38] <jbrhbr> i grepped a bit and couldn't find it mongo-2-.1.2 but maybe it's in some other gem or version of this one
[22:57:13] <yopp> jbrhbr, you mean "bind" thing?
[22:58:21] <jbrhbr> yeah