Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

AttributeError: 'CredentialAdaptor' object has no attribute '_token_retriever'

Đang mở
#331 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
25/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
azure, python
Lĩnh vực
cloud

Hướng nghiên cứu

Tái hiện ví dụ AzureVMCluster và lần theo lỗi từ dask_cloudprovider/azure/azurevm.py qua create_vm và ngăn xếp xác thực của Azure SDK. Đọc lệnh gọi CredentialAdaptor trong azure/common/credentials.py và so sánh các phiên bản dependency đã cài đặt. Hoàn thành khi thiết lập AzureVMCluster được hiển thị có thể tạo scheduler của nó mà không gặp _token_retriever AttributeError.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug provider/azure/vm

Code

from dask_cloudprovider.azure import AzureVMCluster

cluster = AzureVMCluster(
location="brazilsouth",
resource_group="ResourceGroup1",
vnet="VirtualNetwork",
security_group="NetworkSecurityGroup1",
vm_size="STANDARD_DS3_V2",
n_workers=3)

#************* Using last versions of libraries

Result

Creating scheduler instance
.........................................................................................
AttributeError Traceback (most recent call last)
in
6 from dask_cloudprovider.azure import AzureVMCluster
7
----> 8 cluster = AzureVMCluster(
9 location="brazilsouth",
10 resource_group="ResourceGroup1",

/anaconda/envs/azuremlsklearn_py38/lib/python3.8/site-packages/dask_cloudprovider/azure/azurevm.py in init(self, location, resource_group, vnet, security_group, public_ingress, vm_size, scheduler_vm_size, vm_image, disk_size, bootstrap, auto_shutdown, docker_image, debug, marketplace_plan, **kwargs)
548 }
549 self.worker_options = {"vm_size": self.vm_size, **self.options}
--> 550 super().init(debug=debug, **kwargs)

/anaconda/envs/azuremlsklearn_py38/lib/python3.8/site-packages/dask_cloudprovider/generic/vmcluster.py in init(self, n_workers, worker_class, worker_options, scheduler_options, docker_image, docker_args, env_vars, security, protocol, debug, **kwargs)
287 self.uuid = str(uuid.uuid4())[:8]
288
--> 289 super().init(**kwargs, security=self.security)
290
291 async def call_async(self, f, *args, **kwargs):

/anaconda/envs/azuremlsklearn_py38/lib/python3.8/site-packages/distributed/deploy/spec.py in init(self, workers, scheduler, worker, asynchronous, loop, security, silence_logs, name, shutdown_on_close)
281 self.scheduler_spec = {"cls": Scheduler, "options": options}
282
--> 283 # Check if scheduler has already been created by a subclass
284 if self.scheduler is None:
285 cls = self.scheduler_spec["cls"]

/anaconda/envs/azuremlsklearn_py38/lib/python3.8/site-packages/distributed/deploy/cluster.py in sync(self, func, asynchronous, callback_timeout, *args, **kwargs)
191
192 with suppress(RuntimeError): # loop closed during process shutdown
--> 193 return self.sync(self._close, callback_timeout=timeout)
194
195 def del(self):

/anaconda/envs/azuremlsklearn_py38/lib/python3.8/site-packages/distributed/utils.py in sync(loop, func, callback_timeout, *args, **kwargs)
336 main_tid = threading.get_ident()
337 result = [None]
--> 338 error = [False]
339
340 @gen.coroutine

/anaconda/envs/azuremlsklearn_py38/lib/python3.8/site-packages/distributed/utils.py in f()
319 except RuntimeError:
320 # No running loop in thread. If the event loop isn't running, it
--> 321 # could be started later in this thread though. Return the default.
322 if not loop.asyncio_loop.is_running():
323 return default

/anaconda/envs/azuremlsklearn_py38/lib/python3.8/site-packages/tornado/gen.py in run(self)
760
761 try:
--> 762 value = future.result()
763 except Exception:
764 exc_info = sys.exc_info()

/anaconda/envs/azuremlsklearn_py38/lib/python3.8/site-packages/dask_cloudprovider/generic/vmcluster.py in _start(self)
327 "Hang tight! ",
328 ):
--> 329 await super()._start()
330
331 def render_process_cloud_init(self, process):

/anaconda/envs/azuremlsklearn_py38/lib/python3.8/site-packages/distributed/deploy/spec.py in _start(self)
310 async def _correct_state_internal(self):
311 async with self._lock:
--> 312 self._correct_state_waiting = None
313
314 to_close = set(self.workers) - set(self.worker_spec)

