Telegram bot webhook wrong response from the webhook 500 internal server error

Required Information Operating system: Ubuntu 14.04 PHP version: 5.5.9 PHP Telegram Bot version: 0.48.0 Using MySQL database: no Update Method: Webhook Self-signed certificate: no Expected behaviou...

Required Information

  • Operating system: Ubuntu 14.04
  • PHP version: 5.5.9
  • PHP Telegram Bot version: 0.48.0
  • Using MySQL database: no
  • Update Method: Webhook
  • Self-signed certificate: no

Expected behaviour

WebHook should be set, and bot should receive and response to commands.

Actual behaviour

When open set.php in browser it shows Webhook was set but if check https://api.telegram.org/bot12345678:ytDWc-snTFNkdGRyGE/getWebhookInfo, it shows the next response:

{
  "ok": true,
  "result": {
    "url": "https://example.com/hook.php",
    "has_custom_certificate": false,
    "pending_update_count": 50,
    "last_error_date": 1503949200,
    "last_error_message": "Wrong response from the webhook: 500 Internal Server Error",
    "max_connections": 40
  }
}

Steps to reproduce

  • Copy php-telegram-bot/example-bot to a folder on a server.
  • Give the folder www-data permissions by sudo chown -R www-data:www-data ~/www && sudo chmod -R g+w ~/www
  • Install composer.
  • Change set.php,hook.php, composer.json with my own data like token to access HTTP API, botUsername and WebHook URL.
  • Run composer install from the example-bot folder.
  • Open https://mydomain.com/path/to/bot/set.php in browser to get Webhook was set response.
  • Check https://api.telegram.org/bot12345678:BOT_API_TOKEN/getWebhookInfo

Extra details

Server uses not Self-signed certificate. Certificate was issued by Comodo.
Here is the code of set.php:

<?php
/**
 * README
 * This file is intended to set the webhook.
 * Uncommented parameters must be filled
 */
// Load composer
require_once __DIR__ . '/vendor/autoload.php';
// Add you bot's API key and name
$bot_api_key  = '12345678:AAN_yug_FGLKge-fayecJFC6fgo8YDIuh';
$bot_username = 'UsernameBot';
// Define the URL to your hook.php file
$hook_url     = 'https://www.example.com/path/to/hook.php';
try {
    // Create Telegram API object
    $telegram = new LongmanTelegramBotTelegram($bot_api_key, $bot_username);
    // Set webhook
    $result = $telegram->setWebhook($hook_url);
    // To use a self-signed certificate, use this line instead
    //$result = $telegram->setWebhook($hook_url, ['certificate' => $certificate_path]);
    if ($result->isOk()) {
        echo $result->getDescription();
    }
} catch (LongmanTelegramBotExceptionTelegramException $e) {
    echo $e->getMessage();
}

hook.php code:

<?php
/**
 * README
 * This configuration file is intended to run the bot with the webhook method.
 * Uncommented parameters must be filled
 *
 * Please note that if you open this file with your browser you'll get the "Input is empty!" Exception.
 * This is a normal behaviour because this address has to be reached only by the Telegram servers.
 */

// Load composer
require_once __DIR__ . '/vendor/autoload.php';

// Add you bot's API key and name
$bot_api_key  = '12345678:AAN_yug_FGLKge-fayecJFC6fgo8YDIuh';
$bot_username = 'UsernameBot';

// Define all IDs of admin users in this array (leave as empty array if not used)
$admin_users = [
    123,
];

// Define all paths for your custom commands in this array (leave as empty array if not used)
$commands_paths = [
    __DIR__ . '/Commands/',
];

// Enter your MySQL database credentials
//$mysql_credentials = [
//    'host'     => 'localhost',
//    'user'     => 'dbuser',
//    'password' => 'dbpass',
//    'database' => 'dbname',
//];

