amulet icon indicating copy to clipboard operation
amulet copied to clipboard

Errors while deploying amulet

Open Shruthima opened this issue 8 years ago • 20 comments

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/

Shruthima avatar Jul 07 '16 07:07 Shruthima

@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.

tvansteenburgh avatar Jul 07 '16 13:07 tvansteenburgh

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

Shruthima avatar Jul 11 '16 06:07 Shruthima

Any updates on this issue ?

Shruthima avatar Jul 18 '16 09:07 Shruthima

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

tvansteenburgh avatar Jul 18 '16 14:07 tvansteenburgh

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 avatar Jul 19 '16 07:07 Shruthima

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

Shruthima avatar Jul 21 '16 04:07 Shruthima

  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.

tvansteenburgh avatar Jul 21 '16 14:07 tvansteenburgh

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 avatar Jul 27 '16 09:07 Shruthima

@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

Shruthima avatar Jul 27 '16 11:07 Shruthima

@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.

lazypower avatar Jul 27 '16 22:07 lazypower

Any updates please?

Shruthima avatar Aug 03 '16 05:08 Shruthima

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?

tvansteenburgh avatar Aug 03 '16 12:08 tvansteenburgh

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"}}

Shruthima avatar Aug 03 '16 14:08 Shruthima

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

charm grant ~ibmcharmers/trusty/ibm-im everyone

tvansteenburgh avatar Aug 03 '16 15:08 tvansteenburgh

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

Shruthima avatar Aug 04 '16 05:08 Shruthima

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

tvansteenburgh avatar Aug 04 '16 13:08 tvansteenburgh

@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

mbruzek avatar Aug 04 '16 13:08 mbruzek

@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/

Shruthima avatar Aug 04 '16 14:08 Shruthima

@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 "\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.

shilkaul avatar Aug 05 '16 10:08 shilkaul

@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.

mbruzek avatar Aug 05 '16 15:08 mbruzek