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

TypeError: get() got an unexpected keyword argument 'eid' #1743

Open
chuanchang opened this issue Jun 16, 2020 · 5 comments
Open

TypeError: get() got an unexpected keyword argument 'eid' #1743

chuanchang opened this issue Jun 16, 2020 · 5 comments

Comments

@chuanchang
Copy link

Describe the bug
Although provision is successful, I got error as follows.

TASK [gather_resources : Info] **********************************************************************************************************************************************************************ok: [localhost] => {
    "msg": "/tmp/rhel-8.2-nightly-latest-c235c8.inventory"
}

TASK [gather_resources : Add inventory_path to outputs] *********************************************************************************************************************************************[WARNING]: The value [{'inventory_path': ['/tmp/rhel-8.2-nightly-latest-c235c8.inventory']}] (type list) in a string field was converted to "[{'inventory_path': ['/tmp/rhel-8.2-nightly-
latest-c235c8.inventory']}]" (type string). If this does not look like what you expect, quote the entire value to ensure it does not change.

changed: [localhost] => {"changed": true, "output": "[1]"}

PLAY RECAP ******************************************************************************************************************************************************************************************localhost                  : ok=28   changed=4    unreachable=0    failed=0    skipped=27   rescued=0    ignored=0

Action 'up' on Target 'rhel-8.2' is complete
Traceback (most recent call last):
  File "/usr/local/bin/linchpin", line 10, in <module>
    sys.exit(runcli())
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/click/decorators.py", line 73, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/linchpin/shell/__init__.py", line 318, in up
    env_vars=env_vars)
  File "/usr/local/lib/python3.7/site-packages/linchpin/cli/__init__.py", line 380, in lp_up
    tx_id=tx_id)
  File "/usr/local/lib/python3.7/site-packages/linchpin/cli/__init__.py", line 565, in _execute_action
    run_id=run_id)
  File "/usr/local/lib/python3.7/site-packages/linchpin/cli/__init__.py", line 742, in _execute
    tx_id=tx_id)
  File "/usr/local/lib/python3.7/site-packages/linchpin/__init__.py", line 549, in do_action
    run_id)
  File "/usr/local/lib/python3.7/site-packages/linchpin/__init__.py", line 615, in run_target
    self.run_hooks('inv', action)
  File "/usr/local/lib/python3.7/site-packages/linchpin/__init__.py", line 633, in run_hooks
    self.hook_state = hook
  File "/usr/local/lib/python3.7/site-packages/linchpin/__init__.py", line 253, in hook_state
    callback(self._hook_state)
  File "/usr/local/lib/python3.7/site-packages/linchpin/hooks/__init__.py", line 200, in run_hooks
    run_data = self.prepare_inv_params()
  File "/usr/local/lib/python3.7/site-packages/linchpin/hooks/__init__.py", line 167, in prepare_inv_params
    run_id=self._rundb_id)
  File "/usr/local/lib/python3.7/site-packages/linchpin/rundb/basedb.py", line 41, in get_record
    return self.driver.get_record(table, action=action, run_id=run_id)
  File "/usr/local/lib/python3.7/site-packages/linchpin/rundb/__init__.py", line 10, in func_wrapper
    x = func(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/linchpin/rundb/tinydb.py", line 116, in get_record
    record = t.get(eid=int(run_id))
TypeError: get() got an unexpected keyword argument 'eid'

To Reproduce
Steps to reproduce the behavior:

  1. To follow documentation - https://github.com/CentOS-PaaS-SIG/linchpin/blob/6c7c656b9b396790ab76491fec9f263f3d43f8ff/config/Dockerfiles/linchpin/README.rst

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: RHEL-8.2
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context

sh-5.0$ linchpin --version
linchpin version 2.0.0  
sh-5.0$ ansible --version
ansible 2.9.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/linchpin/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.7/site-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 3.7.7 (default, Mar 13 2020, 10:23:39) [GCC 9.2.1 20190827 (Red Hat 9.2.1-1)]
@Dannyb48
Copy link
Contributor

@chuanchang I think this is a bug in 2.0.0 This should be fixed in later versions and the most recent released yesterday was 2.0.2

The problem is that there is no longer a container job that is building the updated container version. Do you need to run from a container or can you test his from an virtualenv pip install?

@chuanchang
Copy link
Author

chuanchang commented Jun 17, 2020

@chuanchang I think this is a bug in 2.0.0 This should be fixed in later versions and the most recent released yesterday was 2.0.2

$ linchpin --version
linchpin version 2.0.2

$ linchpin --creds-path credentials/ -p PinFile/PinFile.rhel8.2 -vw `pwd` up rhel-8.2

PLAY [schema check and Pre Provisioning Activities on topology_file] ********************************************************************************************************************************

TASK [common : assign async value] ******************************************************************************************************************************************************************
skipping: [localhost] => {"changed": false, "skip_reason": "Conditional result was False"}

TASK [common : declare async_types array] ***********************************************************************************************************************************************************
skipping: [localhost] => {"changed": false, "skip_reason": "Conditional result was False"}

...ignore...

TASK [gather_resources : Add inventory_path to outputs] *********************************************************************************************************************************************
[WARNING]: The value [{'inventory_path': ['/home/ajia/workspace/linchpin/inventories/rhel-8.2-nightly-latest-6198a1.inventory']}] (type list) in a string field was converted to
"[{'inventory_path': ['/home/ajia/workspace/linchpin/inventories/rhel-8.2-nightly-latest-6198a1.inventory']}]" (type string). If this does not look like what you expect, quote the entire value to
ensure it does not change.
changed: [localhost] => {"changed": true, "output": "[2]"}

PLAY RECAP ******************************************************************************************************************************************************************************************
localhost                  : ok=28   changed=4    unreachable=0    failed=0    skipped=27   rescued=0    ignored=0

NOTE: the cmdline will hang forever w/o return although VM has been provisioned successfully.

$ ps axuf|grep linchpin|wc -l
14

NOTE: there are 14 linchpin process are generated, I don't know whether it's a reason why the linchpin cmdline hang forever.

@Dannyb48
Copy link
Contributor

Can you pre-pend to the command --no-monitor command option. This will disable the multi-processing. The multiprocessing is why you see 14 processes spin up. But a lot of this should have been resolved with this maintenance release working but maybe something regressed, not sure.

So it should look like

$ linchpin --no-monitor --creds-path credentials/ -p PinFile/PinFile.rhel8.2 -vw `pwd` up rhel-8.2

@chuanchang
Copy link
Author

chuanchang commented Jun 18, 2020

$ linchpin --no-monitor --creds-path credentials/ -p PinFile/PinFile.rhel8.2 -vw `pwd` up rhel-8.2

It works for me, but I got the same issue when tried to destroy provisioned VM based on docker.io/contrainfra/linchpin - #1744

@Dannyb48
Copy link
Contributor

Yeah, you will have to use the same --no-monitor option on destroy as well. The other option is if you want to avoid using that command option all together you can set it in your linchpin.conf under [evars]

[evars]
no_monitor = True

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

No branches or pull requests

2 participants