Unable to query my Product Environment
I'm using nodejs sdk, and I have this simple config in my project:
cloudinary.config ({ cloud_name: "testname", api_key: "11223344556677", api_secret: "h64hsh6wh7whs", secure: true, analytics: false, hide_sensitive: true }) const result = await cloudinary.api .resources() .then(result=> console.log(result));
But I'm getting this error all the time:
Socket connection timeout Stack trace: at new NodeError (node:internal/errors:399:5) at Timeout.internalConnectMultipleTimeout (node:net:1638:3) at process.processTimers (node:internal/timers:514:7)
Best Answer
-
Hi there,
Thanks for reaching out.
I'm afraid I cannot be of much help, as this seems to be an issue with your connection or with your version of Node, rather than a Cloudinary-specific problem. As the request never hit our servers, there will not be any logs on our end that I could use to help debug the issue.
I do however want to mention that you should never share your API secret with anyone. If we need to ask you for this credential for account ownership verification, we would only ever ask for the last four characters. I would advise that you generate a new API key/secret pair.
If you have any questions, do not hesitate to ask.
Kind regards,
Tia
Helpful Links For You
💬 Share questions, connect with other users in our Cloudinary Community forums and Discord server!
🧑🎓 Join our Cloudinary Academy for free courses, workshops and other educational resources.
📄 Read our documentation for in-depth details on Cloudinary product features and capabilities
📰 Check out the Cloudinary blog for the latest company news and insights1
Answers
-
And without await, getting this expected error:
[ERROR] [UnhandledRejection] Astro detected an unhandled rejection. Here's the stack trace: Error: Socket connection timeout at new NodeError (node:internal/errors:399:5) at internalConnectMultiple (node:net:1099:20) at Timeout.internalConnectMultipleTimeout (node:net:1638:3) at listOnTimeout (node:internal/timers:575:11) at process.processTimers (node:internal/timers:514:7) Hint: Make sure your promises all have an `await` or a `.catch()` handler.
0 -
This is my restricted image types setting:
And I don't think this is causing the issue.
0 -
Thanks for clarifying that this isn't the issue at Cloudinary end itself.
And regarding the api key and secret, they're just for demo purpose, they're not the real ones.
I do also need to know what these options are for under restricted image types as I couldn't find any information about them anywhere in the documentation. Basically, details about these and their effects:
- Fetched URL
- Media Optimization
- Resources List
- Static Asset
- Authenticated
- Private
- Uploaded
0 -
Hi @vedxp,
Thanks for your response.
Please refer to our article which explains why we have this restricted list in place:
1) Fetched URL: This restricts the fetching of remote URLS. For more information, please check: https://cloudinary.com/documentation/fetch_remote_images#overview
2) Media Optimization: Media Optimization, which consists of basic resizing, format selection, efficient encoding and delivery of media.
https://cloudinary.com/documentation/media_optimization
3) Resources List: You can use the list delivery type to generate a JSON listing of all assets with a specified tag directly from your front-end code.
https://cloudinary.com/documentation/list_assets#client_side_asset_lists
4) Static Asset: You can restrict static files that you have in your web application such as background images, buttons, icons, scripts.
https://cloudinary.com/documentation/rails_image_manipulation#static_files
5) Authenticated: When an asset is set as authenticated, access to both the original asset URLs and all derived (transformed) versions of the asset is restricted. These assets and their derived versions cannot be accessed without some form of authentication.
https://cloudinary.com/documentation/control_access_to_media#authenticated_media_assets
6) Private: Images can be uploaded as private to restrict access to the original asset and only allow access to derived (transformed) versions of the asset.
https://cloudinary.com/documentation/control_access_to_media#private_media_assets
7) Uploaded: This is part of the delivery type for uploaded assets. In most cases, this delivery type indicates that the asset is publicly available. However, there are options you can use to restrict access to assets with an upload delivery type. This includes strict transformations and access mode settings)Upload API
I hope this helps. Please let me know if you have further questions.
Best Regards,
Sree
1