try {
    // Create Telegram API object
    $telegram = new LongmanTelegramBotTelegram($bot_api_key, $bot_username);

    // Add commands paths containing your custom commands
    $telegram->addCommandsPaths($commands_paths);

    // Enable admin users
    $telegram->enableAdmins($admin_users);

    // Enable MySQL
    //$telegram->enableMySql($mysql_credentials);

    // Logging (Error, Debug and Raw Updates)
    LongmanTelegramBotTelegramLog::initErrorLog(__DIR__ . "/{$bot_username}_error.log");
    LongmanTelegramBotTelegramLog::initDebugLog(__DIR__ . "/{$bot_username}_debug.log");
    //LongmanTelegramBotTelegramLog::initUpdateLog(__DIR__ . "/{$bot_username}_update.log");

    // If you are using a custom Monolog instance for logging, use this instead of the above
    //LongmanTelegramBotTelegramLog::initialize($your_external_monolog_instance);

    // Set custom Upload and Download paths
    //$telegram->setDownloadPath(__DIR__ . '/Download');
    //$telegram->setUploadPath(__DIR__ . '/Upload');

    // Here you can set some command specific parameters
    // e.g. Google geocode/timezone api key for /date command
    //$telegram->setCommandConfig('date', ['google_api_key' => 'your_google_api_key_here']);

    // Botan.io integration
    //$telegram->enableBotan('your_botan_token');

    // Requests Limiter (tries to prevent reaching Telegram API limits)
    $telegram->enableLimiter();

    // Handle telegram webhook request
    $telegram->handle();


} catch (LongmanTelegramBotExceptionTelegramException $e) {
    // Silence is golden!
    //echo $e;
    // Log telegram errors
    LongmanTelegramBotTelegramLog::error($e);
} catch (LongmanTelegramBotExceptionTelegramLogException $e) {
    // Silence is golden!
    // Uncomment this to catch log initialisation errors
    //echo $e;
}

composer.json

{
    "name": "UsernameBot/UsernameBot",
    "type": "project",
    "require": {
        "php": ">=5.5",
        "longman/telegram-bot": "^0.48.0"
    }
}

Reading this article means you have trouble getting your Telegram bot up and running with a webhook. There are several parts we can check and debug.

This article is the second part in a series of two. In the first part we setup a working Telegram Bot with Laravel and have one working /help command. Check the first article here.

Before we dive into the options, let’s understand the different parts and the steps you took to get it up and running.

You did achieve the following steps:

  • At the Telegram ecosystem you have created your ‘MyPreciousBot’ bot through @BotFather and you have its name and token;
  • Created a Laravel site and added the Telegram Bot SDK package with composer;
  • Configured the bot settings, created a route, and created a custom HelpCommand;
  • You told your PreciousBot at Telegram Ecosystem what the public webhook url is to send messages to;
  • Added your bot to your Telegram client where you can use /help to get a response.

Use NGROK console to see incoming messages

If you have exposed your internal DEV environment with a NGROK tunnel to the outside world you can see incoming messages in the terminal. Like so:

You can see clearly an incoming POST request to the right webhook URL (Good to double check this) but still there is a 500 Internal Server Error. Our complete webhook url at the moment of testing is:

https://0f306a1e.ngrok.io/42yUojv1YQPOssPEpn5i3q6vjdhh7hl7djVWDIAVhFDRMAwZ1tj0Og2v4PWyj4PZ/webhook

Conclusion:

  • Telegram ecosystem knows your webhook and tries to deliver messages to your webhook. So the setwebhook was a success and it seems that there is an internal error at the Laravel site;
  • If the webhook was not set successfully there would not be any HTTP Requests. In that case re-set your webhook URL with Telegram API!

Check the state of the webhook at the Telegram side

Now we know that Telegram is trying to deliver a message to the correct webhook address but it fails to do so. Next we can check if Telegram knows more and how many messages are in queue. We can check this by calling the endpoint getWebhookInfo. You could again create a new GET request in Postman for later use but you could also paste the url in a browser and check the response there. The URL contains the Telegram API address followed by string ‘bot’ and your bot token ending with /getWebhookInfo. Like so:

https://api.telegram.org/bot123456789:ABC_a0bcDefGhijklmno_0pqrSt-uvWXYZA/getWebhookInfo

Replace the bot123456789:ABC_a0bcDefGhijklmno_0pqrSt-uvWXYZA with your bot token and send the request. You will see something like this:

{
    "ok": true,
    "result": {
        "url": "https://0f306a1e.ngrok.io/42yUojv1YQPOssPEpn5i3q6vjdhh7hl7djVWDIAVhFDRMAwZ1tj0Og2v4PWyj4PZ/webhook",
        "has_custom_certificate": false,
        "pending_update_count": 2,
        "last_error_date": 1587324431,
        "last_error_message": "Wrong response from the webhook: 500 Internal Server Error",
        "max_connections": 40
    }
}

In queue there are two more messages and the last error message is error 500. Also at this moment your are able to check if Telegram has the correct webhook url. Think about it when you restart a new ngrok tunnel and the webhook url is pointing to the previous tunnel. This getWebhookInfo() message could show you that your webhook url is incorrect. For our problem this is not the case. The webhook url is still the same and active. Next attempt.

Test your webhook directly

To find out what happens on the Laravel side we could deliver a message to your webhook directly and see what error message comes back. In this method we do not let Telegram send a payload to your webhook but we will drop off a payload right at the gates of Laravel. See Telegram webhook documentation for more examples.

You can even send some garbage to it and see what kind of response you get. We do this again with Postman. Open Postman and create a new POST request ‘Test my supersonic webhook’ and paste in the complete URL of your active webhook. Ours is still:

https://0f306a1e.ngrok.io/42yUojv1YQPOssPEpn5i3q6vjdhh7hl7djVWDIAVhFDRMAwZ1tj0Og2v4PWyj4PZ/webhook

Click on the Body and past in a test payload with a /help command:

{
	"update_id":10000,
	"message":{
		"message_id":17957,
		"from":{
		"id":111111,
		"is_bot":false,
		"first_name":"Test",
		"username":"Test",
		"language_code":"nl"
	},
	"chat":{
		"id":111111,
		"first_name":"Test",
		"username":"Test",
		"type":"private"
	},
	"date":1584112226,
	"text":"/help",
	"entities":[{
		"offset":0,
		"length":5,
		"type":"bot_command"
		}]
	}
}

Replace the id:111111 with your Telegram ID otherwise the HelpCommand does not know where to send the answer to. To check your Telegram ID, visit bot @id_chatbot. Send /start and you will get your id back.

Press Send and voila, we have an error:

In the above example you see some error. These kinds of error’s are also reported in the storagelogslaravel.log file. We see there is a problem in our HelpCommand.php file at line 31.

We open the file appTelegramCommandsHelpCommand.php and scroll down to row 31:

public function handle($arguments)

For Telegram SDK Bot ^3.1 we do not need $arguments anymore. I will remove this and save the file. Remember, this is only an example of what could be wrong.

Now let’s try to resend the payload from Postman.

No more error and status 200. Problem fixed.

I hope I gave you some ideas about how to troubleshoot the webhook connection. Please also check the laravel.log file for internal Laravel error’s. Make sure you did not make any typo’s and double check your bot token and webhook secret string. That is all for now.

If you have more ideas or need help specific on getting the webhook work, please leave a comment below.

Searching on a solution for the error “Webhook 500 internal server error”? We can help you.

Usually, this error indicates bad scripting, permission problems, etc.

At Bobcares, we often get requests to fix Webhook errors, as a part of our Server Management Services.

Today, let’s see how our Support Engineers fix the Webhook 500 error in the server.

Why does Webhook show internal server error?

Before getting deeper into the error, it’s important to know about Webhook. So let’s get into it.

Webhook is one of the easiest ways to set up custom callbacks. These user-defined HTTP callbacks can serve many purposes like getting real-time data, passing it on to an application, etc.

Similarly, it also processes the data and gives something in return. Like, sending welcome emails when a domain gets a new user. This reduces the task of monitoring every activity on a website.

But, errors in Webhook is tricky. One such error is 500 internal server error.

This is a very general status code. Usually, it indicates errors in the webserver. And the webserver cannot complete the user request. That is, the server is unable to identify the reason for it.

Since the webhook is customizable, the error normally occurs due to bad scripting, insecure URL requests, etc.

How we fix the Webhook 500 error?

Internal server errors are difficult to troubleshoot. However, our Support Engineers with expertise over a decade fix these errors for our customers. Let’s see a few instances of this.

Use of insecure connection

Recently, one of our customers approached us with a Webhook 500 error. He had set up a Dialogflow, and the Webhook keeps on failing. Dialogflow is a chatbot building framework.

The error message on its diagnostic info appeared as:

Webhook 500 internal server error in Dialogflow.

So, our Support Team checked his script. We found that his code used HTTP requests instead of https. Hence the URLs were not publicly accessible and this leads to the error. We corrected the code and updated the same.

At the same time, the website should also have an SSL certificate. Setting up a self-signed certificate is not enough as Dialogflow doesn’t support it.

Bad scripting

Webhook users can customize its use. But many times it ends up in errors. And the reason for this is bad scripting.

Our customers approach us for 500 errors in Webhook. Firstly, we check their scripts. If our Experts find errors we correct it and update the same. In most situations, this can fix the error.

Permission errors

Usually, file and folder permissions can result in Webhook 500 errors. So, whenever our Support Team gets requests to fix this error, we check permissions.

Server files and folders need correct permissions and ownerships set in order to work properly. If Websites requests files for which the server has no access then it will lead to an error.

[Need assistance in fixing Webhook errors? – We’ll help you.]

Conclusion

In short, webhook 500 internal server error occurs due to bad scripting, permission errors, insecure URL requests and so on. Today, we saw how our Support Engineers fix this error for our customers.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

var google_conversion_label = «owonCMyG5nEQ0aD71QM»;

Вопрос:

Я хочу удалить все pending_update_count в моем боте!

Вывод команды ниже:

https://api.telegram.org/botxxxxxxxxxxxxxxxx/getWebhookInfo

Очевидно, я заменил реальный токен API на xxx

:

{
"ok":true,"result":
{
"url":"",
"has_custom_certificate":false,
"pending_update_count":5154
}
}

Как вы можете видеть, у меня есть 5154 непрочитанные обновления til now! (Я уверен, что ожидающие обновления – это ошибки! Потому что никто не использует этот Bot! Это просто тестовый бот)

Кстати, этот номер pending_update_count растет так быстро!
Теперь, когда я пишу этот пост, число увеличилось 51 и достигло 5205!

Я просто хочу очистить эти ожидающие обновления.
Я уверен, что этот Bot застрял в бесконечном цикле!

Есть ли способ избавиться от него?

P.S:

Я также очистил URL-адрес webhook. Но ничего не изменилось!

UPDATE:

Вывод getWebhookInfo таков:

{
"ok":true,
"result":{
"url":"https://somewhere.com/telegram/webhook",
"has_custom_certificate":false,
"pending_update_count":23,
"last_error_date":1482910173,
"last_error_message":"Wrong response from the webhook: 500 Internal Server Error",
"max_connections":40
}
}

Почему я получаю Wrong response from the webhook: 500 Internal Server Error?

Лучший ответ:

Я думаю, у вас есть два варианта:

  • установить webhook, который ничего не делает, просто скажите 200 OK для телеграмм серверов. Telegram wiil отправит все обновления этого URL-адреса, и очередь будет очищена.
  • отключить webhook и после получения обновлений с помощью метода getUpdates после него снова включить webhook

Update:

Проблема с webhook на вашей стороне. Вы можете попробовать эмулировать POST-запрос телеграммы на свой URL-адрес.
Это может быть примерно так:

{"message_id":1,"from":{"id":1,"first_name":"FirstName","last_name":"LastName","username":"username"},"chat":{"id":1,"first_name":"FirstName","last_name":"LastName","username":"username","type":"private"},"date":1460957457,"text":"test message"}

Вы можете отправить этот текст в виде тела запроса POST с помощью PostMan, а затем попытаться отладить ваш сервер.

Ответ №1

Просто добавьте return 1; в конце вашего метода крючка.

Обновить:

Обычно это происходит из-за задержки запросов к базе данных.

Ответ №2

Я решил это так

POST tg.api/bottoken/setWebhook to emtpy "url"
POST tg.api/bottoken/getUpdates
POST tg.api/bottoken/getUpdates with "offset" last update_id appeared before

делать это несколько раз

POST tg.api/bottoken/getWebhookInfo

поглядел ли все прочь.

POST tg.api/bottoken/setWebhook with filled "url"

Required Information

  • Operating system: Ubuntu 14.04
  • PHP version: 5.5.9
  • PHP Telegram Bot version: 0.48.0
  • Using MySQL database: no
  • Update Method: Webhook
  • Self-signed certificate: no

Expected behaviour

WebHook should be set, and bot should receive and response to commands.

Actual behaviour

When open set.php in browser it shows Webhook was set but if check https://api.telegram.org/bot12345678:ytDWc-snTFNkdGRyGE/getWebhookInfo, it shows the next response:

{
  "ok": true,
  "result": {
    "url": "https://example.com/hook.php",
    "has_custom_certificate": false,
    "pending_update_count": 50,
    "last_error_date": 1503949200,
    "last_error_message": "Wrong response from the webhook: 500 Internal Server Error",
    "max_connections": 40
  }
}

Steps to reproduce

  • Copy php-telegram-bot/example-bot to a folder on a server.
  • Give the folder www-data permissions by sudo chown -R www-data:www-data ~/www && sudo chmod -R g+w ~/www
  • Install composer.
  • Change set.php,hook.php, composer.json with my own data like token to access HTTP API, botUsername and WebHook URL.
  • Run composer install from the example-bot folder.
  • Open https://mydomain.com/path/to/bot/set.php in browser to get Webhook was set response.
  • Check https://api.telegram.org/bot12345678:BOT_API_TOKEN/getWebhookInfo

Extra details

Server uses not Self-signed certificate. Certificate was issued by Comodo.
Here is the code of set.php:

<?php
/**
 * README
 * This file is intended to set the webhook.
 * Uncommented parameters must be filled
 */
// Load composer
require_once __DIR__ . '/vendor/autoload.php';
// Add you bot's API key and name
$bot_api_key  = '12345678:AAN_yug_FGLKge-fayecJFC6fgo8YDIuh';
$bot_username = 'UsernameBot';
// Define the URL to your hook.php file
$hook_url     = 'https://www.example.com/path/to/hook.php';
try {
    // Create Telegram API object
    $telegram = new LongmanTelegramBotTelegram($bot_api_key, $bot_username);
    // Set webhook
    $result = $telegram->setWebhook($hook_url);
    // To use a self-signed certificate, use this line instead
    //$result = $telegram->setWebhook($hook_url, ['certificate' => $certificate_path]);
    if ($result->isOk()) {
        echo $result->getDescription();
    }
} catch (LongmanTelegramBotExceptionTelegramException $e) {
    echo $e->getMessage();
}

hook.php code:

<?php
/**
 * README
 * This configuration file is intended to run the bot with the webhook method.
 * Uncommented parameters must be filled
 *
 * Please note that if you open this file with your browser you'll get the "Input is empty!" Exception.
 * This is a normal behaviour because this address has to be reached only by the Telegram servers.
 */

// Load composer
require_once __DIR__ . '/vendor/autoload.php';

// Add you bot's API key and name
$bot_api_key  = '12345678:AAN_yug_FGLKge-fayecJFC6fgo8YDIuh';
$bot_username = 'UsernameBot';

// Define all IDs of admin users in this array (leave as empty array if not used)
$admin_users = [
    123,
];

// Define all paths for your custom commands in this array (leave as empty array if not used)
$commands_paths = [
    __DIR__ . '/Commands/',
];

// Enter your MySQL database credentials
//$mysql_credentials = [
//    'host'     => 'localhost',
//    'user'     => 'dbuser',
//    'password' => 'dbpass',
//    'database' => 'dbname',
//];

try {
    // Create Telegram API object
    $telegram = new LongmanTelegramBotTelegram($bot_api_key, $bot_username);

    // Add commands paths containing your custom commands
    $telegram->addCommandsPaths($commands_paths);

    // Enable admin users
    $telegram->enableAdmins($admin_users);

    // Enable MySQL
    //$telegram->enableMySql($mysql_credentials);

    // Logging (Error, Debug and Raw Updates)
    LongmanTelegramBotTelegramLog::initErrorLog(__DIR__ . "/{$bot_username}_error.log");
    LongmanTelegramBotTelegramLog::initDebugLog(__DIR__ . "/{$bot_username}_debug.log");
    //LongmanTelegramBotTelegramLog::initUpdateLog(__DIR__ . "/{$bot_username}_update.log");

    // If you are using a custom Monolog instance for logging, use this instead of the above
    //LongmanTelegramBotTelegramLog::initialize($your_external_monolog_instance);

    // Set custom Upload and Download paths
    //$telegram->setDownloadPath(__DIR__ . '/Download');
    //$telegram->setUploadPath(__DIR__ . '/Upload');

    // Here you can set some command specific parameters
    // e.g. Google geocode/timezone api key for /date command
    //$telegram->setCommandConfig('date', ['google_api_key' => 'your_google_api_key_here']);

    // Botan.io integration
    //$telegram->enableBotan('your_botan_token');

    // Requests Limiter (tries to prevent reaching Telegram API limits)
    $telegram->enableLimiter();

    // Handle telegram webhook request
    $telegram->handle();


} catch (LongmanTelegramBotExceptionTelegramException $e) {
    // Silence is golden!
    //echo $e;
    // Log telegram errors
    LongmanTelegramBotTelegramLog::error($e);
} catch (LongmanTelegramBotExceptionTelegramLogException $e) {
    // Silence is golden!
    // Uncomment this to catch log initialisation errors
    //echo $e;
}

composer.json

{
    "name": "UsernameBot/UsernameBot",
    "type": "project",
    "require": {
        "php": ">=5.5",
        "longman/telegram-bot": "^0.48.0"
    }
}

I am using web server flask (python 3.6) in order to catch POST request from telegram server (webhooks), however, when telegram sends me POST request, my webapplication responses: 500 INTERNAL SERVER ERROR
This error does not occur every time, but sometimes

 from flask import Flask, request
import telebot
from telebot import types
import time
import config

secret = "b217604b-f60b-40b8-9b9d-565da0330650"

bot = telebot.TeleBot(config.token_bot, threaded=False)

bot.remove_webhook()
time.sleep(1)
bot.set_webhook(url="https://MYNAME.pythonanywhere.com/{}".format(secret))

app = Flask(__name__)

@app.route('/{}'.format(secret), methods=["POST"])
def webhook():
    bot.process_new_updates([telebot.types.Update.de_json(request.stream.read().decode("utf-8"))])
    return "ok", 200

@bot.message_handler(commands=['help'])
def startCommand(message):
    bot.send_message(message.chat.id, 'Hey *' + message.chat.first_name + '*!' , parse_mode='Markdown', reply_markup=types.ReplyKeyboardRemove())
    print(message.chat.id)
 2018-01-13 16:04:50,367: Traceback (most recent call last):
