/srv/irclogs.ubuntu.com/2016/11/08/#juju.txt

=== CyberJacob is now known as zz_CyberJacob
chrome0I'm seeing "cannot resume transactions: exception: Cannot apply $addToSet modifier to non-array" repeatedly in my machine-0.log. What could be the cause of that? Cf. http://paste.ubuntu.com/23445701/09:37
skay_I just noticed a snap-layer and want to install a snap as a resource. I've not written a reactive charm before, and I'm not certain when a resource becomes available. what would I pass to the @when decorator?14:31
skay_'<resource name>.available'14:31
skay_it's what I'd expect, but just checking14:33
iceyI'm having trouble bootstrapping juju2 with a local apt cache server14:47
lazyPowericey what appears to be the trouble?14:49
iceylazyPower: hangs at Installing curl, cpu-checker, bridge-utils, cloud-utils, tmux14:50
lazyPoweris the local apt cache powered by squid? if so, you can check the logs of the squid-deb-proxy14:51
iceylazyPower: apt-cacher-ng14:51
iceylazyPower: nothing in its logs either14:51
lazyPowerare you seeing any hits in the log?14:51
lazyPoweryeah, seems like there's potentially a misconfiguration?14:51
iceylazyPower: listening on : tcp        0      0 0.0.0.0:3142            0.0.0.0:*               LISTEN      13949/apt-cacher-ng14:52
admcleod_icey: presumably you have --debug ?14:52
iceyunless there's something stopping a lxd container from reaching a public interface on my host14:52
jrwrenicey: how are you bootstrapping?14:53
iceyadmcleod_: fairly boring, --debug shows nothing after I kill it14:53
iceyjrwren: "juju bootstrap lxd lxd --config apt-http-proxy=http://10.0.1.99:3142 --config apt-https-proxy=http://10.0.1.99:3142 --debug"14:53
jrwrenicey: 10.0.1.99 does not seem right.14:54
iceyjrwren: that's one of the IPs for my current host14:54
iceythe one that lxd is running on14:54
jrwrenicey: ok. nevermind.14:54
jrwrenicey: can you ssh to machine 0 and curl http://10.0.1.99:3142 ?14:54
iceyjrwren: the bootstrap never finishes14:54
* skay_ neverminds, figured out the way to do it.14:55
iceyjrwren: let me attempt to redeploy and lxc exec into it14:55
jrwrenicey: lxc list, find the bootstrap machine and ssh with: ssh -i .local/share/juju/ssh/juju_id_rsa ubuntu@<IP>14:55
admcleod_icey: maybe just incase also try setting http- and https-proxy14:55
iceyjrwren: seems like the lxd machine can't see the host network?! I get failed to connect with curl14:57
jrwrenicey: That sounds like hte problem. Now to find out why that is the case?14:57
iceyjrwren: mtr has no problem though14:57
jrwrenicey: in the container?14:58
iceyjrwren: yeah14:58
jrwrenicey: is there an iptables rule now allowing 3142 from that network?14:58
iceyjrwren: probably not14:58
jrwrenicey: is this standard lxdbr0 network config?14:58
iceyjrwren: it was a few months ago when I installed everything ;-)14:59
jrwrenicey: instead of 10.0.1.99 address, try the address from lxdbr0? `ip addr show dev lxdbr0`14:59
iceyadding the iptables rule makes it work on the 1.99 address15:00
iceythe bridge address would probably make more sense15:00
iceybut I'm /trying/ to build a demo method that other users woulc use and connect back to my machine for the apt cache15:01
jrwrenicey: Then it must be a firewall rule?15:01
iceyactually it still didn't work -_-15:02
iceyhttp://pastebin.ubuntu.com/23446805/15:02
iceythere was a bug about that already I think15:03
iceyregarding an iptables rule added for 844315:03
jrwrenicey: that is an entirely different error. juju can't talk to lxd there.15:04
jrwrenicey: is lxd running?15:04
iceyjrwren: yeah, but the fix is still to add an iptables rule...15:04
icey sudo iptables -I INPUT 4 -i lxdbr0 -p tcp --dport 8443 -j ACCEPT15:05
iceyfixes it15:05
jrwrenicey: ok, sounds like you need the same thing for port 3142 on all interfaces.15:05
jrwrenicey: ubuntu doesn't default to a deny all iptables ruleset, AFAIK. I think you are somehow a bit off the rails.15:05
iceyjrwren: yeah, needed tro add 8443 to let juju talk to lxc, and 3142 to let juju talk to the apt cacher -_-15:06
iceyjrwren: I think it's from ufw ;-)15:06
jrwrenicey: must be. I'm surprised we don't have that better documented given how popular ufw is.15:06
petevgcory_fu: here's that matrix test I mentioned in the standup:  https://github.com/apache/bigtop/pull/158 And here's a branch of python-libjuju that will get you to the point where you're broken like I'm broken: https://github.com/petevg/python-libjuju/tree/bug/bundle-deploy-issues16:22
kjackal_cory_fu: You said you can call charm push from a CI script. True. The ugly part is that you have to also login through SSO and 2FA, right? So your build bot will have to do that from inside the CI. You also mentioned something about the blueslib? Whta is that?16:24
cory_fukjackal_: This is how we're dealing with the charm store login in the RQ: https://github.com/juju-solutions/review-queue/pull/5416:25
cory_fukjackal_: Basically, you create and save the SSO token and make sure you clear your go cookies and it handles the auth with the SSO token which never expires16:26
kjackal_cory_fu: Interesting, so you need to pass the oauth token at deploy time and thats it16:33
cory_fuYep16:33
kjackal_cory_fu: Is there a rest call to get the oauth token or do you "steal it" from your local session?16:35
cory_futvansteenburgh: ^16:36
cory_fukjackal_: I'm not sure16:36
tvansteenburghkjackal: you steal it16:36
kjackal_:) thanks tvansteenburgh, cory_fu! We should make this official!16:36
tvansteenburghpetevg: i looked at the branch you posted above16:38
petevg tvansteenburgh: if you're pointing out that I edited auto generated code, I know. Going to file an issue -- the branch is just to work through the exceptions I was running into ...16:39
tvansteenburghpetevg: no, that's not it16:40
petevgtvansteenburgh:16:40
petevgUh oh :-)16:40
tvansteenburghpetevg: i was just gonna point out that those edits should not in fact be necessary. you should be able to just do this http://pastebin.ubuntu.com/23447159/16:41
tvansteenburgh(without editing the auto-generated code)16:41
tvansteenburghpetevg: stuff gets serialized automatically before being put on the wire16:42
tvansteenburghobviously i don't know what error you're hitting, so there may be more to it, but i just happened to notice that part16:42
cory_futvansteenburgh: I think petevg's main point with the change was the `params = dict()` line16:42
petevgtvansteenburgh: whoops. I forgot the serialize thing was still in there.16:42
cory_fuWhich overwrites the params passed in16:43
petevgYeah. The prob is the circular reference.16:43
tvansteenburghoh i see16:43
cory_fuI think it's in fact a naming conflict.  The parameter name conflicts with a local var in the generated code16:43
petevgThe serialize is me naively trying to figure out why the go side still doesn't like what I pass in ...16:43
cory_fupetevg: It's because it really should be a nested dict with the params passed in under a 'params' key16:44
cory_fuOh, nm, you had that part16:44
petevgYep :-)16:44
cory_fupetevg: I don't understand why this is failing.  I was able to deploy a bundle without hitting this16:45
cory_futvansteenburgh: Did you by chance regenerate _client.py?16:46
tvansteenburghno16:46
cory_fuHow did this ever work for me, then?16:46
petevgcory_fu: i think that you specified more constraints.16:46
petevgAnd you don't have machine shenanigans in your bundle.16:47
petevgBasically, my bundle is fancier, and exercises more code :-)16:47
cory_fupetevg: The generated plan from deploying the bundle definitely had an "add machine" step in it, though.  I remember it from debugging16:47
tvansteenburghwhat's the actual error?16:47
petevgMy current guess is that I need to provide a default for 'series'. Am eating an early lunch, and am planning on testing after.16:48
petevgtvansteenburgh: Ack. Matrix clobbered my logs when I stopped it. It appeared to be a response from the Go side, claiming that I hadn't passed it something that it could unpack into a valid MachineParams object.16:50
petevgRunning again. Will paste shortly.16:51
petevgtvansteenburgh Le error: juju.errors.JujuAPIError: json: cannot unmarshal object into Go value of type []params.AddMachineParams16:53
tvansteenburghyeah16:53
petevgNoisy matrix logs here, for the curious: http://paste.ubuntu.com/23447199/16:54
tvansteenburghpetevg: well since i have regen'd the client in a while, it's possible that the params have changed in juju16:54
cory_fupetevg, tvansteenburgh: What do you think of this?  https://github.com/juju/python-libjuju/pull/516:54
tvansteenburghhave not regen'd rather16:54
petevgtvansteenburgh: Ooh. That would make sense ...16:55
petevgcory_fu: that def looks like a plausible fix for the circular reference issue.16:56
tvansteenburghpetevg: that doesn't appear to be the problem. gotta break for lunch, will look closer when i get back17:04
petevgtvansteenburgh thank you very much for looking! Have a good lunch :-)17:06
kjackal_tvansteenburgh: cory_fu: here is the API for the store what it seems you can get the authtoken: https://github.com/juju/charmstore/blob/v5-unstable/docs/API.md I should have more info on restricting permisions on the tocken tomorrow17:08
kjackal_tvansteenburgh: cory_fu: there is this call GET /delegatable-macaroon17:09
cory_futvansteenburgh: https://github.com/juju-solutions/bundletester/pull/6917:48
tvansteenburghkjackal: sure, but you're not gonna be able to discharge that macaroon without an oauth identity17:51
=== zz_CyberJacob is now known as CyberJacob
tvansteenburghpetevg: did you get unblocked?19:09
petevgtvansteenburgh: I didn't (I was wrong about it needing a series as a default).19:13
tvansteenburghpetevg: ok, looking now19:14
petevgtvansteenburgh: thank you for looking into it. :-)19:27
tvansteenburghpetevg: afaict the problem is just that you have params: params: instead of just params:20:11
petevgtvansteenburgh: I tried just passing params in at one point. That might have been while other things were broken, though. I'll try again ...20:12
petevgtvansteenburgh: That works! (Well, it gets us to the point where a log message does the wrong thing with the return, but that's progress, and it gets me back out of the generated codebase, at least :-) )20:16
tvansteenburgh\o/20:16
petevgtvansteenburgh: I see several instances in the generated code where we create a params argument, then create a dict with a 'params' key to pass to it. Should I assume that is never the correct thing to do, and submit a patch?20:16
petevgIn any case, thank you :-)20:17
tvansteenburghpetevg: i'm note sure yet :/20:19
petevgWhee!20:19
tvansteenburghpetevg: so for your thing to work you still have patched auto-gen'd code?20:21
petevgtvansteenburgh: yes. I need to rebase from cory_fu's branch, but I think the params will still try to nest itself.20:21
tvansteenburghpetevg: i just noticed something else. AddMachines() takes a list of AddMachineParams objects20:29
tvansteenburghnot a single instance20:30
petevgtvansteenburgh: is this on the Go side?20:30
tvansteenburghso, client_facade.AddMachines([params]) in your example20:30
tvansteenburghpetevg: https://github.com/juju/python-libjuju/blob/master/juju/client/_client.py#L907720:31
tvansteenburghpetevg: note the typing.Sequence20:32
petevgtvansteenburgh: Interesting. I am currently getting timeouts, and it looks like the machines aren't being added ... will try passing in a list. (Hooray for more hacking on generated code!)20:32
tvansteenburghpetevg: why do you have to change auto-gen'd code?20:33
petevgtvansteenburgh: Yeah. I can just pass a list in from model.py20:37
petevgtvansteenburgh: Huh. It doesn't want a list. "cannot unmarshal array into Go value of type params.AddMachines"20:37
tvansteenburghpetevg: can i see your current code?20:44
petevgtvansteenburgh: yes. Jumping into the matrix hangout ...20:45
petevgtvansteenburgh: Will also push to that branch shortly (I'm hacking in the site-packages in a virtual environment, so I have to copy stuff over ...)20:46
petevgI just want to try one more thing (working on embedding a list in the params key in the params dict.)20:47
tvansteenburghpetevg: can you jump in here https://hangouts.google.com/hangouts/_/canonical.com/rq-next?authuser=020:50
lutostagour /var/lib/juju on a 1.25.6 bootstrap system is 6.3G, any way to clear out some of it?21:00
lutostagis the charm-get-cache safe to delete?21:02
lutostagci-oil-config has an error https://pastebin.canonical.com/170197/21:17
lutostagcharm*21:17
* lutostag oops, wrong channel for that last part...21:22
=== beisner- is now known as beisner
=== hml_ is now known as hml
=== CyberJacob is now known as zz_CyberJacob

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