# Inconsistent of the registered data structure

**URL:** <https://forum.ansible.com/t/inconsistent-of-the-registered-data-structure/20493>\
**Category:** Ansible Project\
**Created:** [February 9, 2016, 5:13am UTC](https://forum.ansible.com/t/inconsistent-of-the-registered-data-structure/20493 "2016-02-09T05:13:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Steve\_Kieu1](https://avatars.discourse-cdn.com/v4/letter/s/f05b48/32.png) [@Steve\_Kieu1](https://forum.ansible.com/u/Steve_Kieu1)\
**Post date:** [February 9, 2016, 5:13am UTC](https://forum.ansible.com/t/inconsistent-of-the-registered-data-structure/20493/1 "2016-02-09T05:13:04Z")

</div>

Hi team,

With ansible 2 in mind …

The below playbook run fine

- name: add  
hosts: docker-host  
tasks:

- block:

- name: test  
shell: “su - jumbo -c ‘cd /tmp ; ls’”  
register: out  
failed\_when: “out.rc != 0”

- debug: “msg=‘out: {{out.rc}}’”

However I have another one

- name: test1-web-au  
hosts: test1-web-au  
tasks:

- block:

- name: make  
shell: “su - jumbo -c ‘cd {{SITE\_DIR}}/{{APP\_DIR}} && make’”  
register: result  
failed\_when: “result.rc != 0”

- debug: “msg=‘DEBUG: {{result}}’”

The second one give error:

fatal: [test1-web-au]: FAILED! =\> {“failed”: true, “msg”: “The conditional check ‘result.rc != 0’ failed. The error was: error while evaluating conditional (result.rc != 0): ‘dict object’ has no attribute ‘rc’”}

The only difference is that the make command ouput a lot of text. Somehow result.rc is not a value anymore, it is a dict. This is very inconsistent .

Trying to look into the debug message, clearly they have different keys

The one that is normal

“msg”: “DEBUG: {u’changed’: True, u’end’: u’2016-02-09 04:56:47.752599’, u’stdout’: u’behat\_style.xml\nbin\nbugfree.json\nbugfree-testing.json\ncache\ncomposer.json\ncomposer.lock\nconf\nconfig.rb\ndoc\ngrunt\nGruntfile.js\njibs\nkarma.conf.js\nlib\nlocale\nMakefile\nMakefile\_help.mak\nnode\_modules\nnpm-shrinkwrap.json\npackage.json\nphpunit.xml\nscripts\nscss\nskel\nsql\nsrc\nstyleguide\ntesting\ntmp\nvendor\nweb’, u’cmd’: u"su - jumbo -c ‘cd /www/sites/test1\_web\_au && ls’", u’start’: u’2016-02-09 04:56:47.701976’, u’delta’: u’0:00:00.050623’, u’stderr’: u’‘, u’rc’: 0, ‘stdout\_lines’: [u’behat\_style.xml’, u’bin’, u’bugfree.json’, u’bugfree-testing.json’, u’cache’, u’composer.json’, u’composer.lock’, u’conf’, u’config.rb’, u’doc’, u’grunt’, u’Gruntfile.js’, u’jibs’, u’karma.conf.js’, u’lib’, u’locale’, u’Makefile’, u’Makefile\_help.mak’, u’node\_modules’, u’npm-shrinkwrap.json’, u’package.json’, u’phpunit.xml’, u’scripts’, u’scss’, u’skel’, u’sql’, u’src’, u’styleguide’, u’testing’, u’tmp’, u’vendor’, u’web’], u’warnings’: [u"Consider using ‘become’, ‘become\_method’, and ‘become\_user’ rather than running su"]}”  
}

And the one with long output - the rc is in module\_stdout so to access this need result.module\_stdout.rc

“msg”: “DEBUG: {‘module\_stderr’: u’‘, ‘changed’: False, ‘module\_stdout’: u’{"changed": true, "end": "2016-02-09 04:53:09.033206", "stdout": "Installing dependences as per composer.lock.\\n\\u001b[30;43mWarning: This development build of composer is over 30 days old. It is recommended to update it by running \\"./bin/composer self-update\\" to get the latest version.\\u001b[39;49m\\n\\u001b[32mLoading composer repositories with package information\\u001b[39m\\n\\u001b[32mInstalling dependencies (including require-dev) from lock file\\u001b[39m\\nNothing to install or update\\n\\u001b[32mGenerating optimized autoload files\\u001b[39m\\nInstalling dependences as per composer.lock.\\n\\u001b[30;43mWarning: This development build of composer is over 30 days old. It is recommended to update it by running \\"./bin/composer self-update\\" to get the latest version.\\u001b[39;49m\\n\\u001b[32mLoading composer repositories with package information\\u001b[39m\\n\\u001b[32mInstalling dependencies (including require-dev) from lock file\\u001b[39m\\nNothing to install or update\\n\\u001b[32mGenerating optimized autoload files\\u001b[39m\\n - Checking for config updates\\n - Rebuilding css from scss\\n\\u001b[4mRunning \\"sass:dist\\" (sass) task\\u001b[24m\\n\\n\\u001b[32mDone, without errors.\\u001b[39m\\n\\n\\nExecution Time (2016-02-09 04:51:58 UTC)\\nsass:dist 1.9s \\u2587\\u2587\\u2587\\u2587\\u2587\\u2587\\u2587\\u2587\\u2587\\u2587\\u2587\\u2587\\u2587\\u2587\\u2587\\u2587\\u2587\\u2587\\u2587\\u2587\\u2587\\u2587\\u2587\\u2587\\u2587\\u2587\\u2587\\u2587\\u2587\\u2587\\u2587\\u2587\\u2587\\u2587\\u2587\\u2587\\u2587\\u2587\\u2587\\u2587\\u2587\\u2587\\u2587\\u2587\\u2587\\u2587\\u2587\\u2587\\u2587\\u2587\\u2587 100%\\nTotal 1.9s\\n\\n - Building meta based on current source.\\n\\r 1/8 [===\>------------------------] 12% Elapsed: 1 sec\\r 2/8 [=======\>--------------------] 25% Elapsed: 1 sec\\r 3/8 [==========\>-----------------] 37% Elapsed: 1 sec\\r 4/8 [==============\>-------------] 50% Elapsed: 1 sec\\r 5/8 [=================\>----------] 62% Elapsed: 1 sec\\r 6/8 [=====================\>------] 75% Elapsed: 1 sec\\r 7/8 [========================\>—] 87% Elapsed: 1 sec\\r 8/8 [============================] 100% Elapsed: 1 sec\\n - Building one ugly javascript file per site variant\\n\\r 1/3 [=========\>------------------] 33% Elapsed: 1 sec Building: pub.AU \\r 2/3 [==================\>---------] 66% Elapsed: 6 secs Building: admin.AU \\r 3/3 [============================] 100% Elapsed: 14 secs \\n - Building one ugly css file per site variant\\n\\r 1/1 [============================] 100% Elapsed: 1 sec\\n - Building swagger based on current meta.\\n\\r 1/7 [====\>-----------------------] 14% Elapsed: 1 sec\\r 2/7 [========\>-------------------] 28% Elapsed: 1 sec\\r 3/7 [============\>---------------] 42% Elapsed: 1 sec\\r 4/7 [================\>-----------] 57% Elapsed: 1 sec\\r 5/7 [====================\>-------] 71% Elapsed: 1 sec\\r 6/7 [========================\>—] 85% Elapsed: 1 sec\\r 7/7 [============================] 100% Elapsed: 1 sec\\n - Config sanity check.\\n - building apache vhosts.\\n - Restarting apache: - Building meta based on current source.\\n\\r 1/8 [===\>------------------------] 12% Elapsed: 1 sec\\r 2/8 [=======\>--------------------] 25% Elapsed: 1 sec\\r 3/8 [==========\>-----------------] 37% Elapsed: 1 sec\\r 4/8 [==============\>-------------] 50% Elapsed: 1 sec\\r 5/8 [=================\>----------] 62% Elapsed: 1 sec\\r 6/8 [=====================\>------] 75% Elapsed: 2 secs\\r 7/8 [========================\>—] 87% Elapsed: 2 secs\\r 8/8 [============================] 100% Elapsed: 2 secs\\n-- node 1 –\\n No updates found\\n-- node 2 –\\n No updates found\\n-- node 3 –\\n No updates found\\n-- node 4 –\\n No updates found\\n-- node 128 –\\n No updates found\\n-- admin –\\n No updates found\\n-- cart –\\n No updates found\\n-- affiliate –\\n No updates found\\n-- metrics –\\n No updates found\\n - Creating sitemaps\\nInstalling dependences as per composer.lock.\\n\\u001b[30;43mWarning: This development build of composer is over 30 days old. It is recommended to update it by running \\"./bin/composer self-update\\" to get the latest version.\\u001b[39;49m\\n\\u001b[32mLoading composer repositories with package information\\u001b[39m\\n\\u001b[32mInstalling dependencies (including require-dev) from lock file\\u001b[39m\\nNothing to install or update\\n\\u001b[32mGenerating optimized autoload files\\u001b[39m\\n - Restarting all daemons\\n - customer-locator (disabled)\\n - event-hub (running 9344)\\n - restart customer-locator\\n - restart event-hub\\n - customer-locator (disabled)\\n - event-hub (running 10125)\\n - Flushing web nodes.\\n - Initialising perl database cache.", "cmd": "su - jumbo -c \‘cd /www/sites/test1\_web\_au && make\’", "rc": 0, "start": "2016-02-09 04:51:15.791037", "stderr": "DEPRECATION WARNING: Passing 100%, a non-string value, to unquote()\\nwill be an error in future versions of Sass.\\n on line 27 of /www/sites/base\_web/scss/bourbon/helpers/\_deprecated-webkit-gradient.scss\\nDEPRECATION WARNING: Passing 100%, a non-string value, to unquote()\\nwill be an error in future versions of Sass.\\n on line 27 of /www/sites/base\_web/scss/bourbon/helpers/\_deprecated-webkit-gradient.scss\\nDEPRECATION WARNING: Passing 100%, a non-string value, to unquote()\\nwill be an error in future versions of Sass.\\n on line 27 of /www/sites/base\_web/scss/bourbon/helpers/\_deprecated-webkit-gradient.scss\\nDEPRECATION WARNING: Passing 100%, a non-string value, to unquote()\\nwill be an error in future versions of Sass.\\n on line 27 of /www/sites/base\_web/scss/bourbon/helpers/\_deprecated-webkit-gradient.scss\\nDEPRECATION WARNING: Passing 100%, a non-string value, to unquote()\\nwill be an error in future versions of Sass.\\n on line 27 of /www/sites/base\_web/scss/bourbon/helpers/\_deprecated-webkit-gradient.scss\\nDEPRECATION WARNING: Passing 100%, a non-string value, to unquote()\\nwill be an error in future versions of Sass.\\n on line 27 of /www/sites/base\_web/scss/bourbon/helpers/\_deprecated-webkit-gradient.scss\\nDEPRECATION WARNING: Passing 100%, a non-string value, to unquote()\\nwill be an error in future versions of Sass.\\n on line 27 of /www/sites/base\_web/scss/bourbon/helpers/\_deprecated-webkit-gradient.scss\\nDEPRECATION WARNING: Passing 100%, a non-string value, to unquote()\\nwill be an error in future versions of Sass.\\n on line 27 of /www/sites/base\_web/scss/bourbon/helpers/\_deprecated-webkit-gradient.scss\\nDEPRECATION WARNING: Passing 100%, a non-string value, to unquote()\\nwill be an error in future versions of Sass.\\n on line 27 of /www/sites/base\_web/scss/bourbon/helpers/\_deprecated-webkit-gradient.scss\\nDEPRECATION WARNING: Passing 100%, a non-string value, to unquote()\\nwill be an error in future versions of Sass.\\n on line 27 of /www/sites/base\_web/scss/bourbon/helpers/\_deprecated-webkit-gradient.scss\\nDEPRECATION WARNING: Passing 100%, a non-string value, to unquote()\\nwill be an error in future versions of Sass.\\n on line 27 of /www/sites/base\_web/scss/bourbon/helpers/\_deprecated-webkit-gradient.scss\\nDEPRECATION WARNING: Passing 100%, a non-string value, to unquote()\\nwill be an error in future versions of Sass.\\n on line 27 of /www/sites/base\_web/scss/bourbon/helpers/\_deprecated-webkit-gradient.scss\\nDEPRECATION WARNING: Passing 100%, a non-string value, to unquote()\\nwill be an error in future versions of Sass.\\n on line 27 of /www/sites/base\_web/scss/bourbon/helpers/\_deprecated-webkit-gradient.scss\\nDEPRECATION WARNING: Passing 100%, a non-string value, to unquote()\\nwill be an error in future versions of Sass.\\n on line 27 of /www/sites/base\_web/scss/bourbon/helpers/\_deprecated-webkit-gradient.scss\\nDEPRECATION WARNING: Passing 100%, a non-string value, to unquote()\\nwill be an error in future versions of Sass.\\n on line 27 of /www/sites/base\_web/scss/bourbon/helpers/\_deprecated-webkit-gradient.scss\\nDEPRECATION WARNING: Passing 100%, a non-string value, to unquote()\\nwill be an error in future versions of Sass.\\n on line 27 of /www/sites/base\_web/scss/bourbon/helpers/\_deprecated-webkit-gradient.scss\\nDEPRECATION WARNING: Passing 100%, a non-string value, to unquote()\\nwill be an error in future versions of Sass.\\n on line 27 of /www/sites/base\_web/scss/bourbon/helpers/\_deprecated-webkit-gradient.scss\\nDEPRECATION WARNING: Passing 100%, a non-string value, to unquote()\\nwill be an error in future versions of Sass.\\n on line 27 of /www/sites/base\_web/scss/bourbon/helpers/\_deprecated-webkit-gradient.scss\\nDEPRECATION WARNING: Passing 100%, a non-string value, to unquote()\\nwill be an error in future versions of Sass.\\n on line 27 of /www/sites/base\_web/scss/bourbon/helpers/\_deprecated-webkit-gradient.scss\\nDEPRECATION WARNING: Passing 100%, a non-string value, to unquote()\\nwill be an error in future versions of Sass.\\n on line 27 of /www/sites/base\_web/scss/bourbon/helpers/\_deprecated-webkit-gradient.scss\\nDEPRECATION WARNING: Passing 100%, a non-string value, to unquote()\\nwill be an error in future versions of Sass.\\n on line 27 of /www/sites/base\_web/scss/bourbon/helpers/\_deprecated-webkit-gradient.scss\\nDEPRECATION WARNING: Passing 100%, a non-string value, to unquote()\\nwill be an error in future versions of Sass.\\n on line 27 of /www/sites/base\_web/scss/bourbon/helpers/\_deprecated-webkit-gradient.scss\\nDEPRECATION WARNING: Passing 100%, a non-string value, to unquote()\\nwill be an error in future versions of Sass.\\n on line 27 of /www/sites/base\_web/scss/bourbon/helpers/\_deprecated-webkit-gradient.scss\\nDEPRECATION WARNING: Passing 100%, a non-string value, to unquote()\\nwill be an error in future versions of Sass.\\n on line 27 of /www/sites/base\_web/scss/bourbon/helpers/\_deprecated-webkit-gradient.scss\\nDEPRECATION WARNING: Passing 100%, a non-string value, to unquote()\\nwill be an error in future versions of Sass.\\n on line 27 of /www/sites/base\_web/scss/bourbon/helpers/\_deprecated-webkit-gradient.scss\\nDEPRECATION WARNING: Passing 100%, a non-string value, to unquote()\\nwill be an error in future versions of Sass.\\n on line 27 of /www/sites/base\_web/scss/bourbon/helpers/\_deprecatedclose failed in file object destructor:\r\nError in sys.excepthook:\r\n\r\nOriginal exception was:\r\n’, ‘failed’: True, ‘msg’: u’MODULE FAILURE’, ‘parsed’: False}”  
}

I think it is a bug.

please let me know what I am doing wrong, or I will file a bug report.

Kind regards

---

<div class="post-metadata">

**Author:** ![Steve\_Kieu1](https://avatars.discourse-cdn.com/v4/letter/s/f05b48/32.png) [@Steve\_Kieu1](https://forum.ansible.com/u/Steve_Kieu1)\
**Post date:** [February 9, 2016, 5:29am UTC](https://forum.ansible.com/t/inconsistent-of-the-registered-data-structure/20493/2 "2016-02-09T05:29:15Z")

</div>

Apart from that problems ansible gives error after running the make command even though the make command exit status is 0 (Manually login and run make and check exit status is 0.

Ansibel says something like

Error in sys.excepthook:\r\n\r\nOriginal exception was:\r\n"

I guess that ansible has a buffer limit size of the command output, and when output is truncated the object re-contructions is wrong and got error thus can explain there is no key rc in tehre and ansibel gives error.

---

<div class="post-metadata">

**Author:** ![Steve\_Kieu1](https://avatars.discourse-cdn.com/v4/letter/s/f05b48/32.png) [@Steve\_Kieu1](https://forum.ansible.com/u/Steve_Kieu1)\
**Post date:** [February 9, 2016, 5:51am UTC](https://forum.ansible.com/t/inconsistent-of-the-registered-data-structure/20493/3 "2016-02-09T05:51:47Z")

</div>

I confirmed that the too long output (or maybe some special characters in there ) caused the problems.

I just redirect the make command to /dev/null and things started to work properly.

Is it a known problems? Should I file bug report?

Thanks

---

<div class="post-metadata">

**Author:** ![Alex\_Leonhardt](https://avatars.discourse-cdn.com/v4/letter/a/ec9cab/32.png) [@Alex\_Leonhardt](https://forum.ansible.com/u/Alex_Leonhardt)\
**Post date:** [February 9, 2016, 6:06am UTC](https://forum.ansible.com/t/inconsistent-of-the-registered-data-structure/20493/4 "2016-02-09T06:06:13Z")

</div>

Hi, nice catch! Sounds like a bug to me, I’ve also seen similar behaviour but as my output wasn’t consistently getting past whatever the buffer is, I wasn’t able to reliably reproduce it.

That what’s being returned changes is very irritating and should be fixed.

Alex

---

<div class="post-metadata">

**Author:** ![Steve\_Kieu1](https://avatars.discourse-cdn.com/v4/letter/s/f05b48/32.png) [@Steve\_Kieu1](https://forum.ansible.com/u/Steve_Kieu1)\
**Post date:** [February 9, 2016, 6:20am UTC](https://forum.ansible.com/t/inconsistent-of-the-registered-data-structure/20493/5 "2016-02-09T06:20:00Z")

</div>

> > Hi,

Not sure if the stdout or stderr are different but I saw one command with much larger output than the make command and it is fine.

However I can consistently fail it using my make command and something in stdout that mess it up.
