Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error while trying to update cluster with post_install script #495

Closed
karlvirgil opened this issue Aug 23, 2018 · 5 comments
Closed

error while trying to update cluster with post_install script #495

karlvirgil opened this issue Aug 23, 2018 · 5 comments
Labels

Comments

@karlvirgil
Copy link

I'm trying to update an existing cfncluster to add a post_install script. When I do, I get this error message.

$ )cfncluster update meredithk-efs4
Updating: meredithk-efs4
Traceback (most recent call last):
File "/usr/bin/cfncluster", line 9, in
load_entry_point('cfncluster==1.5.3', 'console_scripts', 'cfncluster')()
File "/usr/lib/python2.7/site-packages/cfncluster/cli.py", line 204, in main
args.func(args)
File "/usr/lib/python2.7/site-packages/cfncluster/cli.py", line 46, in update
cfncluster.update(args)
File "/usr/lib/python2.7/site-packages/cfncluster/cfncluster.py", line 167, in update
Parameters=cfn_params, Capabilities=capabilities)
File "/usr/lib/python2.7/site-packages/botocore/client.py", line 314, in _api_call
return self._make_api_call(operation_name, kwargs)
File "/usr/lib/python2.7/site-packages/botocore/client.py", line 599, in _make_api_call
operation_model, request_dict)
File "/usr/lib/python2.7/site-packages/botocore/endpoint.py", line 148, in make_request
return self._send_request(request_dict, operation_model)
File "/usr/lib/python2.7/site-packages/botocore/endpoint.py", line 173, in _send_request
request = self.create_request(request_dict, operation_model)
File "/usr/lib/python2.7/site-packages/botocore/endpoint.py", line 157, in create_request
operation_name=operation_model.name)
File "/usr/lib/python2.7/site-packages/botocore/hooks.py", line 227, in emit
return self._emit(event_name, kwargs)
File "/usr/lib/python2.7/site-packages/botocore/hooks.py", line 360, in _emit
aliased_event_name, kwargs, stop_on_response
File "/usr/lib/python2.7/site-packages/botocore/hooks.py", line 210, in _emit
response = handler(**kwargs)
File "/usr/lib/python2.7/site-packages/botocore/signers.py", line 90, in handler
return self.sign(operation_name, request)
File "/usr/lib/python2.7/site-packages/botocore/signers.py", line 156, in sign
auth.add_auth(request)
File "/usr/lib/python2.7/site-packages/botocore/auth.py", line 358, in add_auth
canonical_request = self.canonical_request(request)
File "/usr/lib/python2.7/site-packages/botocore/auth.py", line 305, in canonical_request
body_checksum = self.payload(request)
File "/usr/lib/python2.7/site-packages/botocore/auth.py", line 267, in payload
if request.body and hasattr(request.body, 'seek'):
File "/usr/lib/python2.7/site-packages/botocore/awsrequest.py", line 378, in body
p.prepare_body(self.data, self.files)
File "/usr/lib/python2.7/site-packages/botocore/vendored/requests/models.py", line 456, in prepare_body
body = self._encode_params(data)
File "/usr/lib/python2.7/site-packages/botocore/vendored/requests/models.py", line 97, in _encode_params
return urlencode(result, doseq=True)
File "/usr/lib64/python2.7/urllib.py", line 1332, in urlencode
v = quote_plus(v)
File "/usr/lib64/python2.7/urllib.py", line 1289, in quote_plus
return quote(s, safe)
File "/usr/lib64/python2.7/urllib.py", line 1282, in quote
return ''.join(map(quoter, s))
KeyError: 104

Seems it doesn't like the format of my url. I can't see anything wrong with it. In fact, the url pulls just fine from s3:

$)wget https://684353139040-cfncluster.s3.amazonaws.com/scripts/mount_efs.sh
--2018-08-23 10:22:39-- https://684353139040-cfncluster.s3.amazonaws.com/scripts/mount_efs.sh
Resolving 684353139040-cfncluster.s3.amazonaws.com (684353139040-cfncluster.s3.amazonaws.com)... 52.216.82.136
Connecting to 684353139040-cfncluster.s3.amazonaws.com (684353139040-cfncluster.s3.amazonaws.com)|52.216.82.136|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 695 [text/x-sh]
Saving to: 'mount_efs.sh.1'

100%[==============================================================>] 695 --.-K/s in 0s

2018-08-23 10:22:39 (17.7 MB/s) - 'mount_efs.sh.1' saved [695/695]

My config file is attached
config.txt

@sean-smith
Copy link
Contributor

sean-smith commented Aug 23, 2018

This isn't your post_install script's url. It's the url created by boto for the cloudformation update api call. It's failing to url encode one of the parameters and it's unclear what parameter that is.

I'm reproducing the issue now.

@sean-smith sean-smith added the bug label Aug 23, 2018
@sean-smith
Copy link
Contributor

Ok, I was able to reproduce the issue.

@sean-smith
Copy link
Contributor

ok, I've created a pull request with the fix. Will be in the next release of cfncluster.

@karlvirgil
Copy link
Author

Can I manually patch my cfncluster installation or do I need to wait for the next release? If next release, how far away is that?

@sean-smith
Copy link
Contributor

You can use the latest version. Just do:

git clone https://github.com/awslabs/cfncluster.git
cd cfncluster/cli
python setup.py develop

You'll want to do this in a python virtualenvironment so it doesn't interfere with your globally installed cfncluster. I recommend https://virtualenvwrapper.readthedocs.io/en/latest/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants