Repository navigation
Fix: AttributeError: 'NoneType' object has no attribute 'variables_exec' #344
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
2024-12-05 12:47:19.214 | DEBUG | chk.modules.workflow:call:198 - FileContext(options={}, arguments={}, document={'version': 'default:validation:0.7.2', 'asserts': [{'type': 'List', 'actual': '<% _data.body %>'}, {'type': 'Map', 'actual': '<% _data.body.1 %>'}, {'type': 'MapHasKeys', 'actual': '<% _data.body.1 %>', 'expected': ['postId', 'id', 'name', 'email', 'body']}], 'expose': ['<% _asserts_response %>']}, filepath='/Users/mlbdmba21/Works/chkware/cli/tests/resources/storage/spec_docs/workflow_cases/jsonplaceholder/get-comments-valid.yml', filepath_hash='a6fff212b3f0af05b05ea69139f4eeb7d984371b6972b1c7a37817545c573cf5')
2024-12-05 12:47:19.214 | DEBUG | chk.modules.workflow:call:199 - ExecuteContext(options={'dump': True, 'format': True, 'debug': True}, arguments={'variables': {}})
2024-12-05 12:47:19.214 | ERROR | chk.modules.workflow:call:230 - Unsupported document exception
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/Users/mlbdmba21/Works/chkware/cli/chk/__main__.py", line 8, in <module>
chk(obj={})
└ <Group chk>
File "/Users/mlbdmba21/.local/share/virtualenvs/cli-rKd01vgv/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
return self.main(*args, **kwargs)
│ │ │ └ {'obj': {'debug': True}}
│ │ └ ()
│ └ <function BaseCommand.main at 0x10104e0c0>
└ <Group chk>
File "/Users/mlbdmba21/.local/share/virtualenvs/cli-rKd01vgv/lib/python3.11/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
│ │ └ <click.core.Context object at 0x100d03410>
│ └ <function MultiCommand.invoke at 0x10104f2e0>
└ <Group chk>
File "/Users/mlbdmba21/.local/share/virtualenvs/cli-rKd01vgv/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
│ │ │ │ └ <click.core.Context object at 0x1030f3190>
│ │ │ └ <function Command.invoke at 0x10104eca0>
│ │ └ <Command workflow>
│ └ <click.core.Context object at 0x1030f3190>
└ <function MultiCommand.invoke.<locals>._process_result at 0x100cf2520>
File "/Users/mlbdmba21/.local/share/virtualenvs/cli-rKd01vgv/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
│ │ │ │ │ └ {'file': 'tests/resources/storage/spec_docs/workflow_cases/jsonplaceholder/get-comments-valid.yml', 'no_format': False, 'vari...
│ │ │ │ └ <click.core.Context object at 0x1030f3190>
│ │ │ └ <function workflow at 0x1031b42c0>
│ │ └ <Command workflow>
│ └ <function Context.invoke at 0x10104d620>
└ <click.core.Context object at 0x1030f3190>
File "/Users/mlbdmba21/.local/share/virtualenvs/cli-rKd01vgv/lib/python3.11/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
│ └ {'file': 'tests/resources/storage/spec_docs/workflow_cases/jsonplaceholder/get-comments-valid.yml', 'no_format': False, 'vari...
└ ()
File "/Users/mlbdmba21/.local/share/virtualenvs/cli-rKd01vgv/lib/python3.11/site-packages/click/decorators.py", line 33, in new_func
return f(get_current_context(), *args, **kwargs)
│ │ │ └ {'file': 'tests/resources/storage/spec_docs/workflow_cases/jsonplaceholder/get-comments-valid.yml', 'no_format': False, 'vari...
│ │ └ ()
│ └ <function get_current_context at 0x101012c00>
└ <function workflow at 0x1031b4c20>
File "/Users/mlbdmba21/Works/chkware/cli/chk/console/main.py", line 169, in workflow
workflow_executor.execute(ctx, execution_ctx, after_hook)
│ │ │ │ └ <function after_hook at 0x1031b4ae0>
│ │ │ └ ExecuteContext(options={'dump': True, 'format': True, 'debug': True}, arguments={'variables': {}})
│ │ └ FileContext(options={}, arguments={}, document={'version': 'default:validation:0.7.2', 'asserts': [{'type': 'List', 'actual':...
│ └ <function execute at 0x103188e00>
└ <module 'chk.modules.workflow' from '/Users/mlbdmba21/Works/chkware/cli/chk/modules/workflow/__init__.py'>
File "/Users/mlbdmba21/Works/chkware/cli/chk/modules/workflow/__init__.py", line 260, in execute
exr = call(file_ctx=ctx, exec_ctx=exec_ctx)
│ │ └ ExecuteContext(options={'dump': True, 'format': True, 'debug': True}, arguments={'variables': {}})
│ └ FileContext(options={}, arguments={}, document={'version': 'default:validation:0.7.2', 'asserts': [{'type': 'List', 'actual':...
└ <function call at 0x1031898a0>
> File "/Users/mlbdmba21/Works/chkware/cli/chk/modules/workflow/__init__.py", line 207, in call
wflow_doc = WorkflowDocument.from_file_context(file_ctx)
│ │ └ FileContext(options={}, arguments={}, document={'version': 'default:validation:0.7.2', 'asserts': [{'type': 'List', 'actual':...
│ └ <staticmethod(<function WorkflowDocument.from_file_context at 0x10318bba0>)>
└ <class 'chk.modules.workflow.WorkflowDocument'>
File "/Users/mlbdmba21/Works/chkware/cli/chk/modules/workflow/__init__.py", line 60, in from_file_context
DocumentVersionMaker.verify_if_allowed(doc_ver, VERSION_SCOPE)
│ │ │ └ ['workflow']
│ │ └ DocumentVersion(original_version_str='default:validation:0.7.2', provider='default', doc_type='validation', doc_type_ver='0.7...
│ └ <staticmethod(<function DocumentVersionMaker.verify_if_allowed at 0x10316c360>)>
└ <class 'chk.infrastructure.version.DocumentVersionMaker'>
File "/Users/mlbdmba21/Works/chkware/cli/chk/infrastructure/version.py", line 146, in verify_if_allowed
raise RuntimeError("Unsupported document exception")
RuntimeError: Unsupported document exception
2024-12-05 12:47:19.220 | ERROR | chk.modules.workflow:execute:260 - An error has been caught in function 'execute', process 'MainProcess' (1961), thread 'MainThread' (8413499200):
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/Users/mlbdmba21/Works/chkware/cli/chk/__main__.py", line 8, in <module>
chk(obj={})
└ <Group chk>
File "/Users/mlbdmba21/.local/share/virtualenvs/cli-rKd01vgv/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
return self.main(*args, **kwargs)
│ │ │ └ {'obj': {'debug': True}}
│ │ └ ()
│ └ <function BaseCommand.main at 0x10104e0c0>
└ <Group chk>
File "/Users/mlbdmba21/.local/share/virtualenvs/cli-rKd01vgv/lib/python3.11/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
│ │ └ <click.core.Context object at 0x100d03410>
│ └ <function MultiCommand.invoke at 0x10104f2e0>
└ <Group chk>
File "/Users/mlbdmba21/.local/share/virtualenvs/cli-rKd01vgv/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
│ │ │ │ └ <click.core.Context object at 0x1030f3190>
│ │ │ └ <function Command.invoke at 0x10104eca0>
│ │ └ <Command workflow>
│ └ <click.core.Context object at 0x1030f3190>
└ <function MultiCommand.invoke.<locals>._process_result at 0x100cf2520>
File "/Users/mlbdmba21/.local/share/virtualenvs/cli-rKd01vgv/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
│ │ │ │ │ └ {'file': 'tests/resources/storage/spec_docs/workflow_cases/jsonplaceholder/get-comments-valid.yml', 'no_format': False, 'vari...
│ │ │ │ └ <click.core.Context object at 0x1030f3190>
│ │ │ └ <function workflow at 0x1031b42c0>
│ │ └ <Command workflow>
│ └ <function Context.invoke at 0x10104d620>
└ <click.core.Context object at 0x1030f3190>
File "/Users/mlbdmba21/.local/share/virtualenvs/cli-rKd01vgv/lib/python3.11/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
│ └ {'file': 'tests/resources/storage/spec_docs/workflow_cases/jsonplaceholder/get-comments-valid.yml', 'no_format': False, 'vari...
└ ()
File "/Users/mlbdmba21/.local/share/virtualenvs/cli-rKd01vgv/lib/python3.11/site-packages/click/decorators.py", line 33, in new_func
return f(get_current_context(), *args, **kwargs)
│ │ │ └ {'file': 'tests/resources/storage/spec_docs/workflow_cases/jsonplaceholder/get-comments-valid.yml', 'no_format': False, 'vari...
│ │ └ ()
│ └ <function get_current_context at 0x101012c00>
└ <function workflow at 0x1031b4c20>
File "/Users/mlbdmba21/Works/chkware/cli/chk/console/main.py", line 169, in workflow
workflow_executor.execute(ctx, execution_ctx, after_hook)
│ │ │ │ └ <function after_hook at 0x1031b4ae0>
│ │ │ └ ExecuteContext(options={'dump': True, 'format': True, 'debug': True}, arguments={'variables': {}})
│ │ └ FileContext(options={}, arguments={}, document={'version': 'default:validation:0.7.2', 'asserts': [{'type': 'List', 'actual':...
│ └ <function execute at 0x103188e00>
└ <module 'chk.modules.workflow' from '/Users/mlbdmba21/Works/chkware/cli/chk/modules/workflow/__init__.py'>
> File "/Users/mlbdmba21/Works/chkware/cli/chk/modules/workflow/__init__.py", line 260, in execute
exr = call(file_ctx=ctx, exec_ctx=exec_ctx)
│ │ └ ExecuteContext(options={'dump': True, 'format': True, 'debug': True}, arguments={'variables': {}})
│ └ FileContext(options={}, arguments={}, document={'version': 'default:validation:0.7.2', 'asserts': [{'type': 'List', 'actual':...
└ <function call at 0x1031898a0>
File "/Users/mlbdmba21/Works/chkware/cli/chk/modules/workflow/__init__.py", line 238, in call
extra=exec_report,
UnboundLocalError: cannot access local variable 'exec_report' where it is not associated with a value
2024-12-05 12:47:19.222 | ERROR | chk.modules.workflow:execute:264 - 'NoneType' object has no attribute 'variables_exec'
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/Users/mlbdmba21/Works/chkware/cli/chk/__main__.py", line 8, in <module>
chk(obj={})
└ <Group chk>
File "/Users/mlbdmba21/.local/share/virtualenvs/cli-rKd01vgv/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
return self.main(*args, **kwargs)
│ │ │ └ {'obj': {'debug': True}}
│ │ └ ()
│ └ <function BaseCommand.main at 0x10104e0c0>
└ <Group chk>
File "/Users/mlbdmba21/.local/share/virtualenvs/cli-rKd01vgv/lib/python3.11/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
│ │ └ <click.core.Context object at 0x100d03410>
│ └ <function MultiCommand.invoke at 0x10104f2e0>
└ <Group chk>
File "/Users/mlbdmba21/.local/share/virtualenvs/cli-rKd01vgv/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
│ │ │ │ └ <click.core.Context object at 0x1030f3190>
│ │ │ └ <function Command.invoke at 0x10104eca0>
│ │ └ <Command workflow>
│ └ <click.core.Context object at 0x1030f3190>
└ <function MultiCommand.invoke.<locals>._process_result at 0x100cf2520>
File "/Users/mlbdmba21/.local/share/virtualenvs/cli-rKd01vgv/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
│ │ │ │ │ └ {'file': 'tests/resources/storage/spec_docs/workflow_cases/jsonplaceholder/get-comments-valid.yml', 'no_format': False, 'vari...
│ │ │ │ └ <click.core.Context object at 0x1030f3190>
│ │ │ └ <function workflow at 0x1031b42c0>
│ │ └ <Command workflow>
│ └ <function Context.invoke at 0x10104d620>
└ <click.core.Context object at 0x1030f3190>
File "/Users/mlbdmba21/.local/share/virtualenvs/cli-rKd01vgv/lib/python3.11/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
│ └ {'file': 'tests/resources/storage/spec_docs/workflow_cases/jsonplaceholder/get-comments-valid.yml', 'no_format': False, 'vari...
└ ()
File "/Users/mlbdmba21/.local/share/virtualenvs/cli-rKd01vgv/lib/python3.11/site-packages/click/decorators.py", line 33, in new_func
return f(get_current_context(), *args, **kwargs)
│ │ │ └ {'file': 'tests/resources/storage/spec_docs/workflow_cases/jsonplaceholder/get-comments-valid.yml', 'no_format': False, 'vari...
│ │ └ ()
│ └ <function get_current_context at 0x101012c00>
└ <function workflow at 0x1031b4c20>
File "/Users/mlbdmba21/Works/chkware/cli/chk/console/main.py", line 169, in workflow
workflow_executor.execute(ctx, execution_ctx, after_hook)
│ │ │ │ └ <function after_hook at 0x1031b4ae0>
│ │ │ └ ExecuteContext(options={'dump': True, 'format': True, 'debug': True}, arguments={'variables': {}})
│ │ └ FileContext(options={}, arguments={}, document={'version': 'default:validation:0.7.2', 'asserts': [{'type': 'List', 'actual':...
│ └ <function execute at 0x103188e00>
└ <module 'chk.modules.workflow' from '/Users/mlbdmba21/Works/chkware/cli/chk/modules/workflow/__init__.py'>
> File "/Users/mlbdmba21/Works/chkware/cli/chk/modules/workflow/__init__.py", line 261, in execute
cb({ctx.filepath_hash: exr.variables_exec.data})
│ │ │ └ None
│ │ └ _tuplegetter(4, 'Alias for field number 4')
│ └ FileContext(options={}, arguments={}, document={'version': 'default:validation:0.7.2', 'asserts': [{'type': 'List', 'actual':...
└ <function after_hook at 0x1031b4ae0>
AttributeError: 'NoneType' object has no attribute 'variables_exec'
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Activity
[-]Fix: Error _AttributeError: 'NoneType' object has no attribute 'variables_exec'_[/-][+]Fix: AttributeError: 'NoneType' object has no attribute 'variables_exec'[/+]0hsn commentedon Dec 5, 2024
Remarks
0hsn commentedon Mar 9, 2025
This is issue is fixed with implementation to #314, #316 and #367
Please reopen when it's reproduce-able.