[00:20] <dpb1> marcoceppi: sure, but there are issues with the way it reads in deployer config files.  So I have been using deployer to parse things.  Which is only py2 at this point.
[18:56] <jcverdie> Hi there, I'm a newbie to juju, I was trying to setup gerrit just to see if it could help my infrastructure but i could not get it working properly, and the readme in the charm are not so helpful :( Is there any good URL you could point me too?
[19:41] <jcverdie> Hi there, I'm a newbie to juju, I was trying to setup gerrit just to see if it could help my infrastructure but i could not get it working properly, and the readme in the charm are not so helpful :( Is there any good URL you could point me too?
[20:10] <lazyPower> Greetings jcverdie, I just pulled up the Gerrit charm on jujucharms.com and started reviewing the README. On which portion are you stuck?
[20:11] <jcverdie> hi lazyPower first of all thanks. My first try the ec2 instance kept "pending" forever (a couple of hours). I can retry now but I'm confused about what I need to put for volume-map
[20:12] <jcverdie> i chose canonical-ci/gerrit-59 don't know if you have the same one
[20:13] <jcverdie> also for public_url not sure i need to fill it
[20:15] <lazyPower> jcverdie: ah ok well the ec2 instance sitting in a pending state - is that resolved now?
[20:15] <jcverdie> looks random lazyPower... right now I'm experiencing the same issue on a different charm (gitolite)
[20:16] <jcverdie> i might be doing something wrong but can't figure what
[20:16] <lazyPower> its a sign that something isn't right in the EC2 config.
[20:16] <jcverdie> do you suggest to start over?
[20:16] <jcverdie> destroy environment and bootstrap again ?
[20:16] <lazyPower> I'm bootstrapping on amazon right now to verify there isn't something hinky upstream.
[20:17] <lazyPower> also, to note, it appears you are working towards building a git based repository service?
[20:17] <jcverdie> absolutely
[20:18] <lazyPower> if so, may i recommend our gitlab charm? It has all of these features out of the box
[20:19] <lazyPower> it may save you a few dollars in running hosts so you can run the review service, hosted repositories, and web interface on the same machine. I've run a self hosted gitlab server for a little over a year now and its been rock solid for me.
[20:19] <jcverdie> We have been using gitlab as a test run for 6 months
[20:20] <lazyPower> Ok i'm bootstrapped, bringing up my first node now
[20:20] <jcverdie> but my team still prefers gerrit so we are now interfacing gitlab with gerrit, so I wonder if it makes sense to keep gitlab just for the repository
[20:20] <jcverdie> i mean not using merge request nor wiki nor issue tracker
[20:20] <lazyPower> I don't have much experience with gerrit, so this will be an exploratory session for the both of us
[20:21] <jcverdie> BTW I have a pending gitolite EC2 instance, it seems stuck. I cannot find the reverse function for "juju deploy" ?
[20:22] <lazyPower> juju help commands will give you the output, but you're going to look for juju destroy-service and juju destroy-machine to wipe the machine and service from your deployment map
[20:23] <jcverdie> got it :)
[20:23] <lazyPower> Ok my first node just became active. To recap, it took approx 3 minutes from bootstrap to machine1 being active and deploying the gui. still pending the gui completion
[20:24] <jcverdie> i cleaned my environment: just one machine, with juju-gui deployed on it (and running)
[20:24] <jcverdie> nothing else
[20:24] <lazyPower> you should be seeing approx the same timelapse on yoru operations, that will give you a good benchmark on how long you should be waiting for your instances to be "active" or "started" in the juju status output.
[20:24] <lazyPower> ok, let me fish up the gerrit readme again, and lets walk through a sample deployment from the readme. It looks al ittle more complex than most since you are base64 encoding configurations and setting them as configuration values of the charm.
[20:25] <jcverdie> lucky me the one i need is more complex than casual charms :)
[20:26] <lazyPower> juju deploy postgresql && juju deploy cs:~canonical-ci/precise/gerrit
[20:27] <lazyPower> juju add-relation gerrit postgresql:db
[20:29] <lazyPower> it looks like the readme could some some formatting cleanup, the associated 'code blocks' for deploying apache 2 in front of gerrit is missing the proper formatting
[20:29] <lazyPower> but other than that this looks to be fairly straight forward. My Postgres and Gerrit units just became active. Are you following along at home?
[20:30] <jcverdie> still pending
[20:30] <lazyPower> ok, do either of the instances have public-ip's yet/
[20:30] <jcverdie> actually the apache2 part is simply impossible to understand to me :( and the volume map part I don't know what I should put there (I don't want it to be ephemeral obviously)
[20:31] <lazyPower> right, i'm taking this one step at a time :) If your instances aren't getting an IP it means theres a mismatch somewhere in the controller and what the nodes are expected to do as i understand it.
[20:31] <jcverdie> postgre started not gerrit so far
[20:31] <lazyPower> ok, which region are you running in?
[20:31] <jcverdie> ok all is up now
[20:32] <jcverdie> eu-west-1
[20:32] <lazyPower> Ok. I'm running US-East-1 so there may be a bit of difference in latency then.
[20:32] <jcverdie> i have all the public addresses (but no service exposed, except for my juju-gui)
[20:32] <lazyPower> I'm pending a db-relation-changed hook failure after relating the two services.
[20:32] <lazyPower> 1 moment
[20:35] <lazyPower> ok it appears that gerrit wants to be configured befor eyou add the database relationship
[20:35] <lazyPower> Exception: Cannot create admin user.  Missing required charm configuration.Must set admin_username, admin_external_id, admin_email, admin_pubkey, admin_name.
[20:35] <jcverdie> i haven't got the same error ? Where could you see it?
[20:35] <lazyPower> I attached to the unit: juju debug-hooks gerrit/0
[20:36] <lazyPower> this allows you to run hook execution interactively and collect any errors / modify the hooks to get them completing successfully. This information would have also crossed the logs, if you attach to `juju debug-log` all of this information gets output there as well.
[20:37] <lazyPower> jcverdie: https://juju.ubuntu.com/docs/authors-hook-debug.html
[20:37] <jcverdie> ok got it
[20:37] <lazyPower> debug-hooks is a tmux session that creates new sessions based on the scope of the currently executing hook. There's some good information in those docs, and its a very handy tool to have in your juju-toolbelt
[20:39] <lazyPower> jcverdie: brb, phone.
[20:40] <jcverdie> so i need to remove gerrit and setup all the settings
[20:41] <lazyPower> not necessarily. You can configure the charm post deployment. Its idempotent so it will reconfigure itself appropriately.
[20:45] <lazyPower> back, thank you for your patience.
[20:45] <jcverdie> you're kidding... Thanks for _your_ patience :)
[20:46] <lazyPower> :) We'll discuss my bill later
[20:46] <lazyPower> j/k
[20:46] <jcverdie> :p
[20:46] <lazyPower> OK so, i picked the canonical-ci flavor of the charm.. and now i have to find my Ubuntu SSO ID
[20:46] <lazyPower> i'm not sure where to get that since the web interface isn't making it very apparent
[20:47] <jcverdie> according to the readme I thought we could use any openID ?
[20:47] <lazyPower> that should be the case
[20:47] <lazyPower> let me look a bit closer. i'm probably looking for the wrong thing
[20:49] <hobbyBobby> can't seem to add ssh key to juju bootstrap node
[20:50] <lazyPower> juju by default uses your ~/.ssh/id_rsa* files and copies them for you
[20:52] <lazyPower> hobbyBobby: there is a command to add more ssh keys to juju, however I don't remember what it is and I can't seem to find it in the docs.
[20:53] <lazyPower> marcoceppi: when you get this, if you recall the juju command to add keys, can you reference for me?
[20:54] <hobbyBobby> lazyPower: I'm looking at preseed alternatives, I am doing this from root user on maas node, I just put id_rsa.pub as the public ssh key
[20:55] <lazyPower> hobbyBobby: http://maas.ubuntu.com/docs/juju-quick-start.html - following that documentation?
[20:55] <lazyPower> jcverdie: interesting i'm getting schema migration failure too
[20:55] <jcverdie> lazyPower:  :(
[20:55] <lazyPower> This may be something I've done incorrectly with the charm config, but i'm not having much success in getting the charm to behave.
[20:56] <jcverdie> you changed something to the charm?
[20:56] <lazyPower> just the configuration values, but i'm seeing permission denied on the postgres migration. This may be a leftover from removing/re-adding the relationship
[20:56] <lazyPower> let me wipe the services and start from scratch
[20:57] <lazyPower> like it may have a cached db user that's no longer valid in postgres
[20:57] <hobbyBobby> lazyPower: thanks, I'll recheck
[20:57] <jcverdie> k
[21:03] <jcverdie> agent-state: error
[21:03] <jcverdie>         agent-state-info: 'hook failed: "db-relation-changed"'
[21:03] <jcverdie> now i have the same error you got
[21:03] <lazyPower> Whats the output in debug-log?
[21:04] <lazyPower> can you pastebin it for me?
[21:04] <jcverdie> https://gist.github.com/jicheu/7d02efca7b4933198193
[21:04] <lazyPower> ok, since you weren't attached during the time of hook execution we will need to interactively debug the hook to fetch the associated error
[21:05] <lazyPower> have 2 terminals ready from your juju workstation, and in one, juju debug-hooks gerrit/0
[21:05] <lazyPower> on the other terminal, juju resolved -r gerrit/0
[21:05] <lazyPower> let me know once you've completed those steps
[21:05] <jcverdie> ready
[21:05] <lazyPower> in the debug-hooks window, you should see a new session pop up, "db-relation-changed" yes?
[21:05] <jcverdie> I got it on the debug hooks terminal : gerrit/0:db-relation-changed %
[21:06] <jcverdie> yes:)
[21:06] <lazyPower> perfect, run `hooks/db-relation-changed`
[21:06] <jcverdie> on the debug-hooks terminal?
[21:06] <lazyPower> correct
[21:07] <jcverdie> not so good... https://gist.github.com/jicheu/e528cf65d3d7a36f5fd8
[21:07] <lazyPower> Ok so thats what i initially ran into. The charm expects these values to be configured. It implicitly states this within the configuration yaml of the charm, but doesn't make reference to that in the README
[21:08] <lazyPower> I'll open a bug against the charm to update the README, however in the meantime, we need to set those configuration flags. I'm not sure this iwll introduce an issue - let me finish my redeployment to validate this will yield good results
[21:08] <jcverdie> sure
[21:09] <lazyPower> Ok that seems to have corrected the issue. You will need remove gerrit from the deployment map and re-add it. Set the configuration values BEFORE you relate gerrit with postgresql
[21:09] <lazyPower> a bit annoying since this could have been mitigated, but live and learn right?
[21:11] <jcverdie> ok so I guess the first step is to remove the unit?
[21:11] <lazyPower> That works, you dont need to destroy the machine.
[21:11] <lazyPower> juju remove-unit gerrit/0
[21:11] <lazyPower> juju add-unit gerrit --to <machine id of original gerrit deployment>
[21:12] <jcverdie> should I setup the config value before the add-unit? or after?
[21:12] <lazyPower> after the add unit, but do not relate it with postgres until you have configured the admin user
[21:13] <jcverdie> ok done
[21:13] <jcverdie> but when I added the unit it immediately showed the relation with postgre
[21:13] <jcverdie> should I remove the relation before readding the unit ?
[21:14] <lazyPower> ah ok, we didn't remove the relationship and juju has that cached
[21:14] <lazyPower> my mistake, i should have directed you to remove the relationship first
[21:14] <jcverdie> ok so i remove the relation, the unit, and re-add the unit
[21:14] <lazyPower> correct
[21:16] <jcverdie> strange... juju remove-unit gerrit/1
[21:16] <jcverdie> but juju status still lists it:
[21:16] <lazyPower> is the charm still in an error state?
[21:17] <jcverdie> yes
[21:17] <lazyPower> that is by design. Juju will not remove anything until the error has been resolved
[21:17] <jcverdie> ouch
[21:17] <lazyPower> you may need to resolve teh charm more than once if it errors on the database departed hook execution too.
[21:18] <jcverdie> it's getting worse... resolve now tells me: ERROR cannot set resolved mode for unit "gerrit/1": already resolved
[21:19] <jcverdie> and the unit is listed as "life: dying"
[21:19] <jcverdie> but still here
[21:19] <lazyPower> it's working on the tear down
[21:19] <lazyPower> it may still error between the end of life of that service and now, but its actively workin gon removing the unit
[21:19] <jcverdie> ok so let's wait:)
[21:19] <lazyPower> Are you working on Micro instances?
[21:19] <lazyPower> or small?
[21:20] <jcverdie> hmmm... whatever is set by default :)
[21:20] <lazyPower> should be small then
[21:20] <lazyPower> hmm... i wonder why the execution is taking longer for you than what i'm seeing.
[21:20] <lazyPower> This may be a prime opportunity to do some benchmarking this week
[21:20] <jcverdie> may be I should move to another region at least for testing
[21:21] <lazyPower> That's not necessary. I may just be impatient.
[21:21] <jcverdie> it's been dying for a few minutes....
[21:21] <lazyPower> but now i'm wondering what the differences are in the response times in different regions.
[21:21] <jcverdie> there's no juju kill -9 :)
[21:21] <lazyPower> does it appear to be stuck then? Resolving does nothing?
[21:21] <jcverdie> nop
[21:22] <lazyPower> is postgres in an error state?
[21:22] <jcverdie> may be i'd better start over
[21:22] <jcverdie> no postgresql is doing fine
[21:22] <lazyPower> yeah, i would destroy the env and start over if you can afford the timesink.
[21:22] <jcverdie> ok
[21:22] <lazyPower> we got a little hinky with removing services and redeploying to the same box. it shoul dhave been fine but if its acting up lets rule out that possibility
[21:23] <hobbyBobby> how would i go about refreshing from envuironments.yaml, it seems to be using old configuration
[21:23] <lazyPower> I'm not sure what you're asking me
[21:23] <hobbyBobby> well I go bootstrap and get this
[21:24] <hobbyBobby> lazyPower:014-02-02 21:21:17 DEBUG juju.environs open.go:75 ConfigForName found bootstrap config map[string]interface {}{"name":"maas", "state-port":37017, "tools-url":"", "api-port":17070, "authorized-keys":"ssh-rsa", "default-series":"precise", "development":false, "image-metadata-url":"", "admin-secret":"somethingReallyReally99Secrety", "logging-config":"<root>=DEBUG", "maas-agent-name":"ec9bca2a-0aca-4f5b-8a1a-7fdead74774c", "maas-server":"http://$192
[21:24] <hobbyBobby> .168.100.3:80/MAAS"}
[21:24] <hobbyBobby> 2014-02-02 21:21:17 DEBUG juju.environs.configstore disk.go:77 Making /root/.juju/environments
[21:24] <hobbyBobby> 2014-02-02 21:21:17 INFO juju.environs open.go:156 environment info already exists; using New not Prepare
[21:24] <hobbyBobby> 2014-02-02 21:21:17 DEBUG juju.provider.maas environprovider.go:33 opening environment "maas".
[21:25] <lazyPower> hobbyBobby: whoa whoa
[21:25] <hobbyBobby> 2014-02-02 21:21:17 ERROR juju supercommand.go:282 could not access file 'ec9bca2a-0aca-4f5b-8a1a-7fdead74774c-provider-state': Get http://$192.168.100.3:80/MAAS/api/1.0/files/ec9bca2a-0aca-4f5b-8a1a-7fdead74774c-provider-state/: lookup $192.168.100.3: no such host
[21:25] <lazyPower> hobbyBobby: pastebin please
[21:25] <hobbyBobby> lazyPower: ok, sorry, it's using old host from old config
[21:26] <lazyPower> its ok :) general rule of thumb is > 2 lines, use pastebin
[21:26] <jcverdie> lazyPower: i'm deploying again, but not creating the relation
[21:26] <lazyPower> jcverdie: good plan. Get gerrit's admin config options filled in the GUI before you progress to adding the relationship and it should be fine
[21:27] <lazyPower> hobbyBobby: ok reading through this log output one second.
[21:27] <jcverdie> when you talk about the GUI you mean juju-gui?
[21:28] <lazyPower> Yeah. I use juju-gui for ~ 60% of my deployment testing so i get an accurate view of what an end user would be seeing coming into this from scratch. The gui is bar none the easiest method to interface with juju.
[21:29] <hobbyBobby> lazyPower: I got it
[21:29] <lazyPower> excellent, what was the answer?
[21:30] <hobbyBobby> just delete ~//
[21:30] <lazyPower> ah ok. Good to know. Thanks
[21:30] <hobbyBobby> ~/.juju/environments/maas.jenv
[21:30] <lazyPower> i was thinking you would have to destroy the environment and rebootstrap
[21:30] <lazyPower> but i'm not very familiar with maas - I don't have the hardware required to test it.
[21:33] <jcverdie> filling info now... lazyPower should i fill admin_privkey and _pubkey?
[21:33] <lazyPower> Those are required fields. yes
[21:34] <jcverdie> so I need to put my private rsa key there??
[21:34] <lazyPower> Correct. if you dont want to put your personal private key, generate a new keypair and use those.
[21:37] <jcverdie> ok another silly question public_url ? what should i put
[21:37] <lazyPower> the EC2 public address of the machine for now, unless you have a DNS Entry you want to put there, eg: myawesomecodereview.com
[21:38] <jcverdie> not yes dns for this :)
[21:38] <jcverdie> re: sendmail settings did you fill them too ?
[21:38] <lazyPower> i did not
[21:38] <lazyPower> I only filled in the admin user configuration fields and it deployed without an issue.
[21:39] <jcverdie> ok so i filled everything except smtp settings, and I left the ephemeral storage for the moment... go deploying now
[21:39]  * lazyPower crosses fingers
[21:40] <jcverdie> I don't see any "deploy" buttn on the GUI but the unit is listed as running
[21:40] <lazyPower> did you click "Save settings" after you filled in the configuration fields?
[21:40] <jcverdie> yep
[21:40] <lazyPower> ok, and the charm is green on the GUI right?
[21:40] <jcverdie> right
[21:40] <lazyPower> juju has already handed off to running hooks/config-changed
[21:40] <lazyPower> you should be ok to add that DB relationship now
[21:41] <lazyPower> hooks are queued and run sequentially
[21:41] <hobbyBobby> lazyPower:so now I have my ssh key in /root/.ssh/id_rsa.pub and running bootstrap with that user with the config in the guide. I still can't ssh into that machine without being asked for some password
[21:41] <lazyPower> is there a password on the SSH key?
[21:41] <hobbyBobby> lazyPower:no
[21:41] <lazyPower> run ssh -vv user@host
[21:42] <lazyPower> the output should tell if you if there's an issue
[21:42] <jcverdie> let's try :)
[21:42] <lazyPower> liek pubkey(Denied)
[21:43] <jcverdie> got it, no error
[21:43] <lazyPower> jcverdie: success!
[21:43] <lazyPower> time to grab a beer, your gerrit setup should be working and responding on port 8081 of the host
[21:43] <jcverdie> lazyPower: that's the very first step but at least you solved that one for me :)
[21:43] <jcverdie> nop it doesnt
[21:43] <lazyPower> juju expose gerrit
[21:44] <jcverdie> according to the readme I need to deploy apache2 ?
[21:44] <hobbyBobby> lazyPower:Trying private key: /root/.ssh/id_dsa, debug1: Trying private key: /root/.ssh/id_ecdsa, debug2: we did not send a packet, disable method
[21:44] <lazyPower> thats for the reverse proxy, so you can access it on port 80
[21:44] <jcverdie> wow no I can see it now (I couldn't 5 minutes ago) :)
[21:44] <jcverdie> thanks a lot for your help it is invaluable
[21:45] <lazyPower> hobbyBobby: May be permissions problem?
[21:45] <jcverdie> and now I'm back to my volume-map and ephemeral stuff... not to bother you but since you seem on the ball you might have an idea :)
[21:45] <lazyPower> jcverdie: save your deployment map as a yaml using hte gui so you can restore from a known good restore point of configuration.
[21:46] <jcverdie> export bundle ?
[21:46] <lazyPower> yep
[21:46] <jcverdie> done :)
[21:46] <hobbyBobby> lazyPower:if I understand correctly we're not allowing the user to use rsa key to validate the public one from the bootstrap node?
[21:46] <lazyPower> hobbyBobby: i wish i knew more about maas to answer that question. Maybe echo it in #maas and someone will be available to answer?
[21:47] <jcverdie> FWIW I cannot "sign in" on my gerrit :(
[21:47] <lazyPower> jcverdie: i used my email that i have associated with login.ubuntu.com as my SSO id, and it worked.
[21:47] <hobbyBobby> lazyPower: ok thanks
[21:47] <jcverdie> you have a sign in link at the top right corner ? clicking on it does nothign here
[21:48] <lazyPower> i did, but id estroyed the environment already...
[21:48] <lazyPower> 1 sec let me pull up the charm config on jujucharms.com and i'll see what i put in there
[21:49] <lazyPower> jcverdie: http://i.imgur.com/5q4zHXP.png
[21:50] <lazyPower> but i'm also already signed into Ubuntu SSO
[21:50] <lazyPower> so that may have been the secret sauce
[21:50] <jcverdie> I have a ubuntu account don't know if i have sso.. I used my yahoo openid, did not work
[21:51] <lazyPower> well i know this is built by the guys on canonical's CI team so i figured the Ubuntu SSO would be the 1:1 testing mechanism
[21:51] <jcverdie> what is strange is that it does not even ask me for a login...S ign in just does nothing
[21:51] <lazyPower> but it should work equally across the board.
[22:17] <jcverdie> god kills me... openid was not working because when I setup the charm I forgot in the public address to put "http" so my url was not canonical :(
[22:29] <jcverdie> gerrit did not installed a git with it.. There are not git charms ? I cant find them if there are somewhere
[22:31] <lazyPower> jcverdie: looking at hooks/gerrit_utils.py, it installs git and gitweb
[22:32] <jcverdie> ok I might need to push a first project (im dumb sometimes)
[22:32] <lazyPower> jcverdie: i'm about to leave to attend a superbowl party. Best of luck in your adventures. If you get stuck, try emailing the juju list for non-time sensitive questions.
[22:32] <jcverdie> sure. thanks a lot for your help
[22:33] <lazyPower> No Problem :)
[22:33] <jcverdie> enjoy the party :) I'll check on the seahawks tomorrow in the morning :)