juju / amulet

Testing harness and tools for Juju Charms
Other
17 stars 33 forks source link

Errors while deploying amulet #141

Open Shruthima opened 8 years ago

Shruthima commented 8 years ago

I am facing Two issues while deploying IBM-IM charm amulet locally. Here the links for both errors: http://paste.ubuntu.com/18686777/
http://paste.ubuntu.com/18686804/

tvansteenburgh commented 8 years ago

@Shruthima What's the output of juju version? Amulet (and several other tools don't work with the latest 2.0 betas. They work with beta8 and prior, but not beta9+ (yet). Also, your version of juju-deployer is slightly out-of-date - latest is 0.8.0.

Shruthima commented 8 years ago

@tvansteenburgh Output of juju version is: 2.0-beta7-xenial-amd64

Shruthima commented 8 years ago

Any updates on this issue ?

tvansteenburgh commented 8 years ago

Did you try upgrading your version of juju-deployer as suggested?

Shruthima commented 8 years ago

Yes i have upgraded the juju-deployer version to 0.8.0 root@c277-pkvm-vm53:~/charms/trusty/ibm-im# pip list | grep juju juju-deployer (0.8.0) jujubundlelib (0.4.1) jujuclient (0.52.0)

root@c277-pkvm-vm53:~/charms/trusty/ibm-im# juju version 2.0-beta12-xenial-ppc64el

Shruthima commented 8 years ago

Could you please suggest what can be done to resolve this isuue ?

tvansteenburgh commented 8 years ago
  1. For the first error, find out what the url is, and why you're getting a proxy auth error. Are you behind a proxy? Try to curl the url manually from the same host.
  2. Try not running stuff as root, but instead as the user that installed juju.
Shruthima commented 8 years ago

In IRC we have received some comments for this issue, below are the details: lazyPower : "The tool merges referenced in that bug are still in flight and have not landed as best i can tell. We will certainly update bug 141 on amulet when everything has landed and is easy to install/upgrade. right now its a manual process and unless you know what you're doing can leave you in an inconsistent state." mup: "Bug #141: Revisions created with baz 1.1 are corrupt after archive-mirror <Baz (deprecated):Won't Fix> https://launchpad.net/bugs/141"

Shruthima commented 8 years ago

@tvansteenburgh : No it is not behind proxy we have checked. Url is cs:~ibmcharmers/trusty/ibm-im output of curl is showing as below : root@islrpbeixv685:~/charms/trusty/ibm-im# curl cs:~ibmcharmers/trusty/ibm-im-4 curl: (6) Could not resolve host: cs

lazypower commented 8 years ago

@Shruthima - that bug posted from MUP is a false positive. I was referring to this issue, which is #141, not the launchpad referenced 141, which is unrelated to Juju and the charm ecosystem.

Shruthima commented 8 years ago

Any updates please?

tvansteenburgh commented 8 years ago

Edit /usr/local/lib/python2.7/dist-packages/deployer/charm.py and put print(store_url) on line 214(ish) to find out what url is being accessed. Then curl that url from the host.

Is the second error still happening or did it go away when you upgraded juju-deployer?

Shruthima commented 8 years ago

Second error got resolved, after upgrading the juju deployer.

I have edited the charm.py it is printing the below URL: https://api.jujucharms.com/charmstore/charm/~ibmcharmers/trusty/ibm-im-4

Curl output: root@islrpbeixv685:~/charms/trusty/ibm-im# curl https://api.jujucharms.com/charmstore/charm/~ibmcharmers/trusty/ibm-im-4 {"Code":"macaroon discharge required","Message":"verification failed: no macaroon cookies in request","Info":{"Macaroon":{"caveats":[{"cid":"eyJUaGlyZFBhcnR5UHVibGljS2V5Ijoiby95T3FTTlduY01vMUdVUld1ZXovZEdSMzBUc2NtbXVJeGdqenRwb0hFWT0iLCJGaXJzdFBhcnR5UHVibGljS2V5IjoiUGRuVFlqM3FXdzZUQ0dkZXNHekdnVXo2ak9qSXV5dzRBTndUL3hTOXVDTT0iLCJOb25jZSI6IlNDSm0wTGM5SXM1dFB3elErZDRjMlg1ejJ1eWNUTnNaIiwiSWQiOiJKQVpzSkZ1YjF6NGxaUnhBNHJpSW1tdDUyZ0lxNS9xY0pqWHBOd0Q5eHFweDRpb1dYUFJEZ1RiVDUvKzZSemh0Wjl1RTJuOXh6SW82S0dlMWVwOEtacEZ1bldpT1VtaWw2ZVg5UUhHV2ZROTM5MU82eEUxMlRqOUl2OVhRT3c1Ti9oZEEzTlI3SW02WTg5WXFLM1dQVlZMZUttYWdxa0hEMUE9PSJ9","vid":"qS2BD8HrNsrzb7vy9sBFahTT4knsFmyfZrtGFVVNG1Ql63YHd30lf0h9OYYLtS-SIcF-G0x6fRFuOPRzNLYOiy3onBngKKiL","cl":"https://api.jujucharms.com/identity/v1/discharger"},{"cid":"allow read-with-terms"},{"cid":"time-before 2016-08-03T13:59:46.411957449Z"},{"cid":"is-entity cs:~ibmcharmers/trusty/ibm-im-4"},{"cid":"eyJUaGlyZFBhcnR5UHVibGljS2V5IjoiTGVVME14cU05VzNNNkN1cTZxNm5sd3ArU1c4R2hXTUpNNUtNSmY2QkxSaz0iLCJGaXJzdFBhcnR5UHVibGljS2V5IjoiUGRuVFlqM3FXdzZUQ0dkZXNHekdnVXo2ak9qSXV5dzRBTndUL3hTOXVDTT0iLCJOb25jZSI6ImpQZkVSME1ObWZid3VFNkhXMk1RSXdHSFVNSmxOcGZzIiwiSWQiOiJGc3Y2ekU0bXVaY2I3V3NVdXhQZnZaNHRYRVQ3cmZGRWJESzdQRXdKRENFb3Bhb1ZYc1RwcG42RW11R3FSYml4Q0EyTzd3amNwUmVYOTNMRXdwWUE5RWZvTDRGWW1aN0pLc3dYUEdqVWxhSjdMQnUvTHFhM3N5NGY5K2lEMTRHVCJ9","vid":"4K8_FpbCPvRWbxojRjw4LfsSOUGizvOD1s0vuJGiHeXEXDTnhCLUayLI4xlbPkIVqaiLtYYDbloRPSbdT711rR4lyzIYxKQ-","cl":"https://api.jujucharms.com/terms"}],"location":"charmstore","identifier":"0a12c2f48006ac867ca6034bf05ad828-47e988b8d3ec0ed419fa2508fd02db16","signature":"c992a7256ee5deb65bc1f8ccfe62bfdf9920eaaebc04d76ba50eb0beb79bf003"},"MacaroonPath":"../../../","CookieNameSuffix":"authz"}}

