Skip to content

Fix ansible python dictionary error #5225

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

Merged
merged 1 commit into from
May 7, 2022

Conversation

hunhoffe
Copy link
Contributor

Description

When I would run the command below:

ansible-playbook -i environments/$ENVIRONMENT openwhisk.yml -e db_activation_backend=ElasticSearch

I would get this CLI error:

TASK [cli : Download release archive to build directory ...] ***********************************************************************************************************************************************
Tuesday 22 March 2022  14:56:04 -0600 (0:00:00.397)       0:02:33.675 ********* 
fatal: [172.17.0.1]: FAILED! => {"changed": false, "msg": "argument 'headers' is of type <class 'str'> and we were unable to convert to dict: dictionary requested, could not parse JSON or key=value"}

argument 'headers' is of type <class 'str'> and we were unable to convert
to dict: dictionary requested, could not parse JSON or key=value. 

I tested my solution in my local ansible setup.

Related issue and scope

My changes affect the following components

  • API
  • Controller
  • Message Bus (e.g., Kafka)
  • Loadbalancer
  • Scheduler
  • Invoker
  • Intrinsic actions (e.g., sequences, conductors)
  • Data stores (e.g., CouchDB)
  • Tests
  • Deployment
  • CLI
  • General tooling
  • Documentation

Types of changes

  • Bug fix (generally a non-breaking change which closes an issue).
  • Enhancement or new feature (adds new functionality).
  • Breaking change (a bug fix or enhancement which changes existing behavior).

Checklist:

  • I signed an Apache CLA.
  • I reviewed the style guides and followed the recommendations (Travis CI will check :).
  • I added tests to cover my changes.
  • My changes require further changes to the documentation.
  • I updated the documentation where necessary.

@codecov-commenter
Copy link

codecov-commenter commented Apr 26, 2022

Codecov Report

Merging #5225 (32fd2be) into master (3e3414c) will increase coverage by 28.52%.
The diff coverage is n/a.

@@             Coverage Diff             @@
##           master    #5225       +/-   ##
===========================================
+ Coverage   44.49%   73.01%   +28.52%     
===========================================
  Files         238      238               
  Lines       13957    13957               
  Branches      570      570               
===========================================
+ Hits         6210    10191     +3981     
+ Misses       7747     3766     -3981     
Impacted Files Coverage Δ
...whisk/connector/kafka/KafkaConsumerConnector.scala 59.15% <0.00%> (-22.54%) ⬇️
.../scala/org/apache/openwhisk/utils/Exceptions.scala 20.00% <0.00%> (-20.00%) ⬇️
...whisk/connector/kafka/KafkaProducerConnector.scala 60.00% <0.00%> (-20.00%) ⬇️
...apache/openwhisk/core/ack/MessagingActiveAck.scala 58.33% <0.00%> (-8.34%) ⬇️
...pache/openwhisk/core/invoker/InvokerReactive.scala 72.44% <0.00%> (-0.79%) ⬇️
.../org/apache/openwhisk/core/entity/EntityPath.scala 100.00% <0.00%> (+1.88%) ⬆️
...la/org/apache/openwhisk/common/TransactionId.scala 94.38% <0.00%> (+2.24%) ⬆️
.../org/apache/openwhisk/http/PoolingRestClient.scala 90.90% <0.00%> (+3.03%) ⬆️
...sk/core/containerpool/docker/DockerContainer.scala 95.60% <0.00%> (+3.29%) ⬆️
...in/scala/org/apache/openwhisk/common/Logging.scala 78.63% <0.00%> (+3.63%) ⬆️
... and 130 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3e3414c...32fd2be. Read the comment docs.

@jiangpengcheng jiangpengcheng merged commit 9a39c10 into apache:master May 7, 2022
@hunhoffe hunhoffe deleted the ansible-dictionary-error branch July 11, 2022 03:02
@style95
Copy link
Member

style95 commented Jul 20, 2022

@hunhoffe Hey, could you share which version of ansible did you use when you faced this issue?

@hunhoffe
Copy link
Contributor Author

hunhoffe commented Jul 21, 2022

@style95 It was ansible 4.1.0, the one recommended in the ansible docs: https://github.com/apache/openwhisk/tree/master/ansible

@style95
Copy link
Member

style95 commented Jul 22, 2022

ok.
It seems there are some mismatches.
The ansible README instructs to use ansible-4.1.0 while some parts are still sticking to ansible-2.5.2.

This change is not compatible with ansible-2.5.2.
We need to fully migrate to one of the versions but I am unsure ansible 4.1.0 works well in all environments(ubuntu, docker-for-mac, docker-machine, etc).

@hunhoffe
Copy link
Contributor Author

hunhoffe commented Jul 24, 2022

Yes, I had opened an issue about version inconsistencies: #5203

But have not gotten around to creating a PR for it, in part because I'm not sure all the environments I'd need to verify, or my questions at the end regarding if there are any other upgrades (e.g., python3 instead of python2 for some of the scripts) that are desired.

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

Successfully merging this pull request may close these issues.

5 participants