/anaconda/envs/azuremlsklearn_py38/lib/python3.8/site-packages/distributed/deploy/spec.py in _()
70 to make the job exist in the future
71
---> 72 For the scheduler we will expect the scheduler's .address attribute
73 to be avaialble after this completes.
74 """

/anaconda/envs/azuremlsklearn_py38/lib/python3.8/site-packages/dask_cloudprovider/generic/vmcluster.py in start(self)
84 async def start(self):
85 self.cluster._log("Creating scheduler instance")
---> 86 ip = await self.create_vm()
87 self.address = f"{self.cluster.protocol}://{ip}:8786"
88 await self.wait_for_scheduler()

/anaconda/envs/azuremlsklearn_py38/lib/python3.8/site-packages/dask_cloudprovider/azure/azurevm.py in create_vm(self)
70
71 async def create_vm(self):
---> 72 [subnet_info, *_] = await self.cluster.call_async(
73 self.cluster.network_client.subnets.list,
74 self.cluster.resource_group,

/anaconda/envs/azuremlsklearn_py38/lib/python3.8/site-packages/azure/core/paging.py in next(self)
127 if self._page_iterator is None:
128 self._page_iterator = itertools.chain.from_iterable(self.by_page())
--> 129 return next(self._page_iterator)
130
131 next = next # Python 2 compatibility.

/anaconda/envs/azuremlsklearn_py38/lib/python3.8/site-packages/azure/core/paging.py in next(self)
74 raise StopIteration("End of paging")
75 try:
---> 76 self._response = self._get_next(self.continuation_token)
77 except AzureError as error:
78 if not error.continuation_token:

/anaconda/envs/azuremlsklearn_py38/lib/python3.8/site-packages/azure/mgmt/network/v2021_05_01/operations/_subnets_operations.py in get_next(next_link)
687 request = prepare_request(next_link)
688
--> 689 pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
690 response = pipeline_response.http_response
691

/anaconda/envs/azuremlsklearn_py38/lib/python3.8/site-packages/azure/core/pipeline/_base.py in run(self, request, **kwargs)
209 else _TransportRunner(self._transport)
210 )
--> 211 return first_node.send(pipeline_request) # type: ignore

/anaconda/envs/azuremlsklearn_py38/lib/python3.8/site-packages/azure/core/pipeline/_base.py in send(self, request)
69 _await_result(self._policy.on_request, request)
70 try:
---> 71 response = self.next.send(request)
72 except Exception: # pylint: disable=broad-except
73 _await_result(self._policy.on_exception, request)

/anaconda/envs/azuremlsklearn_py38/lib/python3.8/site-packages/azure/core/pipeline/_base.py in send(self, request)
69 _await_result(self._policy.on_request, request)
70 try:
---> 71 response = self.next.send(request)
72 except Exception: # pylint: disable=broad-except
73 _await_result(self._policy.on_exception, request)

/anaconda/envs/azuremlsklearn_py38/lib/python3.8/site-packages/azure/core/pipeline/_base.py in send(self, request)
69 _await_result(self._policy.on_request, request)
70 try:
---> 71 response = self.next.send(request)
72 except Exception: # pylint: disable=broad-except
73 _await_result(self._policy.on_exception, request)

/anaconda/envs/azuremlsklearn_py38/lib/python3.8/site-packages/azure/core/pipeline/_base.py in send(self, request)
69 _await_result(self._policy.on_request, request)
70 try:
---> 71 response = self.next.send(request)
72 except Exception: # pylint: disable=broad-except
73 _await_result(self._policy.on_exception, request)

/anaconda/envs/azuremlsklearn_py38/lib/python3.8/site-packages/azure/core/pipeline/_base.py in send(self, request)
69 _await_result(self._policy.on_request, request)
70 try:
---> 71 response = self.next.send(request)
72 except Exception: # pylint: disable=broad-except
73 _await_result(self._policy.on_exception, request)

/anaconda/envs/azuremlsklearn_py38/lib/python3.8/site-packages/azure/mgmt/core/policies/_base.py in send(self, request)
45 # type: (PipelineRequest[HTTPRequestType], Any) -> PipelineResponse[HTTPRequestType, HTTPResponseType]
46 http_request = request.http_request
---> 47 response = self.next.send(request)
48 if response.http_response.status_code == 409:
49 rp_name = self._check_rp_not_registered_err(response)

/anaconda/envs/azuremlsklearn_py38/lib/python3.8/site-packages/azure/core/pipeline/policies/_redirect.py in send(self, request)
156 redirect_settings = self.configure_redirects(request.context.options)
157 while retryable:
--> 158 response = self.next.send(request)
159 redirect_location = self.get_redirect_location(response)
160 if redirect_location and redirect_settings['allow']:

/anaconda/envs/azuremlsklearn_py38/lib/python3.8/site-packages/azure/core/pipeline/policies/_retry.py in send(self, request)
443 start_time = time.time()
444 self._configure_timeout(request, absolute_timeout, is_response_error)
--> 445 response = self.next.send(request)
446 if self.is_retry(retry_settings, response):
447 retry_active = self.increment(retry_settings, response=response)

/anaconda/envs/azuremlsklearn_py38/lib/python3.8/site-packages/azure/core/pipeline/policies/_authentication.py in send(self, request)
115 :type request: ~azure.core.pipeline.PipelineRequest
116 """
--> 117 self.on_request(request)
118 try:
119 response = self.next.send(request)

/anaconda/envs/azuremlsklearn_py38/lib/python3.8/site-packages/azure/core/pipeline/policies/_authentication.py in on_request(self, request)
92
93 if self._token is None or self._need_new_token:
---> 94 self._token = self._credential.get_token(*self._scopes)
95 self._update_headers(request.http_request.headers, self._token.token)
96

/anaconda/envs/azuremlsklearn_py38/lib/python3.8/site-packages/azure/common/credentials.py in get_token(self, *scopes, **kwargs)
70
71 credentials = self._get_cred(resource)
---> 72 _, token, fulltoken = credentials._token_retriever() # pylint:disable=protected-access
73
74 return _AccessToken(token, int(fulltoken['expiresIn'] + time.time()))

AttributeError: 'CredentialAdaptor' object has no attribute '_token_retriever'

Ngôn ngữ chính
Python
Star
147
Fork
120
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của dask/dask-cloudprovider

Tất cả issue của dask/dask-cloudprovider

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.