tvansteenburgh commented 8 years ago

Looks like the charm isn't publicly readable. Try:

charm grant ~ibmcharmers/trusty/ibm-im everyone
Shruthima commented 8 years ago

We are getting same error even after running charm grant command.

tvansteenburgh commented 8 years ago

It looks like the charm requires terms to be accepted, is that correct? We don't have support for accepting terms in amulet yet.

mbruzek commented 8 years ago

@tvansteenburgh yes this ibm-im charm does have a term attached to it.

$ juju deploy cs:~ibmcharmers/trusty/ibm-im
ERROR Declined: please agree to the following terms ibm-im/1. Try: "juju agree ibm-im/1"

@Shruthima I wonder if we can not work around this problem to unblock you. I see from your pastebins that you are using a root user to deploy these charms. The terms feature requires a log in to the charm store for a specific user tied to an UbuntuSSO account such as launchpad. You would issue the charm login command and verify there is a json key in the ~/.go-cookie for this user. If the user has already agreed to the charm juju list-agreements the amulet test may very well work without any more intervention. Please try this and pastebin the results if not successful.

charm login
juju list-agreements
juju agree ibm-im/1
juju list-agreements
python tests/10-deploy.py
Shruthima commented 8 years ago

@mbruzek : I have agreed the terms and deployed ibm-im from charm store in the same machine, it worked fine. But, when we try to deploy through amulet we are facing this issue. root@c277-pkvm-vm53:~/charms/trusty/ibm-im# charm login root@c277-pkvm-vm53:~/charms/trusty/ibm-im# juju list-agreements [ { "user": "salmavar", "term": "lorem-ipsum", "revision": 1, "created-on": "2016-06-09T15:03:10Z" }, { "user": "salmavar", "term": "ibm-im", "revision": 1, "created-on": "2016-07-18T05:33:07Z" } ] root@c277-pkvm-vm53:~/charms/trusty/ibm-im# juju agree ibm-im/1 Already agreed Commands output: http://paste.ubuntu.com/22181758/

shilkaul commented 8 years ago

@mbruzek: I did charm login and verified that ~/.go-cookie is generated. How can we verify that it has the corresponding json key for my user id ?.

Also I had one observation not specifically related to above issue, when we manually deploy the charm from charm store as shown below:

juju deploy cs:~ibmcharmers/trusty/ibm-platform-lsf-storage-8 --series=trusty, it throws the below error message and charm is not deployed: ERROR storing charm for URL "cs:~ibmcharmers/trusty/ibm-platform-lsf-storage-8": cannot unmarshal error response "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n\n400 Bad Request\n\n

Bad Request

\n

Your browser sent a request that this server could not understand.
\nSize of a request header field exceeds server limit.
\n

\nCookie\n
\n

\n
\n
Apache/2.4.7 (Ubuntu) Server at api.jujucharms.com Port 443
\n\n": invalid character '<' looking for beginning of value

Again I deploy the same charm, then I am not presented with this error again. After accepting the terms, my charm gets deployed successfully. Not sure if this is related to the issue we are getting in amulet.

mbruzek commented 8 years ago

@shilkaul You can use juju list-agreements to see the user id. I have not tried to look at the .go-cookies file myself.

As far as that new error, I would file a new issue against the Charm Store client for that one: https://github.com/juju/charmstore-client/issues as this seems to be an issue with the charm store response to juju deploy command. Be sure to list your juju version, and give them a reproducible example so they can fix this problem.