pycloudinary icon indicating copy to clipboard operation
pycloudinary copied to clipboard

resources_by_asset_folder Not working

Open NotCoderBoy opened this issue 2 years ago • 3 comments

Error parsing server response (404) when function is called

Behaviour - Functions are not working as expected

Error screenshots or Stack Trace

JSONDecodeError Traceback (most recent call last) /usr/local/lib/python3.10/dist-packages/cloudinary/api_client/execute_request.py in execute_request(http_connector, method, params, headers, auth, api_url, **options) 74 try: ---> 75 result = json.loads(body.decode('utf-8')) 76 except Exception as e:

7 frames JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

GeneralError Traceback (most recent call last) /usr/local/lib/python3.10/dist-packages/cloudinary/api_client/execute_request.py in execute_request(http_connector, method, params, headers, auth, api_url, **options) 76 except Exception as e: 77 # Error is parsing json ---> 78 raise GeneralError("Error parsing server response (%d) - %s. Got - %s" % (response.status, body, e)) 79 80 if "error" in result:

GeneralError: Error parsing server response (404) - b'\n<html lang='en' xml:lang='en' xmlns='[https://www.w3.org/1999/xhtml](https://www.w3.org/1999/xhtml/)'>

\n<meta charset='utf-8'>\n<meta content='width=device-width, initial-scale=1.0' name='viewport'>\nCloudinary - Page not found\n<link href='//fonts.googleapis.com/css?family=Roboto:500,400italic,300,700,500italic,400&display=swap' rel='stylesheet'>\n<link href='//fonts.googleapis.com/css?family=Montserrat:300,500,700&display=swap' rel='stylesheet'>\n<link href='//fonts.googleapis.com/css?family=Roboto+Mono:300,400&display=swap' rel='stylesheet'>\n<link href='[https://plus.google.com/+Cloudinary](https://plus.google.com/+Cloudinary/)' rel='publisher'>\n<link href='[https://res.cloudinary.com/prod/image/upload/w_57/console/favicon.png](https://res.cloudinary.com/prod/image/upload/w_57/console/favicon.png/)' rel='apple-touch-icon' sizes='57x57'>\n<link href='[https://res.cloudinary.com/prod/image/upload/w_114/console/favicon.png](https://res.cloudinary.com/prod/image/upload/w_114/console/favicon.png/)' rel='apple-touch-icon' sizes='114x114'>\n<link href='[https://res.cloudinary.com/prod/image/upload/w_72/console/favicon.png](https://res.cloudinary.com/prod/image/upload/w_72/console/favicon.png/)' rel='apple-touch-icon' sizes='72x72'>\n<link href='[https://res.cloudinary.com/prod/image/upload/w_144/console/favicon.png](https://res.cloudinary.com/prod/image/upload/w_144/console/favicon.png/)' rel='apple-touch-icon' sizes='144x144'>\n<link href='[https://res.cloudinary.com/prod/image/upload/w_60/console/favicon.png](https://res.cloudinary.com/prod/image/upload/w_60/console/favicon.png/)' rel='apple-touch-icon' sizes='60x60'>\n<link href='[https://res.cloudinary.com/prod/image/upload/w_120/console/favicon.png](https://res.cloudinary.com/prod/image/upload/w_120/console/favicon.png/)' rel='apple-touch-icon' sizes='120x...

I am working on Colab

Environment and Frameworks (fill in the version numbers)

  • Summary: Python and Django SDK for Cloudinary - 1.38.0
  • Python Version - 3.10

NotCoderBoy avatar Feb 04 '24 08:02 NotCoderBoy

can I work on this issue?

someshfengde avatar Oct 01 '24 09:10 someshfengde

@NotCoderBoy this is happening because this API is only supported on dynamic folders as per https://cloudinary.com/documentation/admin_api#get_resources_by_asset_folder.

You can confirm your folder mode via https://console.cloudinary.com/pm/developer-dashboard.

The error could be better so @someshfengde maybe you can work on that?

tommyg-cld avatar Oct 01 '24 10:10 tommyg-cld

yes sure will add more precise error handling to it

someshfengde avatar Oct 01 '24 10:10 someshfengde