{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/awx/issues/705","repository_url":"https://api.github.com/repos/ansible/awx","labels_url":"https://api.github.com/repos/ansible/awx/issues/705/labels{/name}","comments_url":"https://api.github.com/repos/ansible/awx/issues/705/comments","events_url":"https://api.github.com/repos/ansible/awx/issues/705/events","html_url":"https://github.com/ansible/awx/issues/705","id":276474402,"number":705,"title":"CloudForms inventory import fails with django.core.exceptions.ValidationError","user":{"login":"rbywater","id":384963,"avatar_url":"https://avatars0.githubusercontent.com/u/384963?v=4","gravatar_id":"","url":"https://api.github.com/users/rbywater","html_url":"https://github.com/rbywater","followers_url":"https://api.github.com/users/rbywater/followers","following_url":"https://api.github.com/users/rbywater/following{/other_user}","gists_url":"https://api.github.com/users/rbywater/gists{/gist_id}","starred_url":"https://api.github.com/users/rbywater/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rbywater/subscriptions","organizations_url":"https://api.github.com/users/rbywater/orgs","repos_url":"https://api.github.com/users/rbywater/repos","events_url":"https://api.github.com/users/rbywater/events{/privacy}","received_events_url":"https://api.github.com/users/rbywater/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-11-23T21:30:19Z","updated_at":"2017-11-24T14:32:35Z","closed_at":null,"author_association":"NONE","body":"##### ISSUE TYPE\r\n<!--- Pick one below and delete the rest: -->\r\n - Bug Report\r\n\r\n##### COMPONENT NAME\r\n<!-- Pick the area of AWX for this issue, you can have multiple, delete the rest: -->\r\n - API\r\n\r\n##### SUMMARY\r\n<!-- Briefly describe the problem. -->\r\nCloudForms inventory import fails with django.core.exceptions.ValidationError. Have tried with both a \"normal\" Cloudforms user credential and an \"admin\" one but same result both times.\r\n\r\n##### ENVIRONMENT\r\n* AWX version: 1.0.1.225 \r\n* AWX install method: docker for mac\r\n* Ansible version:  2.4.1\r\n* Operating System: MacOS 10.12.6\r\n* Web Browser: Chrome 62\r\n* Cloudforms: 4.2 (Management engine Version 5.7.3.2.20170621144854_6c833cc)\r\n\r\n##### STEPS TO REPRODUCE\r\n\r\n<!-- For bugs, please show exactly how to reproduce the problem. For new\r\nfeatures, show how the feature would be used.  -->\r\n\r\n1. Create new inventory source with source type of Red Hat Cloudforms\r\n2. Run sync\r\n\r\n##### EXPECTED RESULTS\r\n\r\n<!-- For bug reports, what did you expect to happen when running the steps\r\nabove? -->\r\n\r\n* Inventory import successfully completes.\r\n\r\n##### ACTUAL RESULTS\r\n\r\n<!-- For bug reports, what actually happened? -->\r\n\r\n* Inventory import fails with \"django.core.exceptions.ValidationError: [u\\\"'<object object at 0x7830fe0>' value must be either True or False.\\\"]\" error\r\n\r\n##### ADDITIONAL INFORMATION\r\n\r\n<!-- Include any links to sosreport, database dumps, screenshots or other\r\ninformation. -->\r\nLog file:\r\n```\r\n2017-11-23 01:44:04,433 INFO     awx.main.commands.inventory_import Updating inventory 2: CF\r\n2017-11-23 01:44:04,472 INFO     awx.main.commands.inventory_import Reading Ansible inventory source: /usr/lib/python2.7/site-packages/awx/plugins/inventory/cloudforms.py\r\n2017-11-23 01:44:34,698 INFO     awx.main.commands.inventory_import Processing JSON output...\r\n2017-11-23 01:44:34,720 INFO     awx.main.commands.inventory_import Loaded 322 groups, 266 hosts\r\n...\r\n2017-11-23 01:44:34,739 WARNING  awx.main.commands.inventory_import Host \\\"<redacted1>\\\" has no \\\"id\\\" variable\r\n2017-11-23 01:44:34,739 WARNING  awx.main.commands.inventory_import Host \\\"<redacted2>\\\" has no \\\"id\\\" variable\r\n2017-11-23 01:44:34,739 WARNING  awx.main.commands.inventory_import Host \\\"<redacted3>\\\" has no \\\"id\\\" variable\r\n...\r\n2017-11-23 01:44:38,254 INFO     awx.main.commands.inventory_import Group \\\"<redacted4>_ovf\\\" added\r\n2017-11-23 01:44:38,261 INFO     awx.main.commands.inventory_import Group \\\"<redacted5>_ovf\\\" added\r\n2017-11-23 01:44:38,269 INFO     awx.main.commands.inventory_import Group \\\"location\\\" added\r\n2017-11-23 01:44:38,276 INFO     awx.main.commands.inventory_import Group \\\"redhat\\\" added\r\n2017-11-23 01:44:38,283 INFO     awx.main.commands.inventory_import Group \\\"tags\\\" added\r\n2017-11-23 01:44:38,290 INFO     awx.main.commands.inventory_import Group \\\"type\\\" added\r\n2017-11-23 01:44:38,298 INFO     awx.main.commands.inventory_import Group \\\"vendor\\\" added\r\nTraceback (most recent call last):\r\n  File \\\"/usr/bin/awx-manage\\\", line 9, in <module>\r\n    load_entry_point('awx==1.0.1.225', 'console_scripts', 'awx-manage')()\r\n  File \\\"/usr/lib/python2.7/site-packages/awx/__init__.py\\\", line 109, in manage\r\n    execute_from_command_line(sys.argv)\r\n  File \\\"/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/core/management/__init__.py\\\", line 364, in execute_from_command_line\r\n    utility.execute()\r\n  File \\\"/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/core/management/__init__.py\\\", line 356, in execute\r\n    self.fetch_command(subcommand).run_from_argv(self.argv)\r\n  File \\\"/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/core/management/base.py\\\", line 283, in run_from_argv\r\n    self.execute(*args, **cmd_options)\r\n  File \\\"/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/core/management/base.py\\\", line 330, in execute\r\n    output = self.handle(*args, **options)\r\n  File \\\"/usr/lib/python2.7/site-packages/awx/main/management/commands/inventory_import.py\\\", line 1020, in handle\r\n    self.load_into_database()\r\n  File \\\"/usr/lib/python2.7/site-packages/awx/main/management/commands/inventory_import.py\\\", line 892, in load_into_database\r\n    self._create_update_hosts()\r\n  File \\\"/usr/lib/python2.7/site-packages/awx/main/management/commands/inventory_import.py\\\", line 798, in _create_update_hosts\r\n    db_host = self.inventory.hosts.update_or_create(name=mem_host_name, defaults=host_attrs)[0]\r\n  File \\\"/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/fields/related_descriptors.py\\\", line 665, in update_or_create\r\n    return super(RelatedManager, self.db_manager(db)).update_or_create(**kwargs)\r\n  File \\\"/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/manager.py\\\", line 85, in manager_method\r\n    return getattr(self.get_queryset(), name)(*args, **kwargs)\r\n  File \\\"/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/query.py\\\", line 482, in update_or_create\r\n    obj, created = self._create_object_from_params(lookup, params)\r\n  File \\\"/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/query.py\\\", line 498, in _create_object_from_params\r\n    obj = self.create(**params)\r\n  File \\\"/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/query.py\\\", line 394, in create\r\n    obj.save(force_insert=True, using=self.db)\r\n  File \\\"/usr/lib/python2.7/site-packages/awx/main/models/inventory.py\\\", line 665, in save\r\n    super(Host, self).save(*args, **kwargs)\r\n  File \\\"/usr/lib/python2.7/site-packages/awx/main/models/base.py\\\", line 264, in save\r\n    super(PrimordialModel, self).save(*args, **kwargs)\r\n  File \\\"/usr/lib/python2.7/site-packages/awx/main/models/base.py\\\", line 159, in save\r\n    super(CreatedModifiedModel, self).save(*args, **kwargs)\r\n  File \\\"/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/base.py\\\", line 808, in save\r\n    force_update=force_update, update_fields=update_fields)\r\n  File \\\"/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/base.py\\\", line 838, in save_base\r\n    updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)\r\n  File \\\"/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/base.py\\\", line 924, in _save_table\r\n    result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)\r\n  File \\\"/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/base.py\\\", line 963, in _do_insert\r\n    using=using, raw=raw)\r\n  File \\\"/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/manager.py\\\", line 85, in manager_method\r\n    return getattr(self.get_queryset(), name)(*args, **kwargs)\r\n  File \\\"/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/query.py\\\", line 1076, in _insert\r\n    return query.get_compiler(using=using).execute_sql(return_id)\r\n  File \\\"/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/sql/compiler.py\\\", line 1106, in execute_sql\r\n    for sql, params in self.as_sql():\r\n  File \\\"/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/sql/compiler.py\\\", line 1059, in as_sql\r\n    for obj in self.query.objs\r\n  File \\\"/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/sql/compiler.py\\\", line 998, in prepare_value\r\n    value = field.get_db_prep_save(value, connection=self.connection)\r\n  File \\\"/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/fields/__init__.py\\\", line 770, in get_db_prep_save\r\n    prepared=False)\r\n  File \\\"/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/fields/__init__.py\\\", line 762, in get_db_prep_value\r\n    value = self.get_prep_value(value)\r\n  File \\\"/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/fields/__init__.py\\\", line 1043, in get_prep_value\r\n    return self.to_python(value)\r\n  File \\\"/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/fields/__init__.py\\\", line 1036, in to_python\r\n    params={'value': value},\r\ndjango.core.exceptions.ValidationError: [u\\\"'<object object at 0x6aa0f40>' value must be either True or False.\\\"]\r\n```"},"comment":{"url":"https://api.github.com/repos/ansible/awx/issues/comments/346841124","html_url":"https://github.com/ansible/awx/issues/705#issuecomment-346841124","issue_url":"https://api.github.com/repos/ansible/awx/issues/705","id":346841124,"user":{"login":"imoes","id":32100851,"avatar_url":"https://avatars3.githubusercontent.com/u/32100851?v=4","gravatar_id":"","url":"https://api.github.com/users/imoes","html_url":"https://github.com/imoes","followers_url":"https://api.github.com/users/imoes/followers","following_url":"https://api.github.com/users/imoes/following{/other_user}","gists_url":"https://api.github.com/users/imoes/gists{/gist_id}","starred_url":"https://api.github.com/users/imoes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imoes/subscriptions","organizations_url":"https://api.github.com/users/imoes/orgs","repos_url":"https://api.github.com/users/imoes/repos","events_url":"https://api.github.com/users/imoes/events{/privacy}","received_events_url":"https://api.github.com/users/imoes/received_events","type":"User","site_admin":false},"created_at":"2017-11-24T14:32:35Z","updated_at":"2017-11-24T14:32:35Z","author_association":"NONE","body":"same issue with OpenStack.py:\r\nTraceback (most recent call last): File \"/usr/bin/awx-manage\", line 9, in <module> load_entry_point('awx==1.0.1.229', 'console_scripts', 'awx-manage')() File \"/usr/lib/python2.7/site-packages/awx/__init__.py\", line 109, in manage execute_from_command_line(sys.argv) File \"/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/core/management/__init__.py\", line 364, in execute_from_command_line utility.execute() File \"/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/core/management/__init__.py\", line 356, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File \"/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/core/management/base.py\", line 283, in run_from_argv self.execute(*args, **cmd_options) File \"/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/core/management/base.py\", line 330, in execute output = self.handle(*args, **options) File \"/usr/lib/python2.7/site-packages/awx/main/management/commands/inventory_import.py\", line 1020, in handle self.load_into_database() File \"/usr/lib/python2.7/site-packages/awx/main/management/commands/inventory_import.py\", line 892, in load_into_database self._create_update_hosts() File \"/usr/lib/python2.7/site-packages/awx/main/management/commands/inventory_import.py\", line 798, in _create_update_hosts db_host = self.inventory.hosts.update_or_create(name=mem_host_name, defaults=host_attrs)[0] File \"/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/fields/related_descriptors.py\", line 665, in update_or_create return super(RelatedManager, self.db_manager(db)).update_or_create(**kwargs) File \"/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/manager.py\", line 85, in manager_method return getattr(self.get_queryset(), name)(*args, **kwargs) File \"/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/query.py\", line 482, in update_or_create obj, created = self._create_object_from_params(lookup, params) File \"/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/query.py\", line 498, in _create_object_from_params obj = self.create(**params) File \"/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/query.py\", line 394, in create obj.save(force_insert=True, using=self.db) File \"/usr/lib/python2.7/site-packages/awx/main/models/inventory.py\", line 665, in save super(Host, self).save(*args, **kwargs) File \"/usr/lib/python2.7/site-packages/awx/main/models/base.py\", line 264, in save super(PrimordialModel, self).save(*args, **kwargs) File \"/usr/lib/python2.7/site-packages/awx/main/models/base.py\", line 159, in save super(CreatedModifiedModel, self).save(*args, **kwargs) File \"/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/base.py\", line 808, in save force_update=force_update, update_fields=update_fields) File \"/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/base.py\", line 838, in save_base updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields) File \"/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/base.py\", line 924, in _save_table result = self._do_insert(cls._base_manager, using, fields, update_pk, raw) File \"/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/base.py\", line 963, in _do_insert using=using, raw=raw) File \"/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/manager.py\", line 85, in manager_method return getattr(self.get_queryset(), name)(*args, **kwargs) File \"/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/query.py\", line 1076, in _insert return query.get_compiler(using=using).execute_sql(return_id) File \"/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/sql/compiler.py\", line 1106, in execute_sql for sql, params in self.as_sql(): File \"/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/sql/compiler.py\", line 1059, in as_sql for obj in self.query.objs File \"/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/sql/compiler.py\", line 998, in prepare_value value = field.get_db_prep_save(value, connection=self.connection) File \"/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/fields/__init__.py\", line 770, in get_db_prep_save prepared=False) File \"/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/fields/__init__.py\", line 762, in get_db_prep_value value = self.get_prep_value(value) File \"/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/fields/__init__.py\", line 1043, in get_prep_value return self.to_python(value) File \"/var/lib/awx/venv/awx/lib/python2.7/site-packages/django/db/models/fields/__init__.py\", line 1036, in to_python params={'value': value}, django.core.exceptions.ValidationError: [u\"'<object object at 0x5fbce40>' value must be either True or False.\"]\r\n"}}
{"actor":{"display_login":"imoes"}}