/srv/irclogs.ubuntu.com/2014/06/17/#juju-dev.txt

jcw4davecheney: I just understood your comment... derp :)  I was thinking about ParseActionTag being a way to extract unit and/or service name from the action name00:01
jcw4I think for now tag, ok:= tag.(ActionTag); ok {} should work00:01
davecheneyjcw4: and that is only needed if00:17
davecheneya. you want to ensure the string you passed to ParseTag was actually an action tag00:17
davecheneyb. you care about any specific fields on ActionTag, rather than just the Tag interface00:17
menn0Phew! Review please: https://github.com/juju/juju/pull/10901:05
waiganithumper, menn0: State.User.DateCreated() and State.User.LastConnection() were returning timestamps in local rather than UTC timezones. I've added .UTC() to ensure UTC timezones: https://github.com/juju/juju/pull/9101:05
waiganimenn0: i.e. timezone bug solved!01:07
menn0waigani: is it worth figuring out why local timestamps were being returned and fixing that? According to the doc string for DateCreated() we expect a UTC timestamp to come out.01:07
menn0and thumper expected that too01:07
waiganimenn0: timezone bug not solved!01:08
waiganimenn0: It's set to UTC on AddUser and also on UpdateLastConnection. You said the user docs were the same. So it must be converted to local time on read.01:11
menn0waigani: yes it is converted to local time on read - that's the problem. That means our expectations aren't correct (see the doc string for DateCreated)01:12
menn0waigani: it could be that mgo is doing the conversion, or mongo itself01:13
thumperI'd suggest updating the user methods to do a UTC01:13
thumpershould be a no-op if already in UTC01:13
thumperhowever, that doesn't explain the factory tests passing01:14
thumperwhy is that different?01:14
menn0thumper: I just figured that out. They're not running!01:19
thumperwah...?01:19
menn0missing this: var _ = gc.Suite(&factorySuite{})01:19
thumperoh ffs01:19
menn0I've added that and they fail01:19
thumper:-(01:19
thumperbut \o/01:19
thumperthat explains it01:19
thumpermenn0: did you want to propose a branch that just fixes that?01:20
thumperif you don't01:20
thumperI will01:20
menn0thumper: will do. I literally just discovered this.01:20
waiganiah01:21
menn0so what do we want to do about the failures01:21
menn0thumper: ?01:21
thumpermenn0: how about I fix it?01:21
menn0the tear down fails too: Error: Test left sockets in a dirty state01:21
thumperI know what I want to do01:21
* thumper takes it01:22
menn0thumper: no problems01:22
menn0thumper: are you going to get mgo/mongo to give us UTC timestamps back too?01:22
thumpermenn0: I'll make the tests pass :-)01:23
waiganithumper: I've added .UTC() to user methods01:23
menn0thumper: I guess that will do01:23
thumperwaigani: yeah, saw that, I may do that in my branch to make sure it works01:23
thumperack01:23
waiganithumper: so should I land my branch now or wait for yours?01:24
thumperwait please01:24
thumperwon't be long01:24
waiganiok01:24
thumperwow the tests take a while to run now...01:34
thumperFAILgithub.com/juju/juju/replicaset455.322s01:36
thumperok git folks, I've accidentally committed to the local master01:43
thumperhow to I get my master back following upstream master?01:43
thumpermenn0, waigani: https://github.com/juju/juju/pull/11001:46
thumperaxw: ta01:47
axwnps01:47
axwthumper: if you accidentally committed to master, you can "git reset HEAD^". you probably want to stash the working tree first01:51
thumperaxw: I already branched from it and pushed, hence pull 11001:52
thumpernope, already done01:52
thumperwhat I want is uncommit01:52
waiganigit reset --hard HEAD^01:52
axwthumper: yes, that is equivalent to uncommit01:52
thumperHEAD^ whazzat?01:52
axwHEAD-1 I think?01:53
* thumper missed the caret01:53
thumperthat worked01:53
thumperta01:53
davecheneystate/state.go:18902:01
davecheneyI think we are leaking mongo iterators02:01
davecheneyvar tagPrefix = map[byte]string{ 'm': names.MachineTagKind + "-", 's': names.ServiceTagKind + "-", 'u': names.UnitTagKind + "-", 'e': names.EnvironTagKind + "-", 'r': names.RelationTagKind + "-", 'n': names.NetworkTagKind + "-",02:05
davecheney}OMG, i just found a private encoding of tags in the state package ...!!!02:05
waiganihaha, good to see your hard work being appreciated02:12
menn0thumper, axw: "git help revisions" talks about all the ways to refer to revisions with git. It's useful and complete but dense. This page is a bit gentler: http://git-scm.com/book/en/Git-Tools-Revision-Selection02:22
axwthanks menn002:24
thumpermenn0: please don't add "er" on to the method name for the interface name02:26
thumperthat will make me want to kill you02:26
thumperespecially if it is a nonsense name02:26
thumperString, Stringer is kinda ok02:26
thumperRead, Reader is ok02:26
thumperStatus, Statuser is not02:26
* thumper has an OCD meltdown02:27
menn0davecheney: it looks like that tag mapping is only used in one place as well02:29
menn0thumper: we have plenty of other interfaces that use a similar naming style (there's even a setStatuser, so ha!). I used that and other code and articles I've seen online as a guide as I figured that was the idomatic Go thing to do.02:30
* thumper twitches02:31
davecheneythumper: there is a reason why the thing that runs Hooks is called a Uniter02:31
thumperhaha02:31
davecheneyyou can ask fwereade about that02:32
thumperand not a HookRunner?02:32
menn0I can call it StatusAPI or something if that makes the twitching stop02:32
thumperbecause, OMG that might tell you what it is doing02:32
thumperthere are still those that titter when I explain to them that a hooker is a valid rugby position02:34
menn0is that the player who hangs around the dark corner of the field not wearing very much?02:36
* menn0 disappears to change the interface name...02:37
waiganimenn0: ugh, sorry about the statuser - stupid02:45
menn0waigani: np. given that it confused you and thumper hates it, I'll change the name.02:45
davecheney... what does a Thumper do ?02:46
thumperThumps02:46
thumper:-)02:46
menn0http://en.wikipedia.org/wiki/Sun_Fire_X4500 ?02:46
menn0;->02:47
davecheneycoll, id, err := state.ParseTag(s.State, m.Tag())02:47
davecheneywhy does state have it's own ParseTag method ...02:48
davecheney        m, err := s.State.AddMachine("quantal", state.JobHostUnits)02:49
davecheney        c.Assert(err, gc.IsNil)02:49
davecheney        coll, id, err := state.ParseTag(s.State, m.Tag().String())02:49
davecheneywe have a machine, we get it's tag, then we parse it's tag02:49
davecheneyand then I (╯°□°)╯︵ ┻━┻)02:50
axwwallyworld: https://github.com/juju/juju/pull/112 when you're free03:04
wallyworldsure03:04
wallyworldaxw: just reading the desc, can we retry bootstrap for the user?03:05
axwwallyworld: I think it's actually quite rare to occur, so I'd rather not complicate it03:07
axwwallyworld: I've never seen it delete after afterwards03:07
wallyworldok03:07
axwit just sits there03:07
menn0thumper, waigani: interface name changed03:14
thumper:)03:14
waiganithumper: you've got a test failure03:16
thumperwaigani: ta03:17
waiganithumper: you need to replace DateCreated:    time.Time{}, with user.DateCreated()03:22
waiganithumper: I've done that in my branch, ironically if I landed my branch first, yours would pass03:22
waiganithumper: state/apiserver/usermanager/usermanager_test.go:18903:23
* thumper nods03:23
thumperlooking at it03:23
thumperwaigani: that isn't it though :)03:24
waiganioh?03:24
thumperit is the zero value from last connection has a TZ of UTC03:24
thumpernow that we specify that...03:24
* thumper hacks03:24
waiganithumper: all tests pass on my branch. DateCreated and LastConnection are just set from the corresponding user methods - as long as they return UTC03:26
thumperyou'll see03:26
waiganithumper: what happens when you UTC a zero time?03:50
thumperyou get something that is no longer zero03:51
menn0waigani, thumper: I think the setting-UTC-on-a-zero-time thing is part of what was confusing us (well at least me) this morning. A Time{} and Time{} with UTC set both convert to the same string when printed but are actually different.04:16
* thumper nods04:17
waiganithumper: menn0: and the difference seems to be only the location04:17
menn0thumper, waigani: here's a good example of the problem: http://play.golang.org/p/zYoOyRiUsm04:19
menn00001-01-01 00:00:00 +0000 UTC04:19
menn00001-01-01 00:00:00 +0000 UTC04:19
menn0false04:19
menn0that's pretty sucky. if "no location" is supposed to get interpreted as UTC (which the string representation seems to indicate) then they should compare equal.04:21
davecheneyhttp://golang.org/pkg/time/#Time.Equal04:21
davecheneyread the comment04:21
menn0davecheney: I was just looking to see if there was such a thing04:21
menn0davecheney: thanks. that's good to know about.04:22
menn0davecheney: it is a bit tricker for some of the cases were were dealing with today where there were Times stored in structs that were being compared.04:23
waiganimenn0: just ran your example through jc:04:23
waiganimismatch at (*.loc): validity mismatch; obtained <nil>; expected time.Location{name:"UTC", zone:[]time.zone(nil), tx:[]time.zoneTrans(nil), cacheStart:0, cacheEnd:0, cacheZone:(*time.zone)(nil)}04:23
davecheneymenn0: store them as uint64s04:23
menn0waigani: jc?04:24
waiganimenn0: jc "github.com/juju/testing/checkers"04:24
menn0davecheney: nah. I like the richer type. it's just one of those things you need to be aware of.04:24
menn0waigani: jc.DeepEquals?04:25
waiganimenn0: sorry, yeah that is what I mean04:25
waiganiit shows you the problem04:25
menn0waigani: that's also very useful to know. The error message from gc.DeepEquals was completely misleading.04:26
menn0hooray for learning lots of new stuff today :)04:26
waiganimenn0: yeah thumper has been trying to thump it into me to use jc instead of gc04:26
waiganiso converting to UTC changes .loc from nil to time.Location{....04:28
menn0waigani: yep. Here's that earlier example using %Q, which shows the difference: http://play.golang.org/p/5yjGGgGjTr04:29
* menn0 gets back to more pressing matters04:30
* davecheney can't believe nobody pulled me up for this04:40
davecheneyhttp://godoc.org/github.com/juju/names#Tag04:40
waiganimenn0: thumper's fix breaks the tests - the rabbit hole deepens05:22
menn0waigani: what's the failure?05:23
waiganimenn0: If you pull trunk and update the UserInfo tests to compare user.DateCreated(), user.LastConnection() instead of time.Time{} you'll see it is the same error05:23
waiganimenn0: i.e. the user factory returns .loc = nil, while the api returns .loc = time.Location{...05:24
menn0waigani: I can't look right now, deep in schema upgrade stuff and about to finish up anyway05:25
waiganimenn0: removing thumpers fix, and always returning UTC, even on zero time, makes all the tests pass05:25
waiganimenn0: I don't need you to, just sharing as you are interested in the problem05:25
menn0waigani: I am interested. I'll have a look tomorrow if you don't figure it out first. It'll be a matter of stepping through all the pieces.05:26
waiganimenn0: have a good evening :)05:26
menn0you too05:26
wallyworldaxw: jeez, your ahving no luck with the merging07:04
wallyworldyou're07:04
axwwallyworld: yeah it's giving me the shits07:09
wallyworldaxw: i'm off to soccer but will talk to martin when i get back and see if he can fix it07:10
axwwallyworld: thanks. have fun07:10
wallyworldwill do07:10
wallyworldaxw: incidentally, i just re-ran the azure upgrade test and it passed. i had a theory that your azure fix would help as the run was previously failing to bootstrap, maybe due to old resources hanging around07:11
wallyworldso i'll let curtis know and hopefully it will continue to be well behaved07:12
axwwallyworld: sweet07:12
voidspacemorning all07:33
TheMuemorning07:34
=== psivaa-afk is now known as psivaa
TheMueanyone available for reviewing https://github.com/juju/juju/pull/107 ? it’s a very small one, only added a test08:23
jamTheMue: I just reviewed: https://github.com/juju/juju/pull/10708:56
jamperrito666: what is the status of https://github.com/juju/juju/pull/30, there seem to be a ton of comments on it, and I'm not really sure what has and hasn't been addressed. Can you give a quick summary?08:57
TheMuejam: thx09:00
jamwallyworld: I realize we've been doing release-y stuff, which is great. But have you looked at alternative code review yet?09:02
TheMuejam: I thought I read that I first have to Start() before Serve(). It seems I got it wrong. Will change.09:03
jamTheMue: well if docs say that, they are probably wrong, and we should fix those while we're here.09:04
jamcertainly if you had to have a "channel' in order to use a website, it would just be broken, right?09:04
TheMuejam: exactly09:05
TheMuejam: costed me some time to get why I have a race condition every 10th to 20th run :/09:05
jamfwereade: dimitern: any chance I can ask you guys to have a look at my API Versioning proposals? They've been sitting for 2 days, and apparently they scare the on-call reviewers… :)09:07
jamhttps://github.com/jameinel/juju/pull/1 https://github.com/jameinel/juju/pull/2 https://github.com/jameinel/juju/pull/309:07
jamare the incremental diffs09:07
dimiternjam, really sorry I couldn't get to them yesterday, I'll have a look quickly, but I'll do a more thorough review after the standup (after I finish the doc finally)09:09
jamdimitern: it can wait until you can focus on it, I guess.09:10
jamI'm the OCR today, so I can't just poke myself to go review it. :)09:10
dimitern:) indeed09:11
TheMuejam: ah, found it, wrong understanding. not „it has to“ but „it may be“. so it’s only said that one can call Serve() later, e.g. to register another root09:14
jamTheMue: right. We do use that to switch from the "Admin" root that only exposes Login to the functional root that lets you do all the actual work.09:15
TheMuejam: will keep it in mind for the docs ;)09:16
jamthx09:16
tasdomasaxw, I think I don't have the permissions to merge pull requests into github.com/juju/juju09:19
jamtasdomas: you probably need to set your membership in the juju group to public09:19
jamtasdomas: go here https://github.com/orgs/juju/members?page=209:19
jamand you can fix it09:19
jamthe bot needs to know that you're in the "allowed" group09:19
tasdomasjam, thanks - this takes time to apply, right?09:23
jamtasdomas: well, it takes a while before the bot polls again, but I don't think you have to vote again.09:24
jam*I* see you as public now09:24
jamso the bot should be happy09:24
perrito666jam1: I think it can be merged, I was waiting on fwereade to ack that the last note I added actually clarifies what he wanted it to say about creating new workers, but that should not be a showstopper09:27
perrito666jam1: that is abot PR:3009:29
voidspaceperrito666: morning09:32
perrito666voidspace: morning09:33
jamtasdomas: "merge request accepted" was just posted by the bot09:35
jamso it looks like your perms are sorted out.09:35
tasdomasjam, thanks!09:35
jamit will take… 15min + for the bot to actually process it.09:35
jamtasdomas: it is running it now: http://juju-ci.vapour.ws:8080/job/github-merge-juju/179/09:35
jamericsnow: I just commented on https://github.com/juju/juju/pull/9709:39
jamfeel free to ask any questions if you want clarification.09:39
jamoverall a pretty good first submission IMO09:39
voidspacejam: did you see the question of mine late last night?09:45
voidspacejam: I don't suppose you had any thoughts?09:45
jamvoidspace:09:45
voidspacejam: about changing values in the EnvironConfig of the server side of a JujuConnSuite09:45
jamI remember reading that you had a test problem, and I think I started investigating, but then had a phone call and completely forgot the context09:46
voidspaceI'm about to start poking at it again09:46
voidspaceheh09:46
voidspaceI had to go anyway09:46
voidspacejam: let me grab the link to the code09:46
voidspaceif you're ok to have a look now that is09:46
voidspace<voidspace> it's (indirectly) a JujuConnSuite test with an apiserver and api client09:47
voidspace<voidspace> I'm testing an api endpoint (so apiserver) that needs to use the mongo port and mongo administrator password09:47
voidspace<voidspace> I'm pretty sure I can get these by calling state.State.EnvironConfig() and then calling AdminSecret and StatePort09:47
voidspace<voidspace> so what I want is a test that checks those values are used09:47
voidspace<voidspace> I can't find a way to set those values (from the test) in the environ config used by the test suite09:47
voidspace<voidspace> setting them in DummyConfig doesn't work09:47
voidspace<voidspace> calling BackingState.UpdateEnvironConfig doesn't work09:47
voidspace<voidspace> calling BackingState.SetAdminMongoPassword and State.SetAdminMongoPassword doesn't work09:47
voidspace* arturt has quit (Quit: Computer has gone to sleep.)09:47
voidspace<voidspace> any ideas?09:47
voidspace<voidspace> jam1: the test specifically is here: https://github.com/voidspace/juju/compare/download-backup#diff-198897e828f0611e3185053d7354a523R9609:47
jamvoidspace: just for context, this is the backup code, right?09:47
voidspacethat's correct09:47
voidspacethis is the api endpoint09:47
voidspaceit needs the mongo port and mongo admin password to call the code doing the actual backup09:48
jamvoidspace: we should also make sure that you guys are talking with menn0 et al because their looking to use the backup code with their upgrade rollback stuff.09:48
voidspaceah, right09:48
voidspacewe haven't talked at all yet09:48
jamvoidspace: and one thing that popped out is that they want to give the backup to the client, but they also really would like to keep a copy on the server09:48
voidspacethe backup code is now in09:48
jamso the client doesn't have to get involved if upgrade fails09:48
voidspaceright09:49
voidspacethat's easy for them to implement on top of what perrito666 did09:49
voidspacewhen you call Backup you give it a directory to put the backup file in09:49
voidspacein my code I send that to the client and then delete the backup file09:49
voidspacethey wouldn't need to reuse my code at all09:50
jamvoidspace:  for "c.Assert(os.IsNotExist(err), jc.IsTrue)09:50
jam"09:50
jamyou can use"09:50
jamc.Assert(err, jc.Satisfies, os.IsNotExist009:51
jamsorry09:51
voidspaceright, I saw examples of that09:51
voidspacebut I saw no benefit09:51
jamno "(" in the end of that line09:51
jamvoidspace: when it doesn't match09:51
jamyou get output on the console09:51
jamwhich describes "err"09:51
jamrather than output09:51
jamthat describes" false"09:51
voidspaceok09:51
jamvoidspace: so when the assert fails, you get better debugging information.09:51
voidspacealthough *specifically* what I'm interested in is "does the directory still exist"09:52
voidspaceso it's kind of a true / false situation09:52
jamalso, you should try to use "Check" rather than "Assert" whenever you can reasonably continue to check more things.09:52
voidspacealthough if there's another error it would be useful to know what it is I guess09:52
voidspacejam: c.Check ?09:52
voidspacethat's helpful09:52
jamvoidspace: so yes, what you care about is that you get IsNotExist, but if the test *fails* I'd rather know that it got ErrNOTDIR or EINVALID or ESOMETHING ELSE09:52
voidspaceyep, fair enough. Thanks.09:53
jamvoidspace: because the first thing that you're going to do if that assert fails is go in and change the line to something else so that you get that context :)09:53
wallyworldjam: it's one of mgz's top priorities09:53
jamvoidspace: c.Check vs c.Assert is something that we're not particularly consistent with, but just a guideline to keep in mind.09:53
jamI try to use Assert for things that would cause a panic09:54
jamlater if not Asserted09:54
jamand then Check for everything else.09:54
wallyworldbut the intermittent github merge rejections (after tests have passed) are becoming too annoying to ignore09:54
voidspaceyeah, that's better - I keep commenting out asserts to see if a later one passes09:54
jamvoidspace: anyway back to your original question. The idea is "I need to inject my test values and assert that I see them passed correctly to my apiserver.Backup function" correct?09:54
voidspaceI just haven't used Check before09:54
voidspacejam: yep09:54
voidspacejam: JujuConnSuite has a BackingState which is allegedy the State used by the apiserver in the test09:55
voidspacejam: so that is where I should be setting the test values09:55
voidspacejam: however I have so far failed to influence what EnvironConfig returns09:55
perrito666axw: you just made me realize that the hook is not working for me (i have it set)09:56
axwperrito666: what's your git version?09:56
axwperrito666: it's just called "pre-push" in .git/hooks?09:57
perrito666axw: 1.9.1 I most likely did something wrong when setting it up09:58
axwperrito666: in .git/hooks, you should have "pre-push -> ../../scripts/pre-push.bash"09:58
perrito666axw: I had done the simlink wrongly10:01
perrito666I had pre-push.bash10:01
perrito666instead of pre-push10:01
voidspaceso I get errors from pre-push now10:06
voidspacebecause of perrito666's code!10:06
voidspace:-)10:06
perrito666voidspace: its fixed by axw merge again10:07
perrito666:p10:07
voidspacehehe10:07
voidspaceI'd better pull then10:07
natefinchjam: you around?  We should talk multi-env state servers.  I'm unfortunately going to have to be out for much of the morning due to a rescheduled doctor's appointment10:07
voidspacenatefinch: morning10:08
natefinchvoidspace: morning10:08
jamvoidspace: tbh, both BackingState and State should be touching the same DB.10:13
voidspacejam: right10:13
jamYou should only need BackingState for things that are already cached in memory, like workers and watchers sort of things.10:14
jamnatefinch: I'm around, and can chat a bit. I have team standup in 30min.10:14
voidspacejam: however, calling UpdateEnvironConfig doesn't seem to change the values it returns10:14
natefinchYep ok10:14
jamThough I have more evening time than normal because my family is out of town10:14
natefinchjam: well, I'll probably be available around 8:30pm your time...  if you're on, we can talk.10:15
natefinchbut yes, some time now would be good10:15
voidspacebrb10:15
jamnatefinch: start up a g+ and invite me, I'll come in, I'm trying to help out voidspace a bit right now., but maybe I can do both10:16
jamnatefinch: if you want, we can just use our team standup one, since I'm sure we'll be talking right up until standup: https://plus.google.com/hangouts/_/canonical.com/juju-sapphire10:17
voidspacejam: these are the things I've tried specifically: http://pastebin.ubuntu.com/7657695/10:17
natefinchjam: that makes sense10:17
jamvoidspace: you probably should be checking the error returned from UpdateEnvironConfig10:18
jamit might tell you there is a bug in what you're asking.10:18
voidspacejam: ok, good point10:18
voidspacethanks10:18
jamvoidspace: for example, I think StatePort is immutable once set10:18
jamvoidspace: so you're probably better off just looking internally for what the current value is, and then asserting that you see it in the test.10:19
jamrather than trying to change it.10:19
voidspaceok10:19
voidspacethat would be fine10:19
voidspaceas the admin password is set to an empty string I would really rather change that10:20
voidspaceas an empty string could come from anywhere10:20
voidspacejam: your suspicion was correct10:20
voidspacewell, sort of10:20
voidspace... value *errors.errorString = &errors.errorString{s:"admin-secret should never be written to the state"} ("admin-secret should never be written to the state")10:20
voidspacesetting the admin-secret in the EnvironConfig fails10:20
voidspacesetting the mongo admin password directly doesn't change the one stored in EnvironConfig either10:21
voidspacewhich maybe means it's the wrong place to get it from10:21
jamfwereade: is there a template for us to use for writing up multi environment state server spec ?10:21
voidspacejam: and yes, the state-port is immutable too10:21
voidspaceI can get that by introspecting the EnvironConfig though10:21
jamwell, you could introspect both of those, right?10:22
voidspacejam: the admin secret in EnvironConfig is an empty string10:22
voidspaceand that could come from anywhere, so I don't think it's a good test10:22
jamvoidspace: admin secret is the password for the "user-admin" I think, and not intended as the password you use for the DB10:23
jamyou need machine-0's (machine-1, etc) mongo password10:23
voidspace*plus*, calling state.SetAdminMongoPassword("something") doesn't change what is returned by EnvironConfig.AdminSecret()10:23
jamvoidspace: right, but you shouldn't be using it anyway10:23
jamsorry, I'm still paging in some context of how all this works.10:23
voidspaceok, perrito666 told me that I *should* be using the admin password10:23
jamwe probably don't use admin secret anymore.10:23
jamadmin secret is the password for "user-admin" and we actually don't give them direct DB rights anymore (IIRC)10:24
jamso you need to be using the machine password for the API server.10:24
voidspacehmm... the parameter to backup.Backup is specifically called adminPassword10:24
voidspaceperrito666: will the state server machine password do?10:25
voidspacejam: how do I get the machine password? (I haven't looked for that, so maybe it's easy)10:25
perrito666voidspace: well, according to what jam says, it should10:25
voidspaceit sounds like AdminSecret is definitely wrong though10:25
voidspaceperrito666: heh, ok10:26
voidspacethe state server has write permissions to the database (obviously), so I would expect so10:26
jamvoidspace: perrito666: Have to do this call now, so I'll try to get back after our standup is done10:26
voidspacejam: thanks very much10:26
jamvoidspace: so machines know their password by reading their agent.conf10:27
jampresumably that is also stored in the DB because of the API validating their password.10:27
voidspaceAgentContext is how perrito666 suggested I get it, but that means finding the location of the conf file10:28
voidspaceso I wanted to see if there was an easier path first10:28
voidspaceI don't *think* it's stored in the state though, I did have a bit of a spelunk10:29
voidspaceI may have missed it10:29
perrito666voidspace: the easy way is to try to run the dump with a different password (and perhaps you will have to change the user too10:29
voidspaceperrito666: you mean try it manually with a running mongo?10:30
voidspacesounds like a good check10:30
perrito666voidspace: yup, current backup uses admin/oldPassword10:33
wallyworldmgz: i'd like a quick hangout if you are free10:53
mgzwallyworld: sure10:57
wallyworldmgz: https://plus.google.com/hangouts/_/gruuhdkj3yzsvab42gsqrpr5i4a10:57
natefinchperrito666: are you working on the HA backup thing?10:57
mgzgurk, can we use the standup one?10:57
perrito666natefinch: yup, I am reading the prs merged around the breakage10:57
natefinchperrito666: good, thanks.10:58
jamnatefinch: if you want to join again, our standup is done11:08
jamvoidspace: perrito666: thinking about it, I think we actually only store the *hash* of the API Password in the database. And the Agent logs in by supplying the real text, and we then hash it and make sure it matches our saved hash.11:09
jamSo we probably don't actually store the actual password anywhere but in the agent files.11:09
jamhowever, this is going to be run as the current agent user, right?11:09
jamso it should have some idea of what its current password is.11:10
jamthough it is possible that it loads that information, connects, and then immediately forgets about it for the rest of its process.11:10
jamwhich is a bit of a shame.11:10
voidspaceI couldn't see how to get the AgentContext from the apiserver without reloading it11:10
voidspace(and yes, I saw various references to the password hash - but not to the password itself)11:11
voidspaceso it looks like I have to re-read it11:11
voidspacethe conf file is in a subdirectory of DataDir, the sub-directory is easy because that's the machine Tag11:11
voidspacejam: do you know how I find the DataDir for the conf file?11:12
natefinchjam: ok11:12
jamvoidspace: I think the cmd/juju/machineAgent has that information11:12
voidspacejam: thanks, will look11:12
voidspaceLondon to Boston flights in July are really expensive11:22
voidspacecheapest is £900 return - and the travel provider always seems to cost more11:22
mgzeech11:23
voidspaceyeah, direct is £1500!11:24
voidspaceso looks like I'll be stopping :-/11:24
perrito666voidspace: lucky you there is no direct from here11:25
voidspaceheh, yeah very lucky. A direct option I can't take... :-)11:26
mgzhm, looks okay via AMS11:27
mgzlucky me11:27
perrito666The shortest flight I see, which has 1 scale costs 3kUSD11:27
voidspacemgz: AMS?11:27
voidspaceperrito666: 1 scale?11:27
mgzvoidspace: my local airport is Norwich INTERNATIONAL... because it has a hop to schiphol11:28
perrito666so I do my city > brazil, brazil > somewhere in US, somewhere > boston11:28
voidspaceperrito666: :-(11:29
voidspacehopefully I'll have only one stop11:29
perrito666I hope brazil airport is nice, I have 13h there11:30
perrito666:p11:30
jammgz: the same is true for my "International" airport in Cedar Rapids, and apparently true for the Nuremberg International airport. I haven't been able to book travel from DXB all the way to Nur, but apparently I can get to Schiphol and then take a direct flight from there.11:49
mgzit's actually pretty handy, as an alternative to train down to heathrow11:51
TheMueI always have to hop, via FRA, MUC or AMS11:54
TheMueBRE next too me is too small, only CPH worked directly11:55
voidspacejeebers, so many levels of indirection12:17
voidspaceBootstrapCommand calls InitializeState which calls initUsersAndBootstrapMachine which calls initBootstrapMachine12:22
voidspacethis creates a new mongo password, storing only the hash in the state12:22
voidspaceit does however call ConfigSetter.SetPassword - the ConfigSetter instance being a configInternal12:23
voidspacethe implementation of SetPassword stores the new password on c.stateDetails.password (or c.apiDetails.password)12:24
wwitzel3thanks jam, I do that a lot with mailing lists12:24
voidspaceso I need to work out how to get that config and then get the password from it12:25
jamwwitzel3: it doesn't help that google's default is just reply, though you can edit your settings to make the default reply all.12:25
jamFor tbird, I think it is a different shortcut, but still I just learned to use that one for most replies.12:25
jamwwitzel3: I *think* I touched all the non-WIP reviews except the massive cloudsigma one.12:26
perrito666there was a lab to make reply to all the default12:26
perrito666very useful I must say12:26
voidspaceI don't see the new password being written out, which would be odd as the state machine rebooting would no longer be able to access the db12:26
voidspaceso that can't be right12:26
voidspacethe DataDir is just a constant set in environs/cloudinit.go - so I'll see if just reading the config back in works12:27
perrito666:|12:54
perrito666ERROR juju.provider.common bootstrap.go:119 bootstrap failed: cannot start bootstrap instance: cannot run instances: Your requested instance type (m3.medium) is not supported in your requested Availability Zone (us-east-1a). Please retry your request by not specifying an Availability Zone or choosing us-east-1d, us-east-1e, us-east-1c. (Unsupported)12:54
perrito666anyone knows how to go around that?12:55
fwereadeperrito666, I think axw is working on that -- you should be able to bootstrap --to zone=one-that-works12:57
perrito666fwereade: trying now12:59
* perrito666 merges back with trunk just in case12:59
axwperrito666: pull trunl, it should be fixed12:59
axwtrunk*12:59
fwereadeand, everybody, I'm sorry but I seem to be ill. felt a bit crappy, had a lie down after lunch, fell asleep, still feel crap and have a bit of a temperature12:59
fwereadeI'm going away again for a bit, might come back if I'm more with it later12:59
axwhope you're feeling well soon fwereade13:00
fwereadeaxw, cheers :)13:00
TheMuefwereade: yeah, get well soon13:01
perrito666fwereade: get better13:02
perrito666axw: ping me if you have a moment plz13:05
axwperrito666: what's up?13:07
perrito666axw: what exactly is "fixed" in this case?13:20
axwperrito666: nothing much, just preventing warnings from the race detector13:22
perrito666I meant about the region issue13:22
perrito666:)13:22
axwperrito666: they're only in the test code13:22
axwperrito666: oh13:22
axwperrito666: the automatic spread code will attempt with another zone if the one it chooses is constrained13:23
axwperrito666: hum. your error message is a bit different13:23
axwperrito666: the fix was https://github.com/juju/juju/pull/105, but looks like your error is subtly different13:25
axwwould you please file a critical bug against 1.19.4 with the error message you got?13:25
bodie_o/13:43
Beretalexisb, is 1.20 still on track for this week do you know?13:48
alexisbBeret, it will potentially be delayed given the development release is still held up due to critical bugs13:53
alexisbBeret, I will work with the team today to get an adjusted eta for 1.2013:53
Beretok, thanks13:53
voidspaceericsnow: wwitzel3: perrito666: are we going to do standup without natefinch or wait?14:04
voidspaceI'm happy to wait14:04
ericsnowvoidspace: me and perrito666 are in already14:05
perrito666voidspace: as you guys wish14:05
voidspaceheh14:05
perrito666if no one has any important question I am happy to continue debugging14:05
perrito666mmpf, kickt out14:07
=== Ursinha is now known as Ursinha-afk
voidspacerogpeppe: ping14:25
rogpeppevoidspace: pong (but currently in a call)14:26
voidspacerogpeppe: I'm in the apiserver (specifically the new backup end point)14:26
voidspacerogpeppe: I need the mongo admin password14:26
voidspacerogpeppe: the right way to get it seems to be to read the agent conf14:26
voidspacerogpeppe: for that I need the current machine tag14:26
voidspacerogpeppe: the httpHandler has a state14:27
rogpeppevoidspace: are you just debugging, or writing code?14:27
voidspacerogpeppe: writing code14:27
voidspacerogpeppe: the backup command (the shell command we run) needs the admin password14:27
rogpeppevoidspace: you'll need to pass in the password from the machine agent14:27
voidspacerogpeppe: we're not sure if that will work, we *think* we need the admin user and password to do the dump with opLog14:28
voidspacerogpeppe: however, how would I get the machine agent password (and username and mongo port as well)14:28
voidspaceI can test both14:28
rogpeppevoidspace: there is no admin user with mongo access14:29
rogpeppevoidspace: the machine agent should have admin rights14:29
voidspacethere is an admin user14:29
voidspacethat's what the agentConf.OldPassword field is for14:29
rogpeppevoidspace: not quite14:29
voidspacehowever, I'm happy to run it as the machine agent and see if that works14:29
voidspacebut I *still* need to be able to get at that password14:30
voidspaceas far as I can tell the password hash is set in the state but not the password14:30
rogpeppevoidspace: the machine agent has access to that password14:30
voidspaceI'm inside the apiserver14:30
rogpeppevoidspace: inside jujud/machine.go14:30
voidspaceI've seen that code14:30
rogpeppevoidspace: you'll need to pass the password into the api server14:30
voidspacethat's not where I am...14:30
voidspaceyuck14:31
voidspacechange the way the apiserver is created14:31
voidspaceis the configInternal that is created in machine.go stored anywhere14:31
rogpeppevoidspace: alternatively, you could provide a way to get the password from the *state.State that was used to connect to it14:32
voidspaceso we don't store that password and as we now need it I have to store it14:32
voidspacehmm, ok14:32
voidspacerogpeppe: what is agentConf.OldPassword() for? because that was working for perrito66614:33
rogpeppevoidspace: no14:33
voidspace"no" is not a semantically valid answer to that question :-)14:33
=== Ursinha-afk is now known as Ursinha
rogpeppe:-)14:33
rogpeppevoidspace: OldPassword is to force an agent to change their password when it first starts, because the password's been passed through insecure cloudinit14:34
voidspacerogpeppe: if a state server has to restart, how does it connect back to mongo?14:34
rogpeppevoidspace: the machine agent reads its config file14:34
voidspaceso the password is in the machine agent config file?14:34
rogpeppevoidspace: then uses the info from that to reconnect to mongo14:34
rogpeppevoidspace: yes, but that's something that the api server should not know about14:35
jamericsnow: I reviewed https://github.com/juju/juju/pull/11314:37
jamvoidspace: nate is missing standup today if you didn't notice14:38
ericsnowjam: thanks!14:38
rogpeppevoidspace: add this method to state/open.go:14:38
rogpeppefunc (st *State) Info() *Info {14:38
rogpeppereturn st.info14:38
rogpeppe}14:38
rogpeppevoidspace: then you can get access to the password14:38
rogpeppevoidspace: you may want to copy the info before returning it14:38
voidspacejam: we thought he would be coming later14:38
voidspacerogpeppe: ok, interesting - thanks14:39
jamvoidspace: he said he won't be back for 2 more hours14:39
jamat least, I talked with him just before he left, and he said he was going to miss his standup again.14:39
jamI'm not sure why he wouldn't tell *you* guys that directly :)14:39
voidspacejam: he did email us14:39
voidspacejam: we were just hopeful we would get to talk to him I guess :-)14:40
jamah, k. Well, he said he would be back in ~2 hours from now, because we wanted to collaborate on some stuff. So he should be back later today. I'm guessing that's going to be a bit too late for voidspace but at least perrito666, wwitzel3, and ericsnow can chat with him14:41
voidspacejam: two hours is fine14:41
voidspacejam: we're all in the hangout anyway14:41
voidspacejam: I'm around for ~3hours (just less)14:42
voidspacerogpeppe: perrito666 thinks that this command actually requires the admin user, not just admin permissions though14:42
rogpeppevoidspace: i don't believe so14:42
voidspaceheh, he believes so and he's *tried* it - however, I have an open mind14:43
rogpeppevoidspace: if so, then our model is flawed14:43
voidspaceheh14:43
perrito666voidspace: as I said, I tried this some time ago by actually doing the xport in the current juju-backup script14:44
perrito666have you tried with the machine-N user again?14:44
voidspacethe answer is still no14:44
perrito666Y U NO TRY14:44
=== tvansteenburgh1 is now known as tvansteenburgh
rogpeppeperrito666: AFAIK there are no special rights given to the user named "admin" that can't be given to other users too14:46
perrito666rogpeppe: nothing would make me happier than the dump thing working with the regular password so lets hope the tag user has the right permissions14:48
perrito666rogpeppe: nevertheless he will still have to fetch that pass14:49
rogpeppeperrito666: i suggested a way, above14:49
rogpeppeperrito666: (a one-line method)14:49
voidspacerogpeppe: yeah, I'm trying that - thanks14:53
voidspacejust need to split the port out of info.Addrs[0]14:53
jamrogpeppe: perrito666: I wouldn't think that we would default to configuring the mongo database with full access rights using the user's name and password. We expect them to connect via the API, so you can't just pass those details to "mongodump". However, using the machine-0 (the agent running the API server) seems to make sense to me.14:54
jamIt is a little clumsy to get the password, because the agent doesn't cache it directly, but you can get to it.14:54
rogpeppejam: actually, the agent does cache it directly14:54
jamrogpeppe: on the api.Info as "tag, password" ?14:55
rogpeppejam: it's in state.State.info.Password14:55
rogpeppejam: so the api server actually (almost) has access to it already14:55
dimiternjam, replied to your comments on the networking model14:56
jamdimitern: k, I didn't finish reading it all, though I'm probably done for today14:57
rogpeppeperrito666: what exactly did you try that didn't work?14:58
perrito666rogpeppe: iirc, this was a couple of weeks ago, mongodump --oplog --loadsofparams --username <tag>14:58
rogpeppeperrito666: was that to dump one db, or all of them?14:59
perrito666all of them14:59
perrito666$MONGODUMP -v --oplog --ssl --host localhost:PORT --username admin --password <agent.conf OldPassword>15:00
perrito666that worked15:00
rogpeppeperrito666: it's possible you might have to log in to one db - i remember something odd about that15:00
perrito666and, again iirc, that with the tag as username didn't15:00
voidspaceif I don't copy the info it makes it easier to test, as I can modify it...15:05
rogpeppevoidspace: ha, that is blatant abuse :-)15:14
voidspacewell, without that it's basically untestable15:15
voidspaceas far as I can tell15:15
rogpeppevoidspace: really? won't it just connect to the local mongo?15:16
voidspacerogpeppe: my code doesn't have it connect to an actual mongo - it just checks it uses the right params15:16
rogpeppevoidspace: in which case, you just need to check that the params match, i guess15:16
voidspaceexactly15:17
voidspacematch what?15:17
perrito666command Q is too close to command w15:17
voidspacethe default info.Tag is empty15:17
voidspaceso is the password15:17
voidspacethat is not a useful test15:17
rogpeppevoidspace: the original info passed to Open15:17
voidspaceit's JujuConnSuite that creates the State(s) though15:17
voidspaceand it has an empty password and tag15:17
rogpeppevoidspace: you can open the state yourself15:18
rogpeppevoidspace: you can even add a new machine to log in as if you want15:19
rogpeppeperrito666: do you know what version of mongo we use now?15:20
voidspacerogpeppe: the existing test infrastructure gives me a state and api server and methods to make requests against that apiserver15:20
voidspaceI'm not especially keen to throw all that away15:21
rogpeppevoidspace: you don't have to15:21
perrito666rogpeppe: cant remember15:21
rogpeppevoidspace: but you can connect to the state server again15:21
rogpeppeperrito666: it's possible that --authenticationDatabase is the flag you're after, but it looks like that only appeared in 2.415:21
rogpeppeperrito666: i'm guessing that the reason that flag was added is that without it, there's no way to log in as a user in a particular db but dump all databases15:22
perrito666rogpeppe: sounds like a reasonable guess15:23
rogpeppemgz, natefinch: do you know what version of mongo we can assume?15:23
rogpeppefwereade: ^15:23
perrito666rogpeppe: fwereade left, he was not feeling well15:23
rogpeppeperrito666: ah, ok15:23
perrito666rogpeppe: is mongo updated in old servers?15:23
rogpeppeperrito666: probably not15:23
rogpeppeperrito666: you may have to call mongodump once for each db15:24
rogpeppeperrito666: oh, no!15:24
rogpeppeperrito666: hmm15:24
rogpeppeperrito666: wallyworld's been looking at some related issues recently, i think15:24
natefinchrogpeppe: 2.4.6 I believe is the minimum in precise15:24
* rogpeppe wonders if the mongodump version is updated with the mongod version15:26
rogpeppei've got mongodump version 2.2.0 but mongod version 2.4.915:26
natefinchno idea how the two versions are related15:26
voidspacenatefinch: hey, hi15:27
voidspacenatefinch: how are your teeth?15:27
natefinchvoidspace: they're fine.  But I was at the doctor :)15:28
voidspacenatefinch: hah, ok15:29
voidspacenatefinch: I hope everything is good15:29
natefinchvoidspace: yep15:29
mgzrogpeppe: 2.415:31
rogpeppemgz: thanks15:32
perrito666natefinch: wanna jum into the hangout?15:33
natefinchyeah, I'll have the kiddo in a minute, but I can jump in15:37
perrito666natefinch: there is noone right now15:39
perrito666although you can see me cooking15:39
perrito666sinzui: are you available?15:57
sinzuiI am15:57
perrito666sinzui:  I am trying to figure out why suddenly backup/restore tests are not working for HA16:01
perrito666sinzui: did you change anything on the tests themselves before this broke or it was only juju related?16:02
sinzuiperrito666, Was that really broken...I think CI reported it could not put the state-server into HA16:02
sinzuiperrito666, ahh, I see some progress and a failure16:02
perrito666sinzui: I http://juju-ci.vapour.ws:8080/job/functional-ha-backup-restore-devel/16:03
perrito666something around 84 began breaking16:03
sinzuiperrito666, CI had 2 jobs stuck for 21 hours. It is catching up now. I think we should assume noting is broken until we have a report of tip16:03
perrito666and then it all went wrong16:03
sinzuiperrito666, only the last test run, the one you found is about restore. All other failures are a failure to get into HA (or network/apt issues)16:05
sinzuiperrito666, We are still waiting to publish the test tools. I think in 2 hours we will know the real state of juju16:06
perrito666sinzui: trust me on this one, it is broken :p I have just run that exact test on my local machine and it timeouts16:08
wwitzel3rogpeppe: you have any suggestions for how/where I could safely turn off the api for a given state machine?16:08
sinzuiperrito666, :(16:08
perrito666sinzui: good news is16:08
perrito666its just a time thing16:08
rogpeppewwitzel3: from outside or inside the api server itself?16:09
perrito666the replica takes forever16:09
rogpeppeperrito666: yes, mongo is bog slow to replicate16:09
perrito666I just let it run (I commented out the destroy env part on the cleanup) and it eventually started16:09
rogpeppeperrito666: i dunno why - their protocol must be really crap16:09
wwitzel3rogpeppe: inside, this is for when a server is brought back online, but has been replaced by ensure availability. We talked about it before and thought we might not need to stop the api.16:10
perrito666sinzui: at least I get a 4 machines and 1 service all started after a moment16:10
perrito666rogpeppe: yup16:10
sinzuiperrito666, The only change we have made to that test since it started failing was to extend to timeout to allow 15 minutes to get into HA16:10
wwitzel3rogpeppe: but we actually have no idea how long this resurected machine has been offline, it could be very old, so disabling the api seems like a good thing to do.16:10
sinzuiperrito666, The previous change to the test was a month before to add the test scenario that is now broken16:11
perrito666sinzui: well I know I am not giving you a decent time measure there, but I had time to make lunch (a chicken steak) eat it and it was started somtime around the time I was washing the dishes16:12
rogpeppewwitzel3: the easiest thing to do in that circumstance is just to never start the api server at all16:13
perrito666sinzui: I think amazon is stretching a bit too thin16:13
=== vladk is now known as vladk|offline
sinzuiperrito666, Indeed. I am extending resources into other clouds. I was planning to use HP, but the apparent limit of 10 secgroups is troublesome16:14
rogpeppewwitzel3: if the state server's mongo connection is broken, then it will reconnect16:14
mgzsinzui: we may be able to beg for an increase to that16:14
perrito666sinzui: before getting this test to run I had to do the "find an AZ with enough machines"16:15
sinzuimgz, the UI says we have 200. Juju or API is not seeing all 20016:15
sinzuioh16:15
wwitzel3rogpeppe: right, I've been trying that .. but I can't find a good place to do that .. I tried in jujud/machine.go , but there I can't do the proper check of HasVote || WantsVote because the machine doesn't actually exisit yet (as far as I can tell), so when I try to get the machine from st.Machine(Tag) .. it panics when trying to access any methods of the machine.16:15
voidspacerogpeppe: ok, so I'm convinced that re-opening the apiserver state with new params and testing that they're used is a *better test*16:15
rogpeppevoidspace: good :-)16:16
rogpeppewwitzel3: i'm having difficulty imagining a scenario where this issue is a problem16:16
perrito666sinzui: would you be so kind to tell me where can I change that timeout?16:16
sinzuiperrito666, interesting, I think az3 was bring selected most of the time. CI was using az3 exclusively for tests, though we don't care where the test happen16:16
voidspaceI still don't think immutability is a god to be worshipped for its own sake however...16:16
voidspacebut my heresies aside16:17
voidspacerogpeppe: how do I do that then? :-)16:17
wwitzel3rogpeppe: if the state machine dies, is replaced by ensure-availability, then an upgrade is performed, then someone manually starts up that old state machine.16:17
sinzuiperrito666, I don't think that will help16:17
voidspacerogpeppe: I can see where suite.BackingState is set, but that's magically plucked from the already created apiserver16:17
sinzuiperrito666, line I changed is in def wait_for_ha()16:17
perrito666sinzui: as I said, I waited a stupid amount of time and it eventually came back16:17
wwitzel3rogpeppe: wouldn't that cause potentially for commands from the client to go to a state machine that couldn't handle them?16:17
sinzuiperrito666, okay16:18
perrito666sinzui: I know its not a solution16:18
rogpeppewwitzel3: presumably the issue you're worried about is that the machine goes down, we upgrade the environment, the machine gets resurrected, someone manages to connect to the API server in the 0.5s before it decides to upgrade itself16:18
perrito666I just want to make sure I wasn't just lucky16:18
sinzuiperrito666, in test_recovery.py restore_missing_state_server() has this line16:19
sinzuienv.wait_for_started(150)16:19
wwitzel3rogpeppe: well I didn't say it was likely, but if automated things are running, etc.. also I'm all for a good argument that it doesn't need to be done.16:19
rogpeppewwitzel3: if that's your concern, i honestly don't think it's worth worrying about. the worst that can happen is that *if* a client happens to hit that <0.5s window, that they use an older API version for a few moments before they're forced to reconnect16:19
sinzui^ perrito666 maybe change that to 1800 to allow 30 minutes?16:19
wwitzel3natefinch: when you're back16:20
rogpeppewwitzel3: i'd be more interested in an argument to automatically terminate old state server instances that are now down16:20
wwitzel3rogpeppe: ok, well I discuss with nate when he is back can't remember if he had a scenario as well16:21
* perrito666 runs with larger timeout16:21
wwitzel3rogpeppe: like a cleanup command the user could run?16:21
rogpeppevoidspace: i don't worship the god of immutability either, but *relying* on the fact that the Info method returns a reference to the info held inside the State seems not great16:21
rogpeppewwitzel3: i'm more thinking of something the provisioner could take care of16:21
voidspacewell, if that's its specified job it doesn't sound so bad16:22
wwitzel3rogpeppe: I thought we never delete state machines without the user explicitly saying so16:22
rogpeppewwitzel3: that is currently the case, yes16:22
voidspacebut changing those params and then testing we get them back isn't as good a test as checking that "the params we opened the state with" are used16:22
wwitzel3rogpeppe: that seems like a safe and sane practice to me16:23
rogpeppevoidspace: to connect to the state server, use state.Open(suite.StateInfo(c))16:24
voidspacerogpeppe: how do I make sure that the apiserver the test suite is using uses the *new state*16:24
voidspacerogpeppe: that's the specific issue, not just connecting to the state server16:24
wwitzel3rogpeppe: we don't know why this machine was manually restarted .. so having the provisioner delete it without input from the user seems a bit aggressive.16:24
voidspaceor rather, make sure it uses the new connection16:25
wwitzel3rogpeppe: so I will discuss with natefinch again about potentially just leaving the api server running and see if there is any concern there. thank you16:26
rogpeppevoidspace: it's pretty trivial to start an api server directly (see apiserver.serverSuite.TestStop for an example)16:26
voidspacerogpeppe: it has an environ craeted from "environs.PrepareFromName", this seems to be what creates the apiserver16:26
rogpeppewwitzel3: before adding a bunch of complexity in this area, i'd suggest coming up with a concrete scenario where this issue could be a problem, and balance that against the likelihood of it actually happening and the cost of it if it did16:27
voidspacerogpeppe: so I do have to throw away all the infrastructure provided by the existing test suite :-/16:27
rogpeppevoidspace: it's an unusual test, so it requires unusual infrastructure. but it's only a few lines of code.16:28
wwitzel3rogpeppe: +1, we may have one I am forgetting, thanks.16:29
rogpeppevoidspace: alternatively, split the code into two - one part that takes an api address and does all the hard work of backing up, the other which just extracts the api address from the api and calls the former function16:30
rogpeppevoidspace: then you can test the first one directly, and the second one by mocking the first one and checking that it gets called16:31
rogpeppevoidspace: the bulk of the logic will be in the code that does the actual backing up16:31
voidspacerogpeppe: that sounds better...16:32
voidspacerogpeppe: I'm intriuged that it should only be a few lines of code though16:33
rogpeppes/api address from the api/api address from the State/16:33
rogpeppeof course16:33
voidspacerogpeppe: it would replace JujuConnSuite.setUpConn which is non-trivial16:33
rogpeppevoidspace: starting an api server is only a single function call16:33
rogpeppevoidspace: it's fine to have several api servers running at once16:33
voidspacerogpeppe: and we need the client that can talk to it16:33
rogpeppevoidspace: that's also just a function call16:34
voidspacerogpeppe: so my current code is essentially this16:34
voidspaceresp, err := s.authRequest(c, "POST", s.backupURL(c), "", nil)16:34
voidspacerogpeppe: can you sketch out the code I'd need to make that work against a new apiserver16:35
voidspacerogpeppe: JujuConnSuite is a little mystical - the apiserver *seems* to be started as a side-effect of preparing the environment16:35
rogpeppevoidspace: well, your actual client call will be something like st.Client().Backup(), right?16:35
rogpeppevoidspace: it is, yeah. it's started by the dummy environ16:35
voidspacerogpeppe: I'm not testing this through the client here16:36
rogpeppevoidspace: actually, it shouldn't be started at Prepare time16:36
voidspacerogpeppe: I'm hitting the api endpoint16:36
rogpeppevoidspace: ok.16:36
rogpeppevoidspace: doesn't that mean you'll need to duplicate the authRequest code in your test?16:37
voidspacerogpeppe: that bit is easy, it's not much code16:37
rogpeppevoidspace: i'd just test the client code rather than directly invoking the PUT request16:37
rogpeppevoidspace: that's how most of the client requests are currently tested16:38
voidspacerogpeppe: well, the charms upload code is tested this way16:38
rogpeppevoidspace: and means you don't have to break layering to write the tests16:38
voidspacerogpeppe: and this api endpoint is a special snowflake in the same way16:38
rogpeppevoidspace: how so?16:38
voidspacerogpeppe: they both return binary blobs so they're directly httpHandlers16:39
voidspacerather than json apis16:39
rogpeppevoidspace: i don't really see the distinction16:39
voidspacewell, sort of16:39
voidspacerogpeppe: I'm just saying I used the charms code as the template for the server here - and the tests for the charm as a template for the tests16:40
rogpeppevoidspace: the way that the request is phrased is part of the implementation detail of the API (modulo the fact that we actually publish API specs for non-Go clients)16:40
rogpeppevoidspace: anyway... assuming you want to do this, it's pretty easy16:40
voidspaceeven testing through the client we'd have the same issue - in a unit test we *don't* want to actually backup a mongo server16:41
rogpeppevoidspace: you'll need to make the state server address a parameter to s.authRequest16:41
voidspaceso we need to be able to specify the params we expect to see16:41
voidspacerogpeppe: it is already - through the call to buildURI16:41
voidspaceso that's easy16:41
rogpeppevoidspace: i'd quite like a client-local test that the backup actually works tbh16:41
voidspacewe need a system test too16:42
voidspacebut that's not a good reason not to unit test the code16:42
voidspacewhich is what I'm trying to do16:42
voidspacea system test isn't complete without restore16:42
rogpeppevoidspace: so, you start the api server, you get its address, you make the backup url from the address, you make an http request using that url16:43
voidspaceyep, great16:43
voidspacerogpeppe: you have the bandwidth to join a hangout?16:45
rogpeppevoidspace: sure, though i'm finishing soon16:45
voidspacerogpeppe: me too, it should be quick16:45
voidspacerogpeppe: I just feel like we're going round in circles and we can be done a lot quicker if we actually talk16:45
voidspacerogpeppe: I'm in moonstone if you want to join16:46
voidspacerogpeppe: https://plus.google.com/hangouts/_/canonical.com/moonstone?v=1402515430&clid=4D10946615DC3A3516:46
natefinchperrito666: how goes the HA functional test?16:48
natefinchperrito666: all fixed I presume? :)16:49
perrito666strongly depends on your definition of fixed16:49
perrito666but seriously, I am running it with a few changes to make sure I nailed the issue16:49
natefinchthat's awesome16:51
perrito666sadly the error is at the end of the test16:52
perrito666:p16:52
jcw4mgz: the Actions Tag() implementation in names package: https://github.com/juju/names/pull/617:20
jcw4mgz: PTAL /17:20
jcw4(after squash)17:20
jcw4jam, or wwitzel3 I guess you're on call today too :)  https://github.com/juju/names/pull/617:26
wwitzel3jcw4: yep, I will take a look17:33
jcw4thanks wwitzel317:33
voidspacewwitzel3: https://github.com/juju/juju/pull/11417:33
voidspaceyay, tests pass :-)17:34
voidspacefinally...17:34
voidspaceand they're sensible tests (finally)17:34
voidspaceand on that note17:34
voidspaceEOD17:34
voidspaceg'night all17:34
voidspacesee you tomorrow17:34
ericsnowvoidspace: yay!17:34
voidspace:-)17:34
ericsnownatefinch: are we meeting in the moonstone hangout?18:02
perrito666sinzui: natefinch it was just a matter of time18:06
perrito666or wasnt18:07
perrito666sorry, false alarm, still hasnt finished18:07
natefinchericsnow: sorry, got distracted, yep18:07
* perrito666 bashes head on kb18:07
wwitzel3natefinch: I'm on call review today with jam, so I've been doing that. Also I need to chat a bit about the API server for resurected start servers, specifically what the scenario was for why it should be turned off and if it is worth even more time/complexity in the code.18:09
sinzuiperrito666, natefinch canonistack's swift is failing. It failed the last 3 attempts to publish tools18:11
perrito666sinzui: @more18:12
sinzuiperrito666, natefinch: I am contemplating how I can quickly work around this18:12
perrito666uff, this is my personal hell18:19
sinzuiperrito666, I am pushing a hack to use the deb built by the previous failed job. It wont publish to canonistack.18:24
perrito666sinzui: why is the tools publishing failing?18:25
sinzuicannonistack swift is dying18:25
perrito666ah uff18:26
sinzuiperrito666, CI is only as good as the clouds we test...and we know a lot about where each fails18:26
bodie_https://github.com/juju/charm/pull/5 mgz / fwereade / anyone else, really simple18:28
natefinchwwitzel3: we should try to hit up fwereade when we get the chance.  The idea was basically just that this makes for an unusual state for a state server to exist in, and that means it's one that's going to be less tested and less well-understood.18:51
sinzuiperrito666, abentley : Added a temporary hack to the publish-revision step.18:57
sinzuiperrito666, abentley : A proper separation of building packages from publication will take many days of unplanned work18:58
abentleysinzui: ack.18:58
bodie_anyone know if there's a suitable vagrant box for core juju dev?  I'm getting fed up with tweaking broken stuff, I have a remote box but I'd like to work locally19:05
natefinchbodie_: we all use our base machines19:05
bodie_I guess maybe I'll set up a vagrant box this weekend19:06
bodie_I went to set some stuff up to use the juju local provider and I think I have a version conflict between some binaries since I rearranged my GOPATH/bin to the end of my PATH19:08
bodie_I should've been working in a VM all along19:08
natefinchnah, it's fine... the problem is likely that "which juju" returns the installed version from apt rather than the one you built19:09
natefinchthat screwed me for a while19:09
natefinchI put my gopath at the head of my PATH... I never want anything on my machine to override something I've specifically built and installed19:09
* perrito666 just deleted juju from package19:10
bodie_yeah, I wanted it to override it19:14
bodie_because I wanted to use the apt-installed local provider, because I thought that was the only way to get the local provider19:14
natefinchahh no, local provider is just part of juju19:14
bodie_probably dumb, whatever, it would just be easier to have a stable version to use on my workstation and a vm to dev in19:14
natefinchthe useful thing in juju-local is just the juju-mongodb19:14
natefinchI don't know that the stable version is terribly more useful than the dev version.  We don't blow things up that often ;)19:15
bodie_on that note, I'm getting failing tests on both my machines, one of which is supposed to be a fairly pristine dev box19:32
bodie_maybe there's something left over from before the github migration, but something is wacky19:33
bodie_also, the failing tests are different19:33
bodie_jcw4 tells me there's work happening on the HA stuff right now?19:33
bodie_and these appear to be mongo related, but it's hard to say19:33
natefinchthere's work happening on HA backup and restore.  But nothing that would affect the tests19:35
jcw4fwiw, go test ./replicaset worked for me just now19:35
jcw4bodie_: might be something transient on your machine19:36
bodie_yeah, I'm clearing out /tmp with maximum prejudice19:38
sinzuihi dev. Hp test might fail because we our juju configs don't implicitly select an AZ. We uses to specify az-3.19:44
sinzuiany ideas how we might trick juju into always placing machines in az3?19:44
perrito666sinzui: I think axw might know how to answer that19:45
natefinchperrito666: how goes? \20:25
perrito666natefinch: still trying to figure out what broke (the thing is restored but for some reason replset fails to start properly)20:25
natefinchperrito666: can you get on the machine to see the mongo log? It's usually a lot more informative than our logs in that case20:30
perrito666is there a mongo log (besides the /var/log/juju logs)20:32
natefinchyes.... /var/log/mongo maybe?  Not sure.. hang on20:33
sinzuiperrito666, the functional tests have started20:34
sinzuiWe will no results in about 30 minutes20:34
perrito666natefinch: nothing there, that why I ask20:34
perrito666sinzui: great20:34
perrito666I am trying to find out what in the universe is broken20:34
perrito666something is once again re-adding the api addresses to machine-0/agent.conf20:43
perrito666natefinch: ok, something on the bash script embedded in restore did not run...20:55
natefinchahh, ok, that's good to know20:56
natefinchgetting there20:56
perrito666yeah, I ran the steps by hand and the machine came to life20:57
natefinchtiming issue maybe?  Doing stuff by hand is a lot slower20:57
thumpermorning20:58
natefinchmorning thumper20:58
perrito666natefinch: might be, although there are a bunch of waits in the code it might be that, if something in mongo became even slower the script broke20:58
perrito666thumper: morning20:58
thumpero/20:58
perrito666natefinch: perhaps its just the script's survival instinct trying to get me distracted debugging it instead of re-coding it in go20:59
natefinchhaha21:00
natefinchI gotta run... do what you can, send an email to the dev list when you're done, maybe one of the guys down under can poke at it overnight21:01
perrito666natefinch: ack21:01
natefinchThanks for the hard work.21:01
* thumper looks around for alexisb21:04
alexisbthumper, crap sorry lost track of time21:04
alexisbon my way21:05
menn0anyone able to review this? https://github.com/juju/juju/pull/10921:17
menn0a few people have made small comments but it hasn't seen a full review21:18
wwitzel3menn0: I can take a look when I'm done with my current one21:18
menn0wwitzel3: thanks21:18
thumpercmars: just finishing off with alexisb22:00
cmarsthumper, ok22:02
sinzuiperrito666, I switched the functional tests to joyent. I don't know why the tests fail now on aws...and if they fail on joyent and hope they pass22:05
perrito666sinzui: ack, I am running them against aws trying to pinpoint the bug22:06
sinzuiwallyworld, is there a undocumented secret to specify an availability zone that juju should use with HP?22:06
perrito666I have a theory about mongo being the culprit, but I am not yet sure what in mongo22:06
sinzuiwallyworld, tests are failing because juju is getting az1 or az2, which don't have enough machines22:07
wallyworldsinzui: um, there is i think but i'll need a moment to find what it is22:07
wallyworldsinzui: have you tried using the zone option to bootstrap?22:08
wallyworld juju bootstrap --to zone=az322:09
sinzuiwallyworld, This is what we are seeing. juju 1.19.4 clearly shows the passes are on az3 (which was where we use to test)22:09
sinzuihttp://juju-ci.vapour.ws:8080/job/hp-upgrade-precise-amd64/1338/console22:09
sinzuiwallyworld, 1.18.4?22:09
wallyworldsinzui: that zone option is new in 1.19 trunk22:09
sinzuiwallyworld, right22:09
wallyworldfor 1.18.3 i think you encode it in the region22:09
sinzuiI think we are rolling dice to get an az we can test on22:10
wallyworldeg region=az3.blah22:10
sinzuiwallyworld, doesn't work with havana or icehouse22:10
wallyworldoh, well that sucks22:10
wallyworldso we either backport the zone placement stuff to 1.18 (which is not really viable) or we accept we need 1.20 for H and I22:11
sinzuiperrito666, I also switched all function tests to trusty22:11
sinzuiwallyworld, :/22:11
wallyworldsinzui: the zone placement stuff is a lot of code22:11
sinzuiwe cannot add features to old versions of juju. if we get the MRE we must be extra careful to honour Ubuntu's definitions22:12
wallyworldah yes, that's true22:13
wallyworldso 1.18 will have to remain without the new zone placement stuff22:13
sinzuimaybe I can switch all hp testing to east coast us. it has just one zone22:14
wallyworldworth a try i guess22:15
sinzuimight work. No one is using it22:15
sinzuiwallyworld, I also realised that though we can have 40 instances in hp, we have a mem limit of 15G. The smallest instance type has 1G, so it is impossible to get to even half of our number of serv ers22:17
wallyworld:-(22:17
sinzuiwallyworld, oh, swift is dying in canonistack too. the canonistack tests passed because I severed the streams from aws or joyent22:18
wallyworldsinzui: well that is kinda suboptimal. makes it hard when the underlying platform is flakey22:19
sinzuiEvery cloud is ill. It is hard to say if juju is broken.22:21
wallyworldyes it is sadly. i don't *think* juju is broken (apart from the confirm ha functional restore test issues)22:22
sinzuiwallyworld, I am afk for a bit. I am trying hp tests in region-b.geo-1, which has a single az. I hope juju 1.18.4 like it23:03
hatchis there a saucy release of 1.18.x?23:06
perrito666sinzui:  are you getting a lot of errors trying to deploy to ec2? (regardles of the present bug)23:27
perrito666if not, could you make a run for me with debug=true for jujupy and appending --debug to juju restore and get me the output?23:28
bodie_can I get this merged so I can update the deps properly?  https://github.com/juju/charm/pull/523:37
bodie_it's a REALLY simple change23:39
bodie_or at least a LGTM -- it's a two or three-liner23:42
bodie_just need to update deps to get the other PR in23:42
thumperbodie_: done23:49
thumpersinzui: I want to disable the user juju subcommand on the 1.20 release branch23:50
thumpersinzui: when are you cutting that?23:50
bodie_sweet23:51
bodie_thumper, good with you if I just merge it so I can get that dep updated w/o two LGTMs?23:52
thumperack23:54
bodie_as in acknowledged or as in "ack! no!"23:55
bodie_heh23:55
rick_h_thumper: howdy, got time to chat today?23:56

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!