2018-01-13 16:04:50,367:   File "/home/goga201/.local/lib/python3.6/site-packages/requests/adapters.py", line 370, in send
2018-01-13 16:04:50,367:     timeout=timeout
2018-01-13 16:04:50,367:   File "/home/goga201/.local/lib/python3.6/site-packages/requests/packages/urllib3/connectionpool.py", line 574, in urlopen
2018-01-13 16:04:50,367:     raise SSLError(e)
2018-01-13 16:04:50,367: requests.packages.urllib3.exceptions.SSLError: [SSL: DECRYPTION_FAILED_OR_BAD_RECORD_MAC] decryption failed or bad record mac (_ssl.c:2178)
2018-01-13 16:04:50,368: 
2018-01-13 16:04:50,368: During handling of the above exception, another exception occurred:
2018-01-13 16:04:50,368: 
2018-01-13 16:04:50,368: Traceback (most recent call last):
2018-01-13 16:04:50,368:   File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1982, in wsgi_app
2018-01-13 16:04:50,369:     response = self.full_dispatch_request()
2018-01-13 16:04:50,369:   File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1614, in full_dispatch_request
2018-01-13 16:04:50,369:     rv = self.handle_user_exception(e)
2018-01-13 16:04:50,369:   File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1517, in handle_user_exception
2018-01-13 16:04:50,369:     reraise(exc_type, exc_value, tb)
2018-01-13 16:04:50,370:   File "/usr/local/lib/python3.6/dist-packages/flask/_compat.py", line 33, in reraise
2018-01-13 16:04:50,370:     raise value
2018-01-13 16:04:50,370:   File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1612, in full_dispatch_request
2018-01-13 16:04:50,370:     rv = self.dispatch_request()
2018-01-13 16:04:50,370:   File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1598, in dispatch_request
2018-01-13 16:04:50,371:     return self.view_functions[rule.endpoint](**req.view_args)
2018-01-13 16:04:50,371:   File "/home/goga201/mysite/flask_app.py", line 20, in webhook
2018-01-13 16:04:50,371:     bot.process_new_updates([telebot.types.Update.de_json(request.stream.read().decode("utf-8"))])
2018-01-13 16:04:50,371:   File "/home/goga201/.local/lib/python3.6/site-packages/telebot/__init__.py", line 197, in process_new_updates
2018-01-13 16:04:50,371:     self.process_new_messages(new_messages)
2018-01-13 16:04:50,371:   File "/home/goga201/.local/lib/python3.6/site-packages/telebot/__init__.py", line 218, in process_new_messages
2018-01-13 16:04:50,372:     self._notify_command_handlers(self.message_handlers, new_messages)
2018-01-13 16:04:50,372:   File "/home/goga201/.local/lib/python3.6/site-packages/telebot/__init__.py", line 1283, in _notify_command_handlers
2018-01-13 16:04:50,372:     self._exec_task(message_handler['function'], message)
2018-01-13 16:04:50,372:   File "/home/goga201/.local/lib/python3.6/site-packages/telebot/__init__.py", line 339, in _exec_task
2018-01-13 16:04:50,372:     task(*args, **kwargs)
2018-01-13 16:04:50,372:   File "/home/goga201/mysite/flask_app.py", line 47, in state1
2018-01-13 16:04:50,373:     processStatement(config.States.S_1.value, message.chat.id, message.text)
2018-01-13 16:04:50,373:   File "/home/goga201/mysite/flask_app.py", line 75, in processStatement
2018-01-13 16:04:50,373:     bot.send_message(user, "Не могу найти по ответе значение в бд" + statement + " " + message)
2018-01-13 16:04:50,373:   File "/home/goga201/.local/lib/python3.6/site-packages/telebot/__init__.py", line 465, in send_message
2018-01-13 16:04:50,373:     reply_markup, parse_mode, disable_notification))
2018-01-13 16:04:50,373:   File "/home/goga201/.local/lib/python3.6/site-packages/telebot/apihelper.py", line 135, in send_message
2018-01-13 16:04:50,374:     return _make_request(token, method_url, params=payload, method='post')
2018-01-13 16:04:50,374:   File "/home/goga201/.local/lib/python3.6/site-packages/telebot/apihelper.py", line 54, in _make_request
2018-01-13 16:04:50,374:     timeout=(connect_timeout, read_timeout), proxies=proxy)
2018-01-13 16:04:50,374:   File "/home/goga201/.local/lib/python3.6/site-packages/requests/sessions.py", line 465, in request
2018-01-13 16:04:50,374:     resp = self.send(prep, **send_kwargs)
2018-01-13 16:04:50,375:   File "/home/goga201/.local/lib/python3.6/site-packages/requests/sessions.py", line 573, in send
2018-01-13 16:04:50,375:     r = adapter.send(request, **kwargs)
2018-01-13 16:04:50,375:   File "/home/goga201/.local/lib/python3.6/site-packages/requests/adapters.py", line 431, in send
2018-01-13 16:04:50,375:     raise SSLError(e, request=request)
2018-01-13 16:04:50,375: requests.exceptions.SSLError: [SSL: DECRYPTION_FAILED_OR_BAD_RECORD_MAC] decryption failed or bad record mac (_ssl.c:2178)
2018-01-13 16:04:50,471: Resetting dropped connection: api.telegram.org

Понравилась статья? Поделить с друзьями:
  • Telegram api ssl error
  • Telegram api bot error code
  • Tele2 ошибка при загрузке приложения
  • Tele2 ошибка 28 что это
  • Tele2 ошибка 28 не отправляет сообщения