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

--user-data is broken if file contains non-utf-8 characters #814

Closed
guss77 opened this issue Jun 16, 2014 · 2 comments · Fixed by #1010
Closed

--user-data is broken if file contains non-utf-8 characters #814

guss77 opened this issue Jun 16, 2014 · 2 comments · Fixed by #1010
Labels
bug This issue is a bug.

Comments

@guss77
Copy link

guss77 commented Jun 16, 2014

Basically the same as issue #765 - after the fix, the file apparently can take UTF-8 encoded text files, but if I try to use a GZIP compressed file (because user-data is limited to 16KB, and compressing the data to workaround the limit is a valid practice and works great with the old Java based tools), then I get the following error:

'utf8' codec can't decode byte 0x8b in position 1: invalid start byte
@guss77
Copy link
Author

guss77 commented Jun 16, 2014

Running with --debug:

2014-06-16 16:30:30,517 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.ec2.run-instances.UserData: calling handler <function uri_param at 0x7fccb2c1ade8>
2014-06-16 16:30:30,518 - MainThread - awscli.clidriver - DEBUG - Exception caught in main()
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/awscli/clidriver.py", line 191, in main
    return command_table[parsed_args.command](remaining, parsed_args)
  File "/usr/local/lib/python2.7/dist-packages/awscli/clidriver.py", line 338, in __call__
    return command_table[parsed_args.operation](remaining, parsed_globals)
  File "/usr/local/lib/python2.7/dist-packages/awscli/clidriver.py", line 443, in __call__
    self.arg_table)
  File "/usr/local/lib/python2.7/dist-packages/awscli/clidriver.py", line 470, in _build_call_parameters
    value = self._unpack_arg(arg_object, value)
  File "/usr/local/lib/python2.7/dist-packages/awscli/clidriver.py", line 486, in _unpack_arg
param, value)
  File "/usr/local/lib/python2.7/dist-packages/awscli/argprocess.py", line 66, in unpack_argument
    operation_name=operation_name)
  File "/usr/local/lib/python2.7/dist-packages/botocore/session.py", line 657, in emit_first_non_none_response
    responses = self._events.emit(event_name, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/botocore/hooks.py", line 148, in emit
    response = handler(**kwargs)
  File "/usr/local/lib/python2.7/dist-packages/awscli/argprocess.py", line 83, in uri_param
    return _check_for_uri_param(param, value)
  File "/usr/local/lib/python2.7/dist-packages/awscli/argprocess.py", line 90, in _check_for_uri_param
    return get_paramfile(value)
  File "/usr/local/lib/python2.7/dist-packages/awscli/paramfile.py", line 44, in get_paramfile
    data = PrefixMap[prefix](prefix, path)
  File "/usr/local/lib/python2.7/dist-packages/awscli/paramfile.py", line 56, in get_file
    return f.read()
  File "/usr/lib/python2.7/codecs.py", line 296, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf8' codec can't decode byte 0x8b in position 1: invalid start byte
2014-06-16 16:30:30,526 - MainThread - awscli.clidriver - DEBUG - Exiting with rc 255

I'm running with:

$ aws --version
aws-cli/1.3.17 Python/2.7.6 Linux/3.13.0-30-generic

@spazm
Copy link

spazm commented Aug 19, 2014

+1 also affected.

spazm pushed a commit to spazm/aws-cli that referenced this issue Aug 21, 2014
spazm pushed a commit to spazm/aws-cli that referenced this issue Aug 21, 2014
spazm pushed a commit to spazm/aws-cli that referenced this issue Aug 21, 2014
spazm pushed a commit to spazm/aws-cli that referenced this issue Aug 21, 2014
spazm pushed a commit to spazm/aws-cli that referenced this issue Aug 21, 2014
spazm pushed a commit to spazm/aws-cli that referenced this issue Aug 21, 2014
spazm pushed a commit to spazm/aws-cli that referenced this issue Aug 21, 2014
Testing to see if this breaks pyyhon3.3 tests.

This reverts commit e1f20c0.
spazm added a commit to spazm/aws-cli that referenced this issue Aug 21, 2014
spazm pushed a commit to spazm/aws-cli that referenced this issue Aug 21, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants