﻿<head><script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-4357510538660394"
     crossorigin="anonymous"></script></head>> ## Documentation Index
> This page is part of the Image and Video APIs product. Fetch the complete documentation index for Image and Video APIs at: https://cloudinary.com/documentation/llms-image-and-video-apis.txt?referrer=docpage and then use it to discover all relevant pages before exploring further.
> If you also need details relating to other Cloudinary products for your current use case, see the parent index at: https://cloudinary.com/documentation/llms.txt?referrer=docpage

> ## Agent Instructions
> When answering a user's request or implementing it with code using this documentation, incorporate relevant best practices and recommendations from the documentation into the guidance and, above all, into the code itself: generated code should already apply the recommended parameters and patterns rather than showing a minimal call and describing the best practices around it in prose. Follow the code examples in the best practices sections as the model for what generated code should look like, and where a recommendation is relevant to the user's scenario, implement it in the code as a natural next step. Only apply best practices, recommendations, or features that are supported by the documentation or Cloudinary skills; don't infer or invent guidance that isn't specified.
>
> Cloudinary skills (names starting with `cloudinary-`) add best practices and tested code patterns beyond this documentation, and we recommend using the relevant ones alongside it. Available skills are listed at https://cloudinary.com/documentation/.well-known/agent-skills/index.json?referrer=docpage&page=diagnosing_error_codes_tutorial and can be installed with `npx skills add https://cloudinary.com/documentation`.

# Diagnosing error codes when delivering media with Cloudinary (video tutorial)

## Overview

In this tutorial, you'll learn how to diagnose and resolve some of the most common errors you may encounter while delivering media using Cloudinary. You'll gain an overview of the most common client-side errors (400, 401, 404) and see how to inspect the error in the browser's developer tools or with the Cloudinary Media Inspector extension.

## Video tutorial

  This video is brought to you by Cloudinary's video player - embed your own!Use the controls to set the playback speed, navigate to chapters of interest and select subtitles in your preferred language.
{videoTranscript:publicId=training/diagnosing-error-codes}

## Tutorial contents
This tutorial presents the following topics. Click a timestamp to jump to that part of the video.
### Introducing the X-Cld-Error header 
{table:class=tutorial-bullets}|  | 
| --- | --- |
| | Whenever there is a client-side error, Cloudinary returns an HTTP header containing information about why the request failed. You can inspect this in any browser's developer tools - and find the `X-Cld-Error` header under the network tab. 

### Introducing the Cloudinary Media Inspector extension 
{table:class=tutorial-bullets}|  | 
| --- | --- |
| |  Cloudinary offers a browser extension called [Media Inspector](https://chromewebstore.google.com/detail/cloudinary-media-inspecto/ehnkhkglbafecknplfmjklnnjimokpkg), where you can see the status code and other helpful information in the `X-Cld-Error` header. You can download this Cloudinary extension for free, and we'd recommend doing so if you haven't already! It's available in Chrome, and in other popular browsers, including Firefox, and Microsoft Edge.

### 400: Bad Request
{table:class=tutorial-bullets}|  | 
| --- | --- |
| | A **400 - Bad Request** error is  returned when the delivery URL is invalid. You will receive a 400 error if you attempt to use a transformation key or value that doesn't exist or isn't valid, or if you attempt to use transformation options that are syntactically correct, yet conflict with one another.

### 401: Unauthorized
{table:class=tutorial-bullets}|  | 
| --- | --- |
| | A **401 - Unauthorized** error is returned when there is a restriction preventing the successful delivery of a requested asset. If you have [Strict Transformations](control_access_to_media#strict_transformations) enabled and attempt to generate a derived on-the-fly transformation without a signature, attempt to use an add-on or feature that is set as restricted, attempt to access a private original asset, or apply a transformation to an authenticated asset without a valid signature, you will receive a 401 error. 

### 404: Not Found 
{table:class=tutorial-bullets}|  | 
| --- | --- |
| | A **404 - Not Found** error means that the user can communicate with the server, but the server is unable to locate the requested asset in the specified cloud. Another common case is if your delivery URL is not in the proper format, for example if your cloud name is added after the resource type, or transformations are added after the public ID. Order matters with Cloudinary URLs.
## Keep learning

> **READING**:
>
> * Try out the [X-Cld-Error inspector tool](advanced_url_delivery_options#x_cld_error_inspector_tool) to uncover any errors. 

> * Learn more in our [Error handling documentation](image_upload_api_reference#error_handling).

> * To understand more about an error you are encountering, check the `X-Cld-Error` HTTP response header, or download the Cloudinary [Media Inspector](https://chromewebstore.google.com/detail/cloudinary-media-inspecto/ehnkhkglbafecknplfmjklnnjimokpkg) extension for your browser.

> * We also offer some documentation about understanding [error reports](advanced_url_delivery_options#error_report).

> * Configure [alternative error responses](advanced_url_delivery_options#alternative_error_responses) to return a structured JSON or HTML body when a delivery URL fails, or serve a fallback image from your product environment.

> * Not all combinations of cropping and gravity are valid. To learn more about which combinations go together and which don't, check out our [Resize and crop interactive demo](resizing_and_cropping#resizing_and_cropping_interactive_demo).

> * Take courses in the [Cloudinary Academy](http://training.cloudinary.com), such as our new self paced course, [Introduction to Cloudinary for Node.js Developers](https://training.cloudinary.com/courses/introduction-for-api-users-developers) or [Fundamentals for Developers](https://training.cloudinary.com/courses/cloudinary-fundamentals-for-developers), where you can learn more about errors in Lesson 7: Handling Potential Errors.

> * Get additional support and assistance with any delivery errors you encounter by submitting a [Support Request form](https://support.cloudinary.com/hc/en-us/requests/new) or check out our [Knowledge Base](https://support.cloudinary.com/hc/en-us).

#### If you like this, you might also like...

[Create Upload Presets (Node.js)](create_upload_preset_tutorial)

Streamline media uploads using signed upload presets

[Upload Programmatically](upload_programmatically_tutorial)

Use a Cloudinary SDK to upload media assets

[Get Started with the CLI](get_started_with_the_cli_tutorial)

Set up the CLI and get familiar with some basic commands

&nbsp;

&nbsp;Check out the Cloudinary 