Это перевод с сайта www.bluefrontier.co.uk.
Что означают ошибки с кодами 4XX
Ошибки с кодами 4XX — это ошибки, которые возникают, когда веб-страница не существует или когда доступ к ней ограничен. Обычно это случается из-за неправильно набранного URL-адреса. Если страница недоступна, то она не может обмениваться данными с веб-сервером, в результате чего выводится ошибка 4XX и пользователь не может получить доступ к странице или сайту.
Сначала разберём популярные типы ошибок с кодом 4XX, а потом поговорим о том, как их исправить.
400 Bad Request или «Некорректный запрос»
400 Bad Request возникает при отправке неправильного или поврежденного запроса на веб-сервер. В результате сервер, принимающий запрос, не может его понять.
Как и сообщение об ошибке типа «404 Не найдено», страницы 400 можно нужным образом настраивать.
401 Unauthorized или «Авторизация не пройдена»
HTTP-ошибка 401 говорит о том, что запрос отправлен клиентом, аутентификация которого невозможна. Причина может быть в том, что:
- клиент не предоставил корректные учётные данные вместе со своим запросом;
- клиенту по какой-либо причине запрещён доступ к веб-ресурсу;
- сервер отклонил учетные данные клиента.
403 Forbidden или «Доступ запрещен»
Это сообщение об ошибке отображается при попытке обратиться к странице или веб-ресурсу, доступ к которому строго запрещён. Как правило, в таком случае пользователю будут предоставлены базовые указания для решения этой проблемы.
404 Not Found или «Страница не найдена»
Страница с ошибкой 404 будет показана пользователю при переходе по «битым» ссылкам. В результате он не сможет получить доступ к соответствующей странице. Ошибка «Cтраница не найдена» обычно вызвана некорректным URL-адресом или тем, что данная страница уже перестала быть общедоступной.
Также ошибка 404 может возникнуть, если на страница или ресур «переехали» на другой URL, но перенаправление со старого URL-адреса на новый не настроено.
Эта ошибка указывает на то, что сервер доступен, но конкретная страница, на которую вы пытаетесь попасть, недоступна.
Как выглядят ошибки с кодами 4XX
Ошибки 4XX легко выявить — они появляются в окне браузера и обычно объясняют, что именно произошло. На рисунке ниже показаны примеры сообщений, которые могут быть выведены пользователю:
Как исправить ошибку с кодом 4XX
- Проверьте URL-адрес, не ошиблись ли вы, когда печатали его? Если адрес сайта набран неправильно, то, скорее всего, вы увидите ошибку «404 — Not Found».
- Очистите файлы cookie и кэш браузера. Возможно, ваш браузер пытается использовать недействительные или просроченные файлы cookie. Возможно, ваш браузер сохранил в кэше поврежденную версию страницы, которую вы пытаетесь открыть, поэтому возвращается ошибка 400 Bad Request.
Как очистить cookie и кэш браузера
Обычно это делается в настройках браузера. Они всегда находятся в верхнем правом углу экрана.
В Google Chrome: Настройки → Безопасность и конфиденциальность → Очистить историю.
В Яндекс.Браузере: Настройки → Системные → Очистить историю.
В Mozilla Firefox: Настройки → Приватность и защита → Куки и данные сайтов → Удалить данные.
- Обратите внимание на то, что причина ошибки может быть в сервере, принимающем запрос. Некоторые серверы не настроены на отправку более информативных сообщений и присылают просто ошибку. Например, вы загружаете на сайт слишком большой файл. Вместо указания на то, что размер файла превышает максимально допустимый, сервер отправляет HTTP-ошибку с кодом 400.
- Обновите страницу, это то же самое, что выключить и снова включить какое-нибудь устройство. Это действие не всегда помогает, но попробовать стоит. Просто нажмите клавишу F5, и ваш браузер перезагрузит страницу. Если вы всё равно получаете ошибку, то можно, придерживаясь того же подхода, попробовать перезагрузить компьютер.
- Попробуйте воспользоваться поиском по сайту. Не всегда легко заметить, что URL-адрес набран неправильно, особенно, если в нём вместо понятных слов используются цифры и символы. Если вы наберёте в браузере «site.com:ключевое слово», то в поисковой выдаче должны появиться страницы сайта, содержащие этот запрос. Это эффективный способ поиска страниц, у которых могут быть новые URL-адреса.
- Для проверки зайдите на другие сайты. Если вы постоянно видите HTTP-ошибки, причиной может быть ваш компьютер или сетевое оборудование. Попробуйте зайти на другие сайты и посмотреть, не появляется ли на них HTTP-ошибка с кодом 4XX.
- Если вы пытаетесь где-то авторизоваться, чтобы получить доступ к определённым данным, проверьте, что используете правильный URL-адрес. URL-адреса могут обновляться или изменяться, поэтому если вы когда-то добавили страницу в закладки, то сейчас она может быть уже неактуальной. Также важно убедиться, что вы используете правильные данные для входа в систему, поскольку неправильные могут привести к появлению сообщения об ошибке с кодом 401.
- Если ничего из вышеперечисленного не помогает, свяжитесь с администраторами сайта.
Ошибки 4XX: негативное влияние на SEO
Когда внутренняя ссылка на страницу сайта или внешняя ссылка, ведущая на ваш сайт с другого ресурса меняется, удаляется или не работает, такую ссылку называют «битой». Она не позволит увидеть пользователю соответствующий контент. Вместо этого появится сообщение об ошибке с кодом 4XX.
Чаще всего это сообщение выглядит примерно так: «400: Bad Request», «400: некорректный запрос» или «HTTP-ошибка с кодом 400».
Полезно: Полный гайд по кодам ответа сервера 1**, 2**, 3**, 4**,5**
Внутренние ссылки
С точки зрения SEO важно исправлять битые внутренние ссылки, поскольку они мешают поисковым системам правильно индексировать ваш сайт. Более того, с позиции бизнеса, из‑за битых ссылок ваш сайт будет выглядеть непрофессионально, а это уже может дать повод полагать, что на таком же уровне организован и весь бизнес. Когда появляется страница с ошибкой, особенно стандартная, ваш посетитель и потенциальный клиент просто уйдёт к конкуренту.
К счастью, у Google есть Search Console — инструмент, который позволяет легко отслеживать битые ссылки и составлять графики с данными по ним.
Для этого зайдите в Google Search Console и перейдите в «Настройки» → «Статистика сканирования». Обратите внимание на поле «По ответу» — в нём указано количество страниц с ошибками:
Кликнув на ошибки, вы увидите какие именно страницы сайта отдают эти ошибки.
Кроме того, инструмент обнаружения битых ссылок на сайте есть у Топвизора. Перейдите в Аудит → Ссылки. Инструмент покажет ошибки:
В некоторых случаях, например, для Wordpress, Drupal и Joomla, есть встроенное расширение, которое вы можете использовать для автоматической проверки на наличие битых ссылок.
Внешние ссылки
Внешние ссылки или, как их ещё называют, «входящие ссылки», могут стать «битыми» из‑за изменения URL‑адреса или местоположения контента, а также из‑за допущенной ошибки в самом URL‑адресе.
В результате такие ссылки негативно влияют на ранжирование вашего сайта в поисковых системах и на впечатления посетителей от использования сайта.
Как «лечить» битые ссылки
Вот несколько возможных вариантов.
Исправьте сами ссылки или настройте редирект
Сначала необходимо обнаружить битую ссылку. Как и в случае с внутренними ссылками, проверьте ошибки сканирования в Google Search Console, найдите все ссылки с ошибками и их источник.
После обнаружения источника, свяжитесь с вебмастером ресурса и попросите исправить ссылку. Если по каким‑то причинам вы не можете связаться с ним, настройте редирект (301‑й код состояния HTTP) на исходную статью. Google с радостью перенесёт всю ссылочную ценность с вашей битой ссылки на текущую.
Инструкция по настройке 301‑го редиректа от Google
Чем больше входящих ссылок связано со страницей, тем выше её позиции в ранжировании, поэтому нужно тщательно продумывать удаление или изменение имён файлов страниц.
Поддерживайте распределение ссылочного веса
«Ссылочный вес» служит своеобразной валютой в поисковике Google и используется в алгоритмах поисковых систем для определения рейтинга сайта или страницы. Страницы связаны между собой ссылками, и их ценность передаётся от одной страницы к другой. Если ссылка не работает, то передача ссылочного веса прекращается, и он теряется. Это может сильно повлиять на ранжирование сайта и ухудшить впечатления пользователей от сайта, снижая его посещаемость.
Создавая пользовательскую страницу для сообщения об ошибке с кодом 404, вы можете перенаправить пользователя либо на главную страницу сайта, либо на предыдущую страницу, чтобы вернуть его на шаг назад. Несмотря на то, что пользователю отображается страница с сообщением об ошибке, он может легко вернуться на предыдущую посещенную страницу сайта без необходимости заново начинать весь процесс.
Перенаправляя посетителей на предыдущие страницы, сайт сохраняет ссылочный вес, который в противном случае был бы потерян.
Создавайте нестандартные страницы с ошибкой 404
Страница с ошибкой 404 служит для информирования посетителя сайта о том, что страница не может быть найдена, например из‑за нерабочей ссылки или даже просто опечатки.
Мы предлагаем создавать нестандартные страницы с ошибкой на вашем сайте. У такой страницы есть несколько преимуществ.
Во‑первых, нестандартная страница с сообщением об ошибке гораздо проще в понимании. У посетителя сайта будет складываться впечатление, что сайтом всё еще кто‑то занимается, в отличие от стандартной страницы об ошибке, которая свидетельствует о том, что сайт, возможно, давно не обновляли.
Но ещё важнее то, что пользовательская страница с ошибкой 404 может помочь пользователю найти именно то, что он искал. А это позволит не упустить трафик, если у вас окажется много битых ссылок. У Google есть несколько хороших советов по созданию полезной страницы с ошибкой 404.
Не игнорируйте ошибки с кодами 4XX, потому что они сильно влияют на впечатления посетителей сайта. Если вы вдруг ещё не знали, алгоритмы Google ориентированы на обеспечение максимально положительного пользовательского опыта.
Хотя битые ссылки — только один из многочисленных факторов, которые учитывает поисковой робот Google, они могут привести к потере ценного трафика, поскольку пользователи разочаровываются, когда переходят по нерабочим ссылкам на несуществующие страницы. В конечном счёте битые ссылки негативно отразятся на поведенческих факторах сайта и, как следствие, на его эффективности с точки зрения SEO.
Когда на вашем сервере запрашивается страница с вашего сайта (например, когда пользователь открывает страницу в браузере или когда ее сканирует робот Googlebot), ваш сервер в ответ на запрос возвращает код статуса НТТР.
Этот код статуса содержит информацию о статусе запроса. Код статуса предоставляет роботу Googlebot информацию о вашем сайте и запрашиваемой странице.
Ниже представлено несколько основных кодов статуса.
- 200 — сервер успешно открыл страницу
- 404 — запрашиваемая страница не существует
- 503 — сервер временно недоступен
Полный список кодов статуса НТТР приведен ниже. Чтобы получить дополнительную информацию, нажмите на ссылку. Дополнительную информацию читайте на странице W3C о кодах статуса HTTP.
1xx (предварительный ответ)
Эти коды статуса представляют собой предварительный ответ, после его получения пользователь, запрашивающий страницу, должен предпринять определенные действия.
Код | Описание |
---|---|
100 (продолжить) | Отправитель должен продолжить запрос. Сервер возвращает этот код, чтобы сообщить, что получена только первая часть запроса и ожидается оставшаяся. |
101 (переключение протоколов) | Отправитель запросил переключение протоколов на сервере, и сервер подтверждает, что это будет сделано. |
2xx (успешно)
Эти коды статуса говорят о том, что сервер успешно обработал запрос.
Код | Описание |
---|---|
200 (успешно) | Запрос успешно обработан сервером. Обычно это означает, что сервер предоставил запрашиваемую страницу. Если этот статус отображается для файла robots.txt, это означает, что робот Googlebot успешно его просканировал. |
201 (создано) | Запрос успешно принят, и сервером создан новый ресурс. |
202 (принято) | Запрос принят сервером, но еще не обработан. |
203 (неавторитетная информация) | Сервер успешно обработал запрос, но возвращает информацию, которая могла быть получена из другого источника. |
204 (нет содержания) | Сервер успешно обработал запрос, но не возвращает содержание. |
205 (сброс содержания) | Сервер успешно обработал запрос, но не возвращает содержание. В отличие от кода 204, этот ответ требует, чтобы отправитель запроса сбросил представление документа (например, очистил форму для ввода новых данных). |
206 (неполное содержание) | Сервер успешно обработал часть запроса GET. |
3xx (переадресация)
Для выполнения запроса необходимо предпринять дополнительные действия. Часто эти коды статуса используются для переадресации. Google рекомендует использовать не более пяти переадресаций для каждого запроса. С помощью инструментов для веб-мастеров можно узнать, не возникли ли ошибки при попытке сканирования страниц с переадресацией. На странице Ошибки при сканировании в разделе Диагностика приведен список URL-адресов, которые робот Googlebot не смог просканировать из-за ошибок перенаправления.
Код | Описание |
---|---|
300 (множественный выбор) | Сервер может предпринять несколько действий в ответ на полученный запрос. Сервер может выбрать действие в зависимости от отправителя (агент пользователя) или предоставить список, чтобы отправитель выбрал действие самостоятельно. |
301 (окончательно перемещено) | Запрашиваемая страница окончательно перемещена в новое местоположение. Когда сервер возвращает этот ответ (на запрос GET или HEAD), он автоматически перенаправляет отправителя запроса в новое местоположение. Этот код следует использовать, чтобы сообщить роботу Googlebot о том, что страница или сайт окончательно перемещены в новое местоположение. |
302 (временно перемещено) | Сервер отвечает на запрос, возвращая страницу из другого местоположения, но отправитель должен указывать в последующих запросах исходное местоположение. Этот код аналогичен коду 301 — при запросах GET и HEAD он автоматически перенаправляет отправителя в другое местоположение, но его не следует использовать для оповещения робота Googlebot об окончательном перемещении страницы или сайта, так как робот будет продолжать сканировать и индексировать исходное местоположение. |
303 (другое местоположение) | Сервер возвращает этот код, если отправитель должен отправить отдельный запрос GET в другое местоположение, чтобы получить ответ. При получении всех запросов, кроме HEAD, сервер автоматически перенаправляет отправителя в другое местоположение. |
304 (не изменено) | Запрашиваемая страница не изменялась после предыдущего запроса. Когда сервер возвращает этот ответ, он не передает содержание страницы.
Советуем настроить сервер на возвращение этого ответа (называемого НТТР-заголовком «If-Modified-Since»), если страница не изменялась с момента последнего запроса отправителя. Это позволяет сэкономить полосу пропускания и уменьшить нагрузку, так как ваш сервер лишь сообщает роботу Googlebot, что страница не изменялась после предыдущего сканирования. |
305 (использовать прокси-сервер) | Отправитель запроса может открыть запрашиваемую страницу только через прокси-сервер. Когда сервер возвращает этот ответ, он также указывает прокси-сервер, который нужно использовать отправителю. |
307 (временная переадресация) | Сервер отвечает на запрос, возвращая страницу из другого местоположения, но отправитель должен указывать в последующих запросах исходное местоположение. Этот код аналогичен коду 301 — при запросах GET и HEAD он автоматически перенаправляет отправителя в другое местоположение, но его не следует использовать для оповещения робота Googlebot об окончательном перемещении страницы или сайта, так как робот будет продолжать сканировать и индексировать исходное местоположение. |
4xx (ошибка запроса)
Эти коды статуса указывают, что в запросе, скорее всего, была ошибка, из-за которой сервер не смог его обработать.
Код | Описание |
---|---|
400 (неверный запрос) | Серверу не удалось разобрать синтаксис запроса. |
401 (неавторизованный запрос) | Запрос требует проверки подлинности. Сервер может вернуть этот ответ, если страница защищена паролем. |
403 (доступ запрещен) | Сервер отклоняет запрос. Если робот Googlebot получил этот код статуса при попытке просканировать действующие страницы вашего сайта (эту информацию можно найти в инструментах Google для веб-мастеров на странице Сканирование Интернета в разделе Диагностика), возможно, ваш сервер или хост блокируют доступ робота Google. |
404 (не найдено) | Сервер не может найти запрашиваемую страницу. Например, серверы часто возвращают этот код, если запрашивается несуществующая страница.
Если на вашем сайте нет файла robots.txt и этот статус указан на странице robots.txt на вкладке «Диагностика» в Инструментах Google для веб-мастеров, то это правильный статус. Однако, если вы видите этот статус при наличии файла robots.txt, значит, файлу присвоено неверное имя или у него неверное местоположение. (Его нужно размещать в домене верхнего уровня под именем robots.txt.) Если этот статус указывается для URL-адресов, которые робот Googlebot пытался просканировать (на вкладке «Диагностика» страницы «Ошибки HTTP»), тогда он, вероятно, перешел по неработающей ссылке с другой страницы (возможно, эта ссылка устарела или содержала опечатки). |
405 (недопустимый метод) | Метод, указанный в запросе, не разрешен. |
406 (неприемлемый запрос) | Запрашиваемая страница не может быть возвращена с указанными в запросе характеристиками содержания. |
407 (требуется проверка подлинности на прокси-сервере) | Этот код статуса аналогичен коду 401 (неавторизованно), но указывает, что отправитель запроса должен выполнить проверку подлинности через прокси-сервер. Когда сервер возвращает этот ответ, он также указывает прокси-сервер, который нужно использовать отправителю. |
408 (тайм-аут запроса) | На сервере истекло время ожидания запроса. |
409 (конфликт) | При выполнении запроса возник конфликт на сервере. Сервер должен включать информацию о конфликте в ответ. Сервер может вернуть этот код в ответ на запрос PUT, конфликтующий с более ранним запросом, вместе со списком различий между запросами. |
410 (удалено) | Сервер возвращает этот ответ, когда запрашиваемый ресурс был окончательно удален. Он аналогичен коду 404 (не найдено), но иногда используется вместо него, если запрашиваемые ресурсы ранее существовали, а теперь удалены. Если ресурс был окончательно перемещен, следует использовать код 301, указав новое местоположение ресурса. |
411 (необходимо указать длину) | Сервер не принимает запрос без действительного поля заголовка Content-Length. |
412 (не выполнено предварительное условие) | Сервер не соответствует одному из предварительных условий, указанных отправителем в запросе. |
413 (слишком большой размер запроса) | Сервер не может обработать запрос, потому что его размер превышает максимально допустимый. |
414 (слишком большой размер запрашиваемого URI) | Запрашиваемый URI (обычно URL-адрес) имеет слишком большой размер для обработки сервером. |
415 (неподдерживаемый тип содержания) | Формат запроса не поддерживается запрашиваемой страницей. |
416 (невыполнимый диапазон запроса) | Сервер возвращает этот код статуса, если запрашивается недоступный для страницы диапазон. |
417 (результат не соответствует ожидаемому) | Сервер не может выполнить требования, указанные в поле заголовка запроса «Expect» |
5xx (ошибка сервера)
Эти коды статуса указывают на то, что при обработке запроса на сервере возникла внутренняя ошибка. Эти ошибки чаще связаны не с запросом, а с самим сервером.
Код | Описание |
---|---|
500 (внутренняя ошибка сервера) | На сервере возникла ошибка, и он не может выполнить запрос. |
501 (метод не поддерживается) | На сервере нет функций, необходимых для выполнения запроса. Например, серверы возвращают этот код, если не распознают метод запроса. |
502 (ошибка шлюза) | Сервер, действуя в качестве шлюза или прокси-сервера, получил недопустимый ответ от вышестоящего сервера. |
503 (служба недоступна) | Сервер временно недоступен (так как он перегружен или отключен для обслуживания). Обычно это временное состояние. |
504 (тайм-аут шлюза) | Сервер, действуя в качестве шлюза или прокси-сервера, не получил своевременный ответ от вышестоящего сервера. |
505 (версия HTTP не поддерживается) | Сервер не поддерживает версию протокола НТТР, используемую при запросе. |
- 400 Bad Request
- 403 Forbidden
- 404 Not Found
- 405 Method Not Allowed
- 406 Not Acceptable
- 409 Conflict
- 410 Gone
- 413 Payload Too Large
- 415 Unsupported Media Type
- 422 Unprocessable Entity
- 429 Too Many Requests
- The status of verifying the right to manage the site (ApiVerificationState)
- Rights verification methods (ApiVerificationType)
- Explicit methods of rights verification (ApiExplicitVerificationType)
- Reasons for refusal to verify site management rights (ApiVerificationFailReason)
- Source of the Sitemap file (ApiSitemapSource)
- Type of Sitemap file (ApiSitemapType)
- Site indexing status (ApiHostDataStatus)
- Indexing indicators (ApiIndexingIndicator)
- Query indicators (ApiQueryIndicator)
- Query sorting order (ApiQueryOrderField)
- Device type indicators (ApiDeviceTypeIndicator)
- Indicators of external links (ApiExternalLinksIndicator)
- Internal link indicators (ApiInternalLinksBrokenIndicator)
- Reindexing request status (RecrawlStatusEnum)
- Issue categories on the site (SiteProblemSeverityEnum)
- State of the issue (ApiSiteProblemState)
- Type of site issue (ApiSiteProblemTypeEnum)
- HTTP status codes received by the robot during indexing (IndexingStatusEnum)
- Site page status in search results (ApiSearchEventEnum)
- Changes to important pages in the search (ApiImportantUrlChangeIndicator)
- Reasons for excluding the page from search results (ApiExcludedUrlStatus)
- RSS feed upload modes (PagesLoadMode)
- RSS feed upload mode filter (TaskTypeFilter)
- Status of the RSS feed upload task (LoadStatus)
ENTITY_VALIDATION_ERROR
The request body validation failed.
{
"error_code": "ENTITY_VALIDATION_ERROR",
"error_message": "some string"
}
Parameter | Description |
---|---|
error_code |
Error code. |
error_message |
Error message. |
FIELD_VALIDATION_ERROR
Invalid parameter passed.
{
"error_code": "FIELD_VALIDATION_ERROR",
"error_message": "explicit error message",
"field_name": "some string",
"field_value": "some string",
"error_message": "explicit error message"
}
Parameter | Description |
---|---|
error_code |
Error code. |
field_name |
Field. |
field_value |
Value. |
error_message |
Error message. |
INVALID_URL
Wrong URL was passed.
{
"error_code": "INVALID_URL",
"error_message": "some string"
}
Parameter | Description |
---|---|
error_code |
Error code. |
error_message |
Error message. |
ACCESS_FORBIDDEN
The action is unavailable because the application doesn’t have the necessary permissions.
{
"error_code": "ACCESS_FORBIDDEN",
"error_message": "explicit error message"
}
Parameter | Description |
---|---|
error_code |
Error code. |
error_message |
Error message. |
INVALID_OAUTH_TOKEN
The OAuth token is missing or invalid.
{
"error_code": "INVALID_OAUTH_TOKEN",
"error_message": "explicit error message"
}
Parameter | Description |
---|---|
error_code |
Error code. |
error_message |
Error message. |
INVALID_USER_ID
The ID of the user who issued the token differs from the one specified in the request. In the examples below, {user_id}
shows the correct uid of the OAuth token owner.
{
"error_code": "INVALID_USER_ID",
"available_user_id": 1,
"error_message": "Invalid user id. {user_id} should be used."
}
Parameter | Description |
---|---|
error_code |
Error code. |
available_user_id |
ID of the user who allowed access. |
error_message |
Error message. |
LICENCE_NOT_ACCEPTED
You have to accept the User agreement.
{
"error_code": "LICENCE_NOT_ACCEPTED",
"error_message": "some string"
}
Parameter | Description |
---|---|
error_code |
Error code. |
error_message |
Error message. |
HOSTS_LIMIT_EXCEEDED
The number of sites in the user’s site list exceeded the limit (the current limit is 1703).
{
"error_code": "HOSTS_LIMIT_EXCEEDED",
"limit": 1,
"error_message": "explicit error message"
}
Parameter | Description |
---|---|
error_code |
Error code. |
limit |
The limit on the number of added sites. |
error_message |
Error message. |
RESOURCE_NOT_FOUND
The resource at the requested path does not exist.
{
"error_code": "RESOURCE_NOT_FOUND",
"error_message": "some string"
}
Parameter | Description |
---|---|
error_code |
Error code. |
error_message |
Error message. |
HOST_NOT_INDEXED
The site isn’t indexed yet.
{
"error_code": "HOST_NOT_INDEXED", //errorCode.
"host_id": "http:ya.ru:80", //id хоста. host id.
"error_message": "some string" //Error message.
}
Parameter | Description |
---|---|
error_code |
Error code. |
host_id |
ID of the requested site. |
error_message |
Error message. |
HOST_NOT_LOADED
The site data isn’t uploaded to Yandex.Webmaster yet.
{
"error_code": "HOST_NOT_LOADED",
"host_id": "http:ya.ru:80",
"error_message": "some string"
}
Parameter | Description |
---|---|
error_code |
Error code. |
host_id |
ID of the requested site. |
error_message |
Error message. |
HOST_NOT_VERIFIED
Site management rights are not verified.
{
"error_code": "HOST_NOT_VERIFIED",
"host_id": "http:ya.ru:80",
"error_message": "some string"
}
Parameter | Description |
---|---|
error_code |
Error code. |
host_id |
ID of the requested site. |
error_message |
Error message. |
HOST_NOT_FOUND
The site is not in the list of the user’s sites.
{
"error_code": "HOST_NOT_FOUND",
"host_id": "http:ya.ru:80",
"error_message": "explicit error message"
}
Parameter | Description |
---|---|
error_code |
Error code. |
host_id |
ID of the requested site. |
error_message |
Error message. |
SITEMAP_NOT_FOUND
The Sitemap for the site wasn’t found.
{
"error_code": "SITEMAP_NOT_FOUND",
"host_id": "http:ya.ru:80",
"sitemap_id": "c7-fe:80-c0",
"error_message": "some string"
}
Parameter | Description |
---|---|
error_code |
Error code. |
host_id |
ID of the requested site. |
sitemap_id |
The Sitemap file ID. |
error_message |
Error message. |
SITEMAP_NOT_ADDED
The Sitemap file is missing.
{
"error_code": "SITEMAP_NOT_ADDED",
"host_id": "http:ya.ru:80",
"sitemap_id": "c7-fe:80-c0",
"error_message": "some string"
}
Parameter | Description |
---|---|
error_code |
Error code. |
host_id |
ID of the requested site. |
sitemap_id |
The Sitemap file ID. |
error_message |
Error message. |
TASK_NOT_FOUND
Failed to find a task with the specified ID.
{
"error_code": "TASK_NOT_FOUND",
"error_message": "some string"
}
Parameter | Description |
---|---|
error_code |
Error code. |
error_message |
Error message. |
QUERY_ID_NOT_FOUND
The specified search query ID does not exist.
{
"error_code": "QUERY_ID_NOT_FOUND",
"error_message": "some string"
}
Parameter | Description |
---|---|
error_code |
Error code. |
error_message |
Error message. |
The HTTP method is not supported for this resource.
{
"error_code": "METHOD_NOT_ALLOWED",
"error_message": "explicit error message"
}
Parameter | Description |
---|---|
error_code |
Error code. |
error_message |
Error message. |
The content types passed in the Accept header are not supported.
{
"error_code": "CONTENT_TYPE_UNSUPPORTED",
"acceptable_types": [
"some string", ...
],
"error_message": "explicit error message"
}
Parameter | Description |
---|---|
error_code |
Error code. |
acceptable_type |
List of supported content types. |
error_message |
Error message. |
URL_ALREADY_ADDED
The URL was already added for reindexing.
{
"error_code": "URL_ALREADY_ADDED",
"error_message": "some string"
}
Parameter | Description |
---|---|
error_code |
Error code. |
error_message |
Error message. |
HOST_ALREADY_ADDED
The site with the specified address is already added to the user’s sites list.
{
"error_code": "HOST_ALREADY_ADDED",
"host_id": "http:ya.ru:80",
"verified": false,
"error_message": "some string"
}
<Data>
<error_code>HOST_ALREADY_ADDED</error_code>
<host_id>http:ya.ru:80</host_id>
<verified>false</verified>
<error_message>some string</error_message>
</Data>
Parameter | Description |
---|---|
error_code |
Error code. |
host_id |
The site ID. |
verified |
Indicates if the site rights are verified. |
error_message |
Error message. |
VERIFICATION_ALREADY_IN_PROGRESS
The rights verification process is in progress.
{
"error_code": "VERIFICATION_ALREADY_IN_PROGRESS",
"verification_type": "META_TAG",
"error_message": "some string"
}
<Data>
<error_code>VERIFICATION_ALREADY_IN_PROGRESS</error_code>
<verification_type>META_TAG</verification_type>
<error_message>some string</error_message>
</Data>
Parameter | Description |
---|---|
error_code |
Error code. |
verification_type |
The verification method being processed ( ApiExplicitVerificationType ). |
error_message |
Error message. |
TEXT_ALREADY_ADDED
The text you added earlier.
{
"error_code": "TEXT_ALREADY_ADDED",
"error_message": "some string"
}
<Data>
<error_code>TEXT_ALREADY_ADDED</error_code>
<error_message>some string</error_message>
</Data>
Parameter | Description |
---|---|
error_code |
Error code. |
error_message |
Error message. |
SITEMAP_ALREADY_ADDED
The Sitemap was already added.
{
"error_code": "SITEMAP_ALREADY_ADDED",
"sitemap_id": "c7-fe:80-c0",
"error_message": "some string"
}
<Data>
<error_code>SITEMAP_ALREADY_ADDED</error_code>
<sitemap_id>c7-fe:80-c0</sitemap_id>
<error_message>some string</error_message>
</Data>
Parameter | Description |
---|---|
error_code |
Error code. |
sitemap_id |
The Sitemap file ID. |
error_message |
Error message. |
Resource unavailable
{
"error_code": "UPLOAD_ADDRESS_EXPIRED",
"valid_until": "2016-01-01T00:00:00,000+0300",
"error_message": "some string"
}
<Data>
<error_code>UPLOAD_ADDRESS_EXPIRED</error_code>
<valid_until>2016-01-01T00:00:00,000+0300</valid_until>
<error_message>some string</error_message>
</Data>
Parameter | Description |
---|---|
error_code |
Error code. |
valid_until |
The date and time until which the URL for task creation is available. |
error_message |
Error message. |
The file size exceeds the limits.
{
"error_code": "REQUEST_ENTITY_TOO_LARGE",
"error_message": "some string"
}
<Data>
<error_code>REQUEST_ENTITY_TOO_LARGE</error_code>
<error_message>some string</error_message>
</Data>
Parameter | Description |
---|---|
error_code |
Error code. |
error_message |
Error message. |
CONTENT_TYPE_UNSUPPORTED
The content type in the request is not supported.
{
"error_code": "CONTENT_TYPE_UNSUPPORTED",
"supported_content_types": [
"some string", ...
],
"error_message": "explicit error message"
}
<Data>
<error_code>CONTENT_TYPE_UNSUPPORTED</error_code>
<supported_content_type>some string</supported_content_type>
...
<error_message>explicit error message</error_message>
</Data>
Parameter | Description |
---|---|
error_code |
Error code. |
supported_content_type |
List of supported content types. |
error_message |
Error message. |
CONTENT_ENCODING_UNSUPPORTED
The request encoding type is not supported.
{
"error_code": "CONTENT_ENCODING_UNSUPPORTED",
"supported_content_encodings": [
"some string"
],
"error_message": "some string"
}
<Data>
<error_code>CONTENT_ENCODING_UNSUPPORTED</error_code>
<supported_content_encoding>some string</supported_content_encoding>
<error_message>some string</error_message>
</Data>
Parameter | Description |
---|---|
error_code |
Error code. |
supported_content_encoding |
List of supported encoding types. |
error_message |
Error message. |
The passed text is too short or too long.
{
"error_code": "TEXT_LENGTH_CONSTRAINTS_VIOLATION",
"max_length": 1,
"min_length": 1,
"actual_length": 1,
"error_message": "explicit error message"
}
<Data>
<error_code>TEXT_LENGTH_CONSTRAINTS_VIOLATION</error_code>
<max_length>1</max_length>
<min_length>1</min_length>
<actual_length>1</actual_length>
<error_message>explicit error message</error_message>
</Data>
Parameter | Description |
---|---|
error_code |
Error code. |
max_length |
Maximum length. |
min_length |
Minimum length. |
actual_length |
The length of the text in the request. |
error_message |
Error message. |
QUOTA_EXCEEDED
The daily quota for requests was exceeded.
{
"error_code": "QUOTA_EXCEEDED",
"daily_quota": 1,
"exceeded_until": "2016-01-01T00:00:00,000+0300",
"error_message": "some string"
}
<Data>
<error_code>QUOTA_EXCEEDED</error_code>
<daily_quota>1</daily_quota>
<exceeded_until>2016-01-01T00:00:00,000+0300</exceeded_until>
<error_message>some string</error_message>
</Data>
Parameter | Description |
---|---|
error_code |
Error code. |
daily_quota |
The maximum number of requests per day. |
exceeded_until |
Time when the new quota starts. |
error_message |
Error message. |
TOO_MANY_REQUESTS_ERROR
Too many requests sent.
{
"error_code": "TOO_MANY_REQUESTS_ERROR",
"daily_quota": 1,
"exceeded_until": "2016-01-01T00:00:00,000+0300",
"error_message": "some string"
}
<Data>
<error_code>TOO_MANY_REQUESTS_ERROR</error_code>
<daily_quota>1</daily_quota>
<exceeded_until>2016-01-01T00:00:00,000+0300</exceeded_until>
<error_message>some string</error_message>
</Data>
Parameter | Description |
---|---|
error_code |
Error code. |
daily_quota |
The maximum number of requests per day. |
exceeded_until |
Time when the new quota starts. |
error_message |
Error message. |
Status | Description |
---|---|
NONE | Verification wasn’t completed and rights are not confirmed. |
VERIFIED | The rights are verified. |
IN_PROGRESS | The rights verification is in progress. |
VERIFICATION_FAILED | Verification was performed but rights are not confirmed. |
INTERNAL_ERROR | An unexpected error occurred when verifying the rights. |
Verification method | Whether a verification check can be requested | Description |
---|---|---|
AUTO | No | Automatic rights verification (deprecated; only for *.narod.ru sites). |
DELEGATED | No | Rights were delegated. |
DNS | Yes | Verifying rights with the DNS record. |
HTML_FILE | Yes | Placing an HTML file in the site’s root directory. |
META_TAG | Yes | Adding a meta tag to the site’s home page header. |
PDD | No | Rights verification via Yandex.Mail for Domains. |
TXT_FILE | No | Placing a text file in the site’s root directory. |
WHOIS | Yes |
Verifying data with information provided by the WHOIS service. This method works only for second-level domains (such as example.com). |
Verification method | Whether a verification check can be requested | Description |
---|---|---|
DNS | Yes | Verifying rights with the DNS record. |
HTML_FILE | Yes | Placing an HTML file in the site’s root directory. |
META_TAG | Yes | Adding a meta tag to the site’s home page header. |
WHOIS | Yes |
Verifying data with information provided by the WHOIS service. This method works only for second-level domains (such as example.com). |
Reason for refusal | Description |
---|---|
DELEGATION CANCELLED | Delegation of site management rights was canceled. |
DNS_RECORD_NOT_FOUND | The specified DNS record doesn’t exist. |
META_TAG_NOT_FOUND | The meta tag is missing in the site’s home page header. |
PDD_VERIFICATION_CANCELLED | Verification of site management rights via Yandex.Mail for Domain isn’t allowed for this site. |
WHOIS_EMAIL_NOT_FOUND | The specified email address is missing in the WHOIS record for this site. |
WRONG_HTML_PAGE_CONTENT | The HTML file content is set incorrectly. |
Source | Description |
---|---|
ROBOTS_TXT | Sitemap is specified in the site’s robots.txt file. |
WEBMASTER | The user added the Sitemap in Yandex.Webmaster. |
INDEX_SITEMAP | Sitemap found in another (index) Sitemap file. |
Type | Description |
---|---|
SITEMAP | Normal Sitemap file that contains the URLs of site pages. |
INDEX_SITEMAP | The Sitemap index file that contains the URLs of other Sitemap files. |
Source | Description |
---|---|
NOT_INDEXED | The site isn’t indexed yet. |
NOT_LOADED | The site data isn’t uploaded to Yandex.Webmaster yet. |
OK | The site is indexed. The data is available in Yandex.Webmaster. |
Indicator | Description |
---|---|
SEARCHABLE | Pages in the search. |
DOWNLOADED | Downloaded pages. |
DOWNLOADED_2XX | Pages downloaded with a 2XX code. |
DOWNLOADED_3XX | Pages downloaded with a 3XX code. |
DOWNLOADED_4XX | Pages downloaded with a 4XX code. |
DOWNLOADED_5XX | Pages downloaded with a 5XX code. |
FAILED_TO_DOWNLOAD | Failed to download. |
EXCLUDED | Excluded pages. |
EXCLUDED_DISALLOWED_BY_USER | Excluded at the request of the resource owner (4XX codes or prohibited in robots.txt). |
EXCLUDED_SITE_ERROR | Excluded due to a site error. |
EXCLUDED_NOT_SUPPORTED | Excluded as not supported by the Yandex robots. |
Indicator | Description |
---|---|
TOTAL_SHOWS | The number of displays. |
TOTAL_CLICKS | The number of clicks. |
AVG_SHOW_POSITION | The average position of the display. |
AVG_CLICK_POSITION | Average click position. |
Indicator | Description |
---|---|
TOTAL_SHOWS | The number of displays. |
TOTAL_CLICKS | The number of clicks. |
Indicator | Description |
---|---|
ALL | All device types. |
DESKTOP | Computers. |
MOBILE_AND_TABLET | Mobile phones and tablets. |
MOBILE | Mobile phones. |
TABLET | Tablets. |
If the request does not specify a device type indicator, the default value is ALL.
Indicator | Description |
---|---|
LINKS_TOTAL_COUNT | The total number of known external links to the host. |
Indicator | Description |
---|---|
SITE_ERROR | The total number of known external links to the site. |
DISALLOWED_BY_USER | The page doesn’t exist or is prohibited from indexing. |
UNSUPPORTED_BY_ROBOT | Not supported by the main Search indexing robot. |
Indicator | Description |
---|---|
IN_PROGRESS | The request is being processed. |
DONE | The robot crawled the URL |
FAILED | The robot failed to crawl the page. Make sure it is accessible to the robot and the server responds fast enough. |
Indicator | Description | Note |
---|---|---|
FATAL | Fatal errors. Checks the server connection, site availability for indexing, security and compliance with Yandex guidelines. |
This may lead to excluding individual pages or the entire site from search results. We recommend monitoring these errors and fixing them as soon as possible. |
CRITICAL | Critical issues. Checks the presence and validity of the SSL certificate, the number of broken internal links, and the server response time. | |
POSSIBLE_PROBLEM | Possible issues. Checks the Sitemap and robots.txt file validity, settings for displaying non-existent files, the number of duplicate pages, the presence of redirects, annoying ads, and so on. | May affect the quality and speed of site indexing. |
RECOMMENDATION | Recommendations. Usually includes suggestions for improving the site’s ranking in search results. | Use them to improve the site’s ranking in search results. |
Indicator | Description |
---|---|
PRESENT | Present on the site. |
ABSENT | Missing. |
UNDEFINED | Not enough data to determine if there are issues. |
Indicator | Description |
---|---|
FATAL | |
DISALLOWED_IN_ROBOTS | The site is prohibited for indexing in the robots.txt file. |
DNS_ERROR | Failed to connect to the server due to a DNS error. |
MAIN_PAGE_ERROR | The site’s home page returns an error. |
THREATS | Security threats or issues were detected. |
CRITICAL | |
SLOW_AVG_RESPONSE_TIME | Slow server response. For more information, see this Help section. |
SSL_CERTIFICATE_ERROR | Invalid SSL certificate settings. For more information, see this Help section. |
POSSIBLE_PROBLEM | |
BAD_ADVERTISEMENT | Ad formats do not comply with IAB Russia recommendations. |
DOCUMENTS_MISSING_DESCRIPTION | Many pages do not have the Description meta tag. |
DOCUMENTS_MISSING_TITLE | The title element is missing on many pages. |
ERROR_IN_ROBOTS_TXT | Errors in the robots.txt file. |
ERRORS_IN_SITEMAPS | Errors found in the Sitemap file. |
MAIN_MIRROR_IS_NOT_HTTPS | The site’s main mirror doesn’t use the HTTPS protocol We recommend using the HTTPS protocol. For more information and instructions on switching protocols, see the Help. |
MAIN_PAGE_REDIRECTS | The main page redirects to another site. |
NO_METRIKA_COUNTER_CRAWL_ENABLED | Site crawling using Yandex.Metrica tags isn’t enabled. For more information about site indexing using the Yandex.Metrica tag, see the Help. |
NO_ROBOTS_TXT | The robots.txt file wasn’t found. |
NO_SITEMAPS | The Sitemap files used by the robot are missing. |
NO_SITEMAP_MODIFICATIONS | The Sitemap files haven’t been updated for a long time. |
NON_WORKING_VIDEO | The robot failed to index videos on the site. |
SOFT_404 | The display of non-existent files and pages is configured incorrectly. |
TOO_MANY_DOMAINS_ON_SEARCH | The site subdomains are found in the search results. |
TOO_MANY_PAGE_DUPLICATES | Too many duplicate pages. |
RECOMMENDATION | |
FAVICON_PROBLEM | The favicon file was not found. The robot failed to load an image file to display in the browser tab and next to the site name in the search results. For more information about this error and how to fix it, see the help section. |
INCOMPLETE_SPRAV_COMPANY_PROFILE | Yandex.Directory contains incomplete information about the organization. |
NO_CHATS | Chats on Search are missing. |
NO_METRIKA_COUNTER | Yandex.Metrica tag error |
NO_REGIONS | The site region isn’t set. |
NOT_IN_SPRAV | The site isn’t registered in Yandex.Directory. |
NOT_MOBILE_FRIENDLY | The site isn’t optimized for mobile devices. |
Indicator | Description |
---|---|
HTTP_2XX HTTP_3XX HTTP_4XX HTTP_5XX |
For more information about statuses, see the help section. |
OTHER | Unsupported HTTP code, connection error, or other error. |
Indicator | Description |
---|---|
APPEARED_IN_SEARCH | The page appeared in search results. |
REMOVED_FROM_SEARCH | The page was removed from search results. |
Indicator | Description |
---|---|
INDEXING_HTTP_CODE | The HTTP response code received by the robot when crawling the page changed. |
SEARCH_STATUS | The page status in the search changed (it was added or removed). |
TITLE | The page title changed. |
DESCRIPTION | The Description meta tag content changed. |
Indicator | Description |
---|---|
NOTHING_FOUND | The robot doesn’t know about the page, or it was unavailable for a long time. Submit the page for reindexing. |
HOST_ERROR | When trying to access the site, the robot could not connect to the server. Check the server response and make sure that the Yandex robot isn’t blocked by the hosting provider. The site is indexed automatically when it becomes available for the robot. For information about the user agent robots, see the help section. |
REDIRECT_NOTSEARCHABLE | The page redirects to another page. The target page is indexed (RedirectTarget). Check the indexing of the target page. |
HTTP_ERROR | An error occurred when accessing the “HTTP error” page. Check the server response. If the problem persists, contact your site administrator or the server administrator. If the page is already available, submit it for reindexing. |
NOT_CANONICAL | The page is indexed by the canonical URL specified in the rel=»canonical» attribute in its source code. Correct or delete the attribute if it is specified incorrectly. The robot will track the changes automatically. |
NOT_MAIN_MIRROR | The page belongs to a secondary site mirror, so it was excluded from the search. |
PARSER_ERROR | When trying to access the page, the robot couldn’t get its content. Check the server response or the presence of prohibiting HTML elements. If the problem persists, contact your site administrator or the server administrator. If the page is already available, send it for reindexing. |
ROBOTS_HOST_ERROR | Site indexing is prohibited in the robots.txt file. The robot will automatically start crawling the page when the site becomes available for indexing. |
ROBOTS_URL_ERROR | Page indexing is prohibited in the robots.txt file. The robot will automatically crawl the page when it becomes available for indexing. |
DUPLICATE | The page duplicates a site page that is already in the search. For more information, see the help section. |
LOW_QUALITY | The page has been removed from search results due to low quality as determined by a special algorithm. If the algorithm finds the page relevant to users’ search queries, it will appear in the search automatically. |
CLEAN_PARAMS | The page was excluded from the search after the robot processed the Clean-param directive. To get the page indexed, edit the robots.txt file. |
NO_INDEX | The page is excluded because the robots meta tag has the noindex value. |
OTHER |
The robot does not have updated data for the page. Check the server response or the presence of prohibiting HTML elements. If the page can’t be accessed by the robot, contact the administrator of your site or server. If the page is already available, send it for reindexing. |
Indicator | Description |
---|---|
DEBUG | Debugging the Turbo page display. |
PRODUCTION | Turbo pages publishing. |
Indicator | Description |
---|---|
DEBUG | Debugging the Turbo page display. |
PRODUCTION | Turbo pages publishing. |
ALL | Getting information about both task types. |
Indicator | Description |
---|---|
PROCESSING | The file is checked for errors. |
OK | The file is loaded and it doesn’t contain errors. |
WARNING | XML elements in the file aren’t supported by Yandex or are specified incorrectly. |
ERROR | The file contains errors (for example, duplicate XML elements). |
Группа кодов статусов HTTP 4хх отвечает за ошибки на стороне клиента, иными словами, посетителя сайта. К данным статусам следует относиться очень внимательно, так как подавляющее большинство ошибок возникает из-за недоработок вебмастера сайта. Это неверное указание URI документов (например, из-за перепутывания абсолютной и косвенной адресации), указание в открытом доступе ссылок на защищённую часть сайта, неверная настройка HTTP-сервера и ещё много других нюансов и тонкостей.
Коды статусов HHTP 4xx (ошибки клиента)
Устранить эти недоработки вы сможете грамотно анализируя серверные логи доступа, настроив обратную связь с посетителями своего сайта, а также внутренним тестированием сайта на разных платформах, в разных браузерах с различающимися настройками.
Код статуса HTTP 400 Bad request (400 Неверный запрос)
Описание: Запрос не был понят/распознан сервером из-за некорректного синтаксиса.
Код статуса HTTP 401 Unauthorized (401 Неавторизованный запрос)
Описание: Для доступа к содержимому по указанному запросу необходимо быть зарегистрированным пользователем (авторизованным).
Код статуса HTTP 402 Payment Required (402 Необходима оплата запроса)
Описание: Внутренняя ошибка или ошибка в конфигурации сервера.
Код статуса HTTP 403 Forbidden (403 Доступ к ресурсу запрещён)
Описание: Доступ к ресурсу (документу, странице) запрещён сервером.
Совет: Если вы хотите, чтобы ваш ресурс индексировался, необходимо разрешить доступ к нему.
Код статуса HTTP 404 Not Found (404 Ресурс не найден)
Описание: Ресурс (документ, страница) не найден, не существует, сервер не находит его по указанному адресу.
Совет: При удалении какого-либо раздела или документа с сайта, вы можете добавить в файле robots.txt его в список запрещённых для индексирования.
Код статуса HTTP 405 Method not allowed (405 Недопустимый метод)
Описание: Для указанного в строке запроса клиентом ресурса недопустимо применять текущий метод.
Код статуса HTTP 406 Not acceptable (406 Неприемлимый запрос)
Описание: Запрашиваемый ресурс (документ, страница) существует, но нет возможности его отобразить/получить (например, кодировка не поддерживается роботом/браузером).
Код статуса HTTP 407 Proxy authentication required (407 Требуется идентификация прокси)
Описание: Доступ к запрашиваемому ресурсу возможен только через прокси-сервер, требуется регистрация/идентификация.
Код статуса HTTP 408 Request timeout (408 Истекло время запроса)
Описание: Сайт не передал полный запрос в течение установленного времени.
Совет: Если на вашем сайте установлена громоздкая CMS, требующая большого количества ресурсов или имеющая сложную структуру, потому работающая с задержками, вы можете изменить настройки сервера таким образом, чтобы время жизни запроса было увеличено.
Код статуса HTTP 409 Conflict (409 Конфликт)
Описание: Запрос конфликтует с другим запросом или конфигурацией сервера.
Код статуса HTTP 410 Gone (410 Ресурс больше недоступен)
Описание: Запрашиваемый ресурс (документ, страница) был окончательно удалён с сервера и более недоступен.
Код статуса HTTP 411 Length required (411 Необходимо указать длину)
Описание: Сервер не принимает запрос без дополнительного заголовка Content-Length.
Совет: Исправьте заголовки на сервере так, чтобы пользователю выдавался код 200.
Код статуса HTTP 412 Precondition failed (412 Сбой при обработке предварительного условия)
Описание: Обнаружено несоответствие при проверке на сервере полей заголовка запроса (сбой или ошибка предварительного условия).
Код статуса HTTP 413 Request entity too large (413 Запрос превышает допустимый размер)
Описание: Размер запроса превышает максимально допустимый размер, который может обработать сервер.
Код статуса HTTP 414 Request-URI too long (414 Недопустимая длина URI-запроса)
Описание: Сервер отказывается обслужить запрос, потому что запрашиваемый URI превышает максимально возможную длину интерпретируемого сервером запроса.
Код статуса HTTP 415 Unsupported media type (415 Неподдерживаемый MIME-тип)
Описание: Сервер отказывается обрабатывать запрос, потому что тело имеет неподдерживаемый формат.
Совет: Обратите внимание на список поддерживаемых форматов данных в описание сервера и приведите в соответствие обработчики и скрипты, чтобы подобная ошибка не возникала.
Код статуса HTTP 416 Requested range not satisfiable (416 Запрашиваемый диапазон не может быть обработан)
Описание: Сервер отказался выполнить запрос потому, что в заголовке значение поля Range указывает на недопустимый диапазон байтов.
Код статуса HTTP 417 Expectation filed (417 Сбой при ожидании)
Описание: Сервер отказался выполнить запрос потому, что в заголовке значение поля Expect не соответствует ожиданиям.
Код статуса HTTP 422 Unprocessable entity (422 Необрабатываемый элемент)
Описание: Сервер не в состоянии обработать один или несколько элементов запроса.
Код статуса HTTP 423 Locked (423 Заблокировано)
Описание: Сервер отказался выполнить запрос потому, что один из требуемых ресурсов заблокирован.
Код статуса HTTP 424 Failed dependency (424 Неверная зависимость)
Описание: Сервер отказался выполнить запрос потому, что один из зависимых ресурсов заблокирован.
Код статуса HTTP 426 Upgrade required (426 Требуется обновление)
Описание: Сервер потребовал обновления соединения до SSL, но SSL не поддерживается клиентом.
« Коды статуса HTTP
« Коды статуса HTTP 3xx (перенаправление)
« Коды статуса HTTP 4xx (ошибки клиента)
« Коды статуса HTTP 5xx (ошибки сервера)
I am thinking 412 (Precondition Failed) but there may be a better standard?
asked Jun 16, 2010 at 3:19
2
Status 422 seems most appropiate based on the spec.
The 422 (Unprocessable Entity) status code means the server
understands the content type of the request entity (hence a
415(Unsupported Media Type) status code is inappropriate), and the
syntax of the request entity is correct (thus a 400 (Bad Request)
status code is inappropriate) but was unable to process the contained
instructions. For example, this error condition may occur if an XML
request body contains well-formed (i.e., syntactically correct), but
semantically erroneous, XML instructions.
They state that malformed xml is an example of bad syntax (calling for a 400). A malformed query string seems analogous to this, so 400 doesn’t seem appropriate for a well-formed query-string which is missing a param.
Note: Since the above RFC is about WebDAV there can be a misunderstanding that 422 and some others are only to be used in the context of WebDAV and using them outside of it is «nonstandard». But this only means these status codes were introduced in the context of this RFC. Indeed the wording of these definitions is carefully chosen not to be specific to WebDAV.
David Ongaro
3,3301 gold badge23 silver badges35 bronze badges
answered Apr 25, 2012 at 20:14
KelvinKelvin
19.6k2 gold badges60 silver badges65 bronze badges
18
I’m not sure there’s a set standard, but I would have used 400 Bad Request, which the latest HTTP spec (from 2014) documents as follows:
6.5.1. 400 Bad Request
The 400 (Bad Request) status code indicates that the server cannot or
will not process the request due to something that is perceived to be
a client error (e.g., malformed request syntax, invalid request
message framing, or deceptive request routing).
answered Jun 16, 2010 at 3:32
Gert GrenanderGert Grenander
16.7k6 gold badges39 silver badges43 bronze badges
12
The WCF API in .NET handles missing parameters by returning an HTTP 404
«Endpoint Not Found» error, when using the webHttpBinding.
The 404 Not Found
can make sense if you consider your web service method name together with its parameter signature. That is, if you expose a web service method LoginUser(string, string)
and you request LoginUser(string)
, the latter is not found.
Basically this would mean that the web service method you are calling, together with the parameter signature you specified, cannot be found.
10.4.5 404 Not Found
The server has not found anything matching the Request-URI. No
indication is given of whether the condition is temporary or
permanent.
The 400 Bad Request
, as Gert suggested, remains a valid response code, but I think it is normally used to indicate lower-level problems. It could easily be interpreted as a malformed HTTP request, maybe missing or invalid HTTP headers, or similar.
10.4.1 400 Bad Request
The request could not be understood by the server due to malformed
syntax. The client SHOULD NOT repeat the request without
modifications.
answered Jun 16, 2010 at 3:55
Daniel VassalloDaniel Vassallo
333k71 gold badges501 silver badges440 bronze badges
7
You can send a 400 Bad Request code. It’s one of the more general-purpose 4xx status codes, so you can use it to mean what you intend: the client is sending a request that’s missing information/parameters that your application requires in order to process it correctly.
answered Jun 16, 2010 at 3:32
BoltClockBoltClock
686k158 gold badges1372 silver badges1347 bronze badges
I Usually go for 422 (Unprocessable entity) if something in the required parameters didn’t match what the API endpoint required (like a too short password) but for a missing parameter i would go for 406 (Unacceptable).
answered Mar 6, 2014 at 9:32
Elad MeidarElad Meidar
7646 silver badges11 bronze badges
3
In one of our API project we decide to set a 409 Status to some request, when we can’t full fill it at 100% because of missing parameter.
HTTP Status Code «409 Conflict» was for us a good try because it’s definition
require to include enough information for the user to recognize the
source of the conflict.
Reference: w3.org/Protocols/
So among other response like 400 or 404 we chose 409 to enforce the need for looking over some notes in the request helpful to set up a new and right request.
Any way our case it was particular because we need to send out some data eve if the request was not completely correct, and we need to enforce the client to look at the message and understand what was wrong in the request.
In general if we have only some missing parameter we go for a 400 and an array of missing parameter. But when we need to send some more information, like a particular case message and we want to be more sure the client will take care of it we send a 409
answered Jan 8, 2015 at 14:06
gabrielemgabrielem
5605 silver badges13 bronze badges
3
For those interested, Spring MVC (3.x at least) returns a 400 in this case, which seems wrong to me.
I tested several Google URLs (accounts.google.com) and removed required parameters, and they generally return a 404 in this case.
I would copy Google.
answered May 19, 2012 at 21:01
RelefantRelefant
88310 silver badges10 bronze badges
5
It could be argued that a 404 Not Found
should be used since the resource specified could not be found.
Luca
9,0035 gold badges45 silver badges59 bronze badges
answered Jan 17, 2012 at 14:44
3
I often use a 403 Forbidden error. The reasoning is that the request was understood, but I’m not going to do as asked (because things are wrong). The response entity explains what is wrong, so if the response is an HTML page, the error messages are in the page. If it’s a JSON or XML response, the error information is in there.
From rfc2616:
10.4.4 403 Forbidden
The server understood the request, but is refusing to fulfill it.
Authorization will not help and the request SHOULD NOT be repeated.
If the request method was not HEAD and the server wishes to make
public why the request has not been fulfilled, it SHOULD describe the
reason for the refusal in the entity. If the server does not wish to
make this information available to the client, the status code 404
(Not Found) can be used instead.
answered Feb 23, 2012 at 22:36
cdeszaqcdeszaq
30.5k25 gold badges115 silver badges173 bronze badges
5
Just go to the browser settings > Shields > Auto-redirect AMP pages
Disable it and try again …
answered Oct 18, 2022 at 21:18
I am thinking 412 (Precondition Failed) but there may be a better standard?
asked Jun 16, 2010 at 3:19
2
Status 422 seems most appropiate based on the spec.
The 422 (Unprocessable Entity) status code means the server
understands the content type of the request entity (hence a
415(Unsupported Media Type) status code is inappropriate), and the
syntax of the request entity is correct (thus a 400 (Bad Request)
status code is inappropriate) but was unable to process the contained
instructions. For example, this error condition may occur if an XML
request body contains well-formed (i.e., syntactically correct), but
semantically erroneous, XML instructions.
They state that malformed xml is an example of bad syntax (calling for a 400). A malformed query string seems analogous to this, so 400 doesn’t seem appropriate for a well-formed query-string which is missing a param.
Note: Since the above RFC is about WebDAV there can be a misunderstanding that 422 and some others are only to be used in the context of WebDAV and using them outside of it is «nonstandard». But this only means these status codes were introduced in the context of this RFC. Indeed the wording of these definitions is carefully chosen not to be specific to WebDAV.
David Ongaro
3,3301 gold badge23 silver badges35 bronze badges
answered Apr 25, 2012 at 20:14
KelvinKelvin
19.6k2 gold badges60 silver badges65 bronze badges
18
I’m not sure there’s a set standard, but I would have used 400 Bad Request, which the latest HTTP spec (from 2014) documents as follows:
6.5.1. 400 Bad Request
The 400 (Bad Request) status code indicates that the server cannot or
will not process the request due to something that is perceived to be
a client error (e.g., malformed request syntax, invalid request
message framing, or deceptive request routing).
answered Jun 16, 2010 at 3:32
Gert GrenanderGert Grenander
16.7k6 gold badges39 silver badges43 bronze badges
12
The WCF API in .NET handles missing parameters by returning an HTTP 404
«Endpoint Not Found» error, when using the webHttpBinding.
The 404 Not Found
can make sense if you consider your web service method name together with its parameter signature. That is, if you expose a web service method LoginUser(string, string)
and you request LoginUser(string)
, the latter is not found.
Basically this would mean that the web service method you are calling, together with the parameter signature you specified, cannot be found.
10.4.5 404 Not Found
The server has not found anything matching the Request-URI. No
indication is given of whether the condition is temporary or
permanent.
The 400 Bad Request
, as Gert suggested, remains a valid response code, but I think it is normally used to indicate lower-level problems. It could easily be interpreted as a malformed HTTP request, maybe missing or invalid HTTP headers, or similar.
10.4.1 400 Bad Request
The request could not be understood by the server due to malformed
syntax. The client SHOULD NOT repeat the request without
modifications.
answered Jun 16, 2010 at 3:55
Daniel VassalloDaniel Vassallo
333k71 gold badges501 silver badges440 bronze badges
7
You can send a 400 Bad Request code. It’s one of the more general-purpose 4xx status codes, so you can use it to mean what you intend: the client is sending a request that’s missing information/parameters that your application requires in order to process it correctly.
answered Jun 16, 2010 at 3:32
BoltClockBoltClock
686k158 gold badges1372 silver badges1347 bronze badges
I Usually go for 422 (Unprocessable entity) if something in the required parameters didn’t match what the API endpoint required (like a too short password) but for a missing parameter i would go for 406 (Unacceptable).
answered Mar 6, 2014 at 9:32
Elad MeidarElad Meidar
7646 silver badges11 bronze badges
3
In one of our API project we decide to set a 409 Status to some request, when we can’t full fill it at 100% because of missing parameter.
HTTP Status Code «409 Conflict» was for us a good try because it’s definition
require to include enough information for the user to recognize the
source of the conflict.
Reference: w3.org/Protocols/
So among other response like 400 or 404 we chose 409 to enforce the need for looking over some notes in the request helpful to set up a new and right request.
Any way our case it was particular because we need to send out some data eve if the request was not completely correct, and we need to enforce the client to look at the message and understand what was wrong in the request.
In general if we have only some missing parameter we go for a 400 and an array of missing parameter. But when we need to send some more information, like a particular case message and we want to be more sure the client will take care of it we send a 409
answered Jan 8, 2015 at 14:06
gabrielemgabrielem
5605 silver badges13 bronze badges
3
For those interested, Spring MVC (3.x at least) returns a 400 in this case, which seems wrong to me.
I tested several Google URLs (accounts.google.com) and removed required parameters, and they generally return a 404 in this case.
I would copy Google.
answered May 19, 2012 at 21:01
RelefantRelefant
88310 silver badges10 bronze badges
5
It could be argued that a 404 Not Found
should be used since the resource specified could not be found.
Luca
9,0035 gold badges45 silver badges59 bronze badges
answered Jan 17, 2012 at 14:44
3
I often use a 403 Forbidden error. The reasoning is that the request was understood, but I’m not going to do as asked (because things are wrong). The response entity explains what is wrong, so if the response is an HTML page, the error messages are in the page. If it’s a JSON or XML response, the error information is in there.
From rfc2616:
10.4.4 403 Forbidden
The server understood the request, but is refusing to fulfill it.
Authorization will not help and the request SHOULD NOT be repeated.
If the request method was not HEAD and the server wishes to make
public why the request has not been fulfilled, it SHOULD describe the
reason for the refusal in the entity. If the server does not wish to
make this information available to the client, the status code 404
(Not Found) can be used instead.
answered Feb 23, 2012 at 22:36
cdeszaqcdeszaq
30.5k25 gold badges115 silver badges173 bronze badges
5
Just go to the browser settings > Shields > Auto-redirect AMP pages
Disable it and try again …
answered Oct 18, 2022 at 21:18