Closed datcu closed 3 years ago
fixed in 0.9.0
@Lawouach now with 0.9.0 (following the same initial scenario) it's not fetching VMSS anymore and I get:
[2021-03-16 14:58:19 DEBUG] [activity:235] Activity failed
Traceback (most recent call last):
File "/home/developer/.venvs/chaos-toolkit/lib/python3.7/site-packages/chaoslib/provider/python.py", line 55, in run_python_activity
return func(**arguments)
File "/home/developer/.venvs/chaos-toolkit/lib/python3.7/site-packages/chaosazure/vmss/actions.py", line 257, in stress_cpu
vmss = fetch_vmss(filter, configuration, secrets)
File "/home/developer/.venvs/chaos-toolkit/lib/python3.7/site-packages/chaosazure/vmss/fetcher.py", line 48, in fetch_vmss
vmss = fetch_resources(filter, RES_TYPE_VMSS, secrets, configuration)
File "/home/developer/.venvs/chaos-toolkit/lib/python3.7/site-packages/chaosazure/common/resources/graph.py", line 22, in fetch_resources
client = init_resource_graph_client(secrets)
File "/home/developer/.venvs/chaos-toolkit/lib/python3.7/site-packages/chaosazure/__init__.py", line 86, in init_resource_graph_client
base_url=base_url)
TypeError: __init__() got an unexpected keyword argument 'credential'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/developer/.venvs/chaos-toolkit/lib/python3.7/site-packages/chaoslib/activity.py", line 228, in run_activity
result = run_python_activity(activity, configuration, secrets)
File "/home/developer/.venvs/chaos-toolkit/lib/python3.7/site-packages/chaoslib/provider/python.py", line 60, in run_python_activity
sys.exc_info()[2])
File "/home/developer/.venvs/chaos-toolkit/lib/python3.7/site-packages/chaoslib/provider/python.py", line 55, in run_python_activity
return func(**arguments)
File "/home/developer/.venvs/chaos-toolkit/lib/python3.7/site-packages/chaosazure/vmss/actions.py", line 257, in stress_cpu
vmss = fetch_vmss(filter, configuration, secrets)
File "/home/developer/.venvs/chaos-toolkit/lib/python3.7/site-packages/chaosazure/vmss/fetcher.py", line 48, in fetch_vmss
vmss = fetch_resources(filter, RES_TYPE_VMSS, secrets, configuration)
File "/home/developer/.venvs/chaos-toolkit/lib/python3.7/site-packages/chaosazure/common/resources/graph.py", line 22, in fetch_resources
client = init_resource_graph_client(secrets)
File "/home/developer/.venvs/chaos-toolkit/lib/python3.7/site-packages/chaosazure/__init__.py", line 86, in init_resource_graph_client
base_url=base_url)
chaoslib.exceptions.ActivityFailed: TypeError: __init__() got an unexpected keyword argument 'credential'
[2021-03-16 14:58:19 ERROR] [activity:188] => failed: TypeError: __init__() got an unexpected keyword argument 'credential'
Can you please double check the fix?
I think you need to update the dependencies:
pip install -U azure-mgmt-resourcegraph msrestazure
@Lawouach that fixed the above problem, thanks. But I get into another one after that.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/developer/.venvs/chaos-toolkit/lib/python3.7/site-packages/chaoslib/activity.py", line 228, in run_activity
result = run_python_activity(activity, configuration, secrets)
File "/home/developer/.venvs/chaos-toolkit/lib/python3.7/site-packages/chaoslib/provider/python.py", line 60, in run_python_activity
sys.exc_info()[2])
File "/home/developer/.venvs/chaos-toolkit/lib/python3.7/site-packages/chaoslib/provider/python.py", line 55, in run_python_activity
return func(**arguments)
File "/home/developer/.venvs/chaos-toolkit/lib/python3.7/site-packages/chaosazure/vmss/actions.py", line 257, in stress_cpu
vmss = fetch_vmss(filter, configuration, secrets)
File "/home/developer/.venvs/chaos-toolkit/lib/python3.7/site-packages/chaosazure/vmss/fetcher.py", line 48, in fetch_vmss
vmss = fetch_resources(filter, RES_TYPE_VMSS, secrets, configuration)
File "/home/developer/.venvs/chaos-toolkit/lib/python3.7/site-packages/chaosazure/common/resources/graph.py", line 23, in fetch_resources
resources = client.resources(_query_request)
File "/home/developer/.venvs/chaos-toolkit/lib/python3.7/site-packages/azure/mgmt/resourcegraph/operations/_resource_graph_client_operations.py", line 68, in resources
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
File "/home/developer/.venvs/chaos-toolkit/lib/python3.7/site-packages/azure/core/pipeline/_base.py", line 211, in run
return first_node.send(pipeline_request) # type: ignore
File "/home/developer/.venvs/chaos-toolkit/lib/python3.7/site-packages/azure/core/pipeline/_base.py", line 71, in send
response = self.next.send(request)
File "/home/developer/.venvs/chaos-toolkit/lib/python3.7/site-packages/azure/mgmt/core/policies/_base.py", line 47, in send
response = self.next.send(request)
File "/home/developer/.venvs/chaos-toolkit/lib/python3.7/site-packages/azure/core/pipeline/_base.py", line 71, in send
response = self.next.send(request)
File "/home/developer/.venvs/chaos-toolkit/lib/python3.7/site-packages/azure/core/pipeline/_base.py", line 71, in send
response = self.next.send(request)
File "/home/developer/.venvs/chaos-toolkit/lib/python3.7/site-packages/azure/core/pipeline/_base.py", line 71, in send
response = self.next.send(request)
[Previous line repeated 1 more time]
File "/home/developer/.venvs/chaos-toolkit/lib/python3.7/site-packages/azure/core/pipeline/policies/_redirect.py", line 158, in send
response = self.next.send(request)
File "/home/developer/.venvs/chaos-toolkit/lib/python3.7/site-packages/azure/core/pipeline/policies/_retry.py", line 435, in send
response = self.next.send(request)
File "/home/developer/.venvs/chaos-toolkit/lib/python3.7/site-packages/azure/core/pipeline/_base.py", line 69, in send
_await_result(self._policy.on_request, request)
File "/home/developer/.venvs/chaos-toolkit/lib/python3.7/site-packages/azure/core/pipeline/_tools.py", line 29, in await_result
result = func(*args, **kwargs)
File "/home/developer/.venvs/chaos-toolkit/lib/python3.7/site-packages/azure/core/pipeline/policies/_authentication.py", line 93, in on_request
self._token = self._credential.get_token(*self._scopes)
chaoslib.exceptions.ActivityFailed: AttributeError: 'ServicePrincipalCredentials' object has no attribute 'get_token'
[2021-03-16 15:29:56 ERROR] [activity:188] => failed: AttributeError: 'ServicePrincipalCredentials' object has no attribute 'get_token'
Is it something that I miss in my configuration?
Hard fort me to say sadly. I've never used Azure and this extension relies on its contributors.
But also, Azure needs to stop changing the Python packaging all the time... it's saddening.
I am also getting same error, any idea?
failed: AttributeError: 'ServicePrincipalCredentials' object has no attribute 'get_token'
@datcu were you able to fix this issue?
@devops-arch-cloud unfortunately I didn't fix it and I've abandoned the idea to use the tool for now. Looks like Azure keeps changing things and people involved in this project cannot keep up so maybe I will try to use it when is more stable...
Hi,
Using chaostoolkit-azure 0.8.3 (latest version) I was trying to run _stress_vmss_instancecpu experiment. As this issue reported, I couldn't use 0.8.3 version as it is (I had to manually install msrestazure and lock azure-mgmt-resourcegraph to 2.0.0 version). My experiment file looks like below:
When I'm trying to run it I get:
Is it something wrong on my end or a product issue? Thanks.