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

get_storage_info_for_blob returns ClientError, TooManyDevicesError #851

Closed
lmazuel opened this issue Sep 15, 2021 · 5 comments
Closed

get_storage_info_for_blob returns ClientError, TooManyDevicesError #851

lmazuel opened this issue Sep 15, 2021 · 5 comments

Comments

@lmazuel
Copy link
Member

lmazuel commented Sep 15, 2021

@BillmanH commented on Tue Sep 14 2021

Using the method described in this doc, and reviewing the throttle limits here

There is only one single device for this use case no other devices registered in my IoT Hub. I'm using the same devices every time. And I'm only uploading one file at a time (or at least I think I am). However once you get this message you can never use that device connection string again and you must get a new device. Am I missing some kind of disconnect and is there really no way to repair the device once you get this message?

Here is the full source code I'm using for upload:
https://github.com/BillmanH/learn-iothub/blob/main/devices/camera.py

This notebook shows the framework of the issue:
https://github.com/BillmanH/learn-iothub/blob/main/notebooks/Using%20the%20IoTHubDeviceClient.ipynb

Full Stack trace:

ClientError: ClientError('Unexpected failure') caused by ServiceError('HTTP operation returned: 403 TooManyDevicesError(Error: Forbidden)')
---------------------------------------------------------------------------
ServiceError                              Traceback (most recent call last)
~\anaconda3\envs\azure-iot\lib\site-packages\azure\iot\device\iothub\sync_clients.py in handle_result(callback)
     33     try:
---> 34         return callback.wait_for_completion()
     35     except pipeline_exceptions.ConnectionDroppedError as e:

~\anaconda3\envs\azure-iot\lib\site-packages\azure\iot\device\common\evented_callback.py in wait_for_completion(self, *args, **kwargs)
     69         if self.exception:
---> 70             raise self.exception
     71         else:

ServiceError: ServiceError('HTTP operation returned: 403 TooManyDevicesError(Error: Forbidden)')

The above exception was the direct cause of the following exception:

ClientError                               Traceback (most recent call last)
C:\Users\WILLIA~1.HAR\AppData\Local\Temp/ipykernel_4496/1912816677.py in <module>
----> 1 blob_info = client.get_storage_info_for_blob("camera-images")
      2 sas_url = "https://{}/{}/{}{}".format(
      3             blob_info["hostName"],
      4             blob_info["containerName"],
      5             blob_info["blobName"],

~\anaconda3\envs\azure-iot\lib\site-packages\azure\iot\device\iothub\sync_clients.py in get_storage_info_for_blob(self, blob_name)
    587         callback = EventedCallback(return_arg_name="storage_info")
    588         self._http_pipeline.get_storage_info_for_blob(blob_name, callback=callback)
--> 589         storage_info = handle_result(callback)
    590         logger.info("Successfully retrieved storage_info")
    591         return storage_info

~\anaconda3\envs\azure-iot\lib\site-packages\azure\iot\device\iothub\sync_clients.py in handle_result(callback)
     54         raise exceptions.ClientError(message="Client has already been shut down", cause=e)
     55     except Exception as e:
---> 56         raise exceptions.ClientError(message="Unexpected failure", cause=e)
     57 
     58 

ClientError: ClientError('Unexpected failure') caused by ServiceError('HTTP operation returned: 403 TooManyDevicesError(Error: Forbidden)')

Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

@danhellem
Copy link
Contributor

danhellem commented Sep 16, 2021

@lmazuel thanks for reporting this. We will take a look and get back to you in a few days

Also, have you tried running the sample here?

@danhellem
Copy link
Contributor

@lmazuel we have not heard from you in few days. We will be closing this issue if we don't hear back by 10/1.

@L-PDS
Copy link

L-PDS commented Feb 3, 2023

I am experiencing the same issue. Was there a solutions for this?

@BillmanH
Copy link

Neither of these two issues were addressed by either team. Just copied here and then closed. Sorry.

@yk8329
Copy link

yk8329 commented Jul 20, 2023

@danhellem facing the same issue. Please look into this asap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants