# Error notification

Use of optional functions requires an application

Only corporate users who have submitted the required applications can use the functions described in this document. To use these functions with your LINE Official Account, contact your sales representative or contact our Sales partners (opens new window).

# Summary

If the user adds your LINE Official Account as a friend or sends a message to your LINE Official Account, LINE Platform sends a webhook event to the URL (bot server) specified in the LINE Developers Console "Webhook URL".

If the bot server returns an error in response to this webhook event, the channel administrator will receive a notification email informing them of the occurrence of the error. This option is called the "error notification" function.

You will receive a notification email when an error is returned from the bot server

# Notification email

The subject of the email sent upon error notification has changed

For more information, see the information (for corporate users) on April 28, 2021, The subject of the email sent upon error notification will be changed.

This topic explains the email sent by the error notification function.

dummy dummy
Email recipients An email is sent to the following email addresses.
  • Email address registered on the Basic settings page of the target channel
  • Registered email address of a user with the Admin role for the target channel
Subject Messaging API: Your server did not return [200 OK] - <Channel name>
Where to find error information The reason for the error and the date and time of occurrence will be described per situation. For details, see Email content.
You can also check error information in the LINE Developers Console

You can also check the error information you received in the notification email in the LINE Developers Console. For more information, see The "Errors" display under the "Statistics" tab in the LINE Developers Console.

Contents may change without notice

The contents of the email and error messages are subject to change without notice.

# Notification email sample

sample mail

# Email content

These are the contents of the email.

Item Description
Channel ID Target channel ID.
Channel name Target channel name.
Reason for error Overview of reason for error. For more information, see Reason for error.
Detail for error Details on reason for error. For more information, see Detail for error.
Error count Number of times error occurred.
Time detected Time when error occurred.
URL Link to Errors under the Statistics tab of the Messaging API channel in the LINE Developers Console.

# Reason for error

These are the main error messages for reason for error.

Message Description
could_not_connect The LINE Platform attempted to send a webhook event to the bot server, but was unable to successfully connect to the bot server.
request_timeout The LINE Platform sent a webhook event to the bot server, but the bot server didn't return a response within one second.
error_status_code The LINE Platform sent a webhook event to the bot server, but the bot server returned a response with a HTTP status code other than 200.
unclassified An unknown error that doesn't fall under any of the above category has occurred.

# Detail for error

There are for major categories for error message for detail for error, corresponding to reason for error.

  1. The reason for error is could_not_connect
  2. The reason for error is request_timeout
  3. The reason for error is error_status_code
  4. The reason for error is unclassified

# 1. The reason for error is could_not_connect

When the reason for error is could_not_connect, these are the main error messages for the detail for error.

These errors occur when the LINE Platform fails to successfully send a webhook request to the bot server.

Message Description
Connection failed Failed to connect to bot server.
Connection failed (received GOAWAY) Connection to the bot server denied.
Connection failed (session closed) Connection to the bot server was terminated unexpectedly.
Connection timeout Couldn't connect to the bot server within a certain period of time.
DNS Query timeout Attempted but failed to resolve the name of the webhook URL within a certain period of time.
Invalid URL syntax Invalid webhook URL has been specified (RFC violation, etc.).
Session protocol negotiation failure Connected to the bot server, but protocol negotiation failed.
TLS handshake failure Connected to the bot server, but the TLS handshake failed.
Unknown host Host specified in the webhook URL can't be found.

# 2. The reason for error is request_timeout

When the reason for error is request_timeout, there are the main error messages for the detail for error.

These errors occur when the LINE Platform sends a webhook request to the bot server, but the response isn't received by the LINE Platform, or the sending fails midway. It's possible that the bot server was able to receive (process) the webhook event successfully.

Message Description
Request timeout A webhook request was sent to the bot server, but a response wasn't received within a certain period of time.

# 3. The reason for error is error_status_code

When Reason for error is error_status_code, detail for error contains a HTTP status code.

# 4. The reason for error is unclassified

Occurs when there is an error that can't be classified.

Message Description
Session closed unexpectedly A webhook request was sent to the bot server, but the connection was terminated unexpectedly midway.
Stream closed unexpectedly A webhook request was sent to the bot server, but the stream was terminated unexpectedly midway.
Unclassified webhook dispatch error An unclassified error has occured.

# How to resolve a notification message

Suppose you received the same error notification content as in the Notification email sample. Since the reason for error is error_status_code and detail for error is 500, you can assume that the bot server responded to the webhook request with the HTTP status code 500.

In this case, the bot server may not have been able to properly process the webhook events it received. Investigate the cause of the problem by examining the bot server's webhook events processing log.

On error investigation

LINE does not provide individual investigation or confirmation of errors. The reason of the error should be addressed directly by the developer managing the channel or bot server.

# The "Errors" display under the "Statistics" tab in the LINE Developers Console

The error information received in the notification email is also displayed in Errors under the Statistics tab of the Messaging API channel in the LINE Developers Console. If you click Download as TSV, you can download information on errors that have occurred in the past in TSV format.

Errors under the Statistics tab are displayed only for channels where Error statistics aggregation is enabled on the Messaging API tab. For more information on how to enable error statistics, see Enable error statistics in the Messaging API documentation.

error tab in statistics