Lou
Lou

Reputation: 166

tower-cli : keyerror extra_credentials

I am trying to export every assets from an Ansible Tower instance with tower-cli receive --all > received.json, but this command gets me the following error :

Traceback (most recent call last):
  File "/usr/bin/tower-cli", line 9, in <module>
    load_entry_point('ansible-tower-cli==3.3.6', 'console_scripts', 'tower-cli')()
  File "/usr/lib64/python2.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib64/python2.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python2.7/site-packages/tower_cli/cli/base.py", line 129, in invoke
    return super(TowerCLI, self).invoke(ctx)
  File "/usr/lib64/python2.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib64/python2.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib64/python2.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/tower_cli/conf.py", line 373, in method_with_context_managed
    method(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/tower_cli/cli/misc.py", line 332, in receive
    receiver.receive(all=all, asset_input=assets_to_export)
  File "/usr/lib/python2.7/site-packages/tower_cli/cli/transfer/receive.py", line 12, in receive
    exported_objects = self.export_assets(all, asset_input)
  File "/usr/lib/python2.7/site-packages/tower_cli/cli/transfer/receive.py", line 102, in export_assets
    common.extract_extra_credentials(asset)['items']
  File "/usr/lib/python2.7/site-packages/tower_cli/cli/transfer/common.py", line 426, in extract_extra_credentials
    extra_credentials = load_all_assets(asset['related']['extra_credentials'])
KeyError: 'extra_credentials'

I have not found anything about this specific error anywhere. I am logged in tower-cli with an admin account which is granted of every permissions.

Upvotes: 0

Views: 221

Answers (1)

aaron
aaron

Reputation: 21

I came across the same issue today. This is probably not a fix but here is how I got around it:

cd /usr/lib/python2.7/site-packages/tower_cli/cli/transfer
grep -ri 'extra_credentials' 

Comment out all references to extra_credentials in the files that it shows up in. For me it was these two:

/usr/lib/python2.7/site-packages/tower_cli/cli/transfer/common.py 
/usr/lib/python2.7/site-packages/tower_cli/cli/transfer/receive.py

Re-execute your receive command (This probably just ignores the extra_credentials, which I didn't need anyway so it is not a complete fix)

Upvotes: 2

Related Questions