Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DB insertion errors #1477

Open
Alexell opened this issue Aug 18, 2024 · 0 comments
Open

DB insertion errors #1477

Alexell opened this issue Aug 18, 2024 · 0 comments
Labels

Comments

@Alexell
Copy link

Alexell commented Aug 18, 2024

🐞 Bug Report

Required Information

? !
Operating system Ubuntu 24.04 LTS
PHP Telegram Bot version 0.83.1
PHP version 8.3.6
MySQL version 8.0.39
Update Method Webhook
Self-signed certificate no

Summary

So far it's just a question. I've been using the library for over a year and everything has always worked fine. However, recently errors have started appearing in the logs that weren't there before. Here are some examples of errors:

[09-Aug-2024 23:56:39] PHP Fatal error:  Uncaught TypeError: Longman\TelegramBot\DB::insertChat(): Argument #1 ($chat) must be of type Longman\TelegramBot\Entities\Chat, null given, called in /var/www/bot.local/vendor/longman/telegram-bot/src/DB.php on line 1296 and defined in /var/www/bot.local/vendor/longman/telegram-bot/src/DB.php:492
Stack trace:
#0 /var/www/bot.local/vendor/longman/telegram-bot/src/DB.php(1296): Longman\TelegramBot\DB::insertChat()
#1 /var/www/bot.local/vendor/longman/telegram-bot/src/DB.php(579): Longman\TelegramBot\DB::insertMessageRequest()
#2 /var/www/bot.local/vendor/longman/telegram-bot/src/Telegram.php(655): Longman\TelegramBot\DB::insertRequest()
#3 /var/www/bot.local/vendor/longman/telegram-bot/src/Telegram.php(568): Longman\TelegramBot\Telegram->processUpdate()
#4 /var/www/bot.local/hook-ghzfp4y52g5b7d5.php(72): Longman\TelegramBot\Telegram->handle()
#5 {main}
  thrown in /var/www/bot.local/vendor/longman/telegram-bot/src/DB.php on line 492

and

[16-Aug-2024 22:37:50] PHP Fatal error:  Uncaught TypeError: Longman\TelegramBot\DB::insertEditedMessageRequest(): Argument #1 ($edited_message) must be of type Longman\TelegramBot\Entities\Message, Longman\TelegramBot\Entities\Message\InaccessibleMessage given, called in /var/www/bot.local/vendor/longman/telegram-bot/src/DB.php on line 862 and defined in /var/www/bot.local/vendor/longman/telegram-bot/src/DB.php:1471
Stack trace:
#0 /var/www/bot.local/vendor/longman/telegram-bot/src/DB.php(862): Longman\TelegramBot\DB::insertEditedMessageRequest()
#1 /var/www/bot.local/vendor/longman/telegram-bot/src/DB.php(603): Longman\TelegramBot\DB::insertCallbackQueryRequest()
#2 /var/www/bot.local/vendor/longman/telegram-bot/src/Telegram.php(655): Longman\TelegramBot\DB::insertRequest()
#3 /var/www/bot.local/vendor/longman/telegram-bot/src/Telegram.php(568): Longman\TelegramBot\Telegram->processUpdate()
#4 /var/www/bot.local/hook-ghzfp4y52g5b7d5.php(72): Longman\TelegramBot\Telegram->handle()
#5 {main}
  thrown in /var/www/bot.local/vendor/longman/telegram-bot/src/DB.php on line 1471

If I perform actions in the bot from several accounts, then there are no problems. Probably, this occurs with other users, so I do not know how to recreate this problem. But I would like to understand why it occurs.

Additionally: earlier, almost a year ago, I had php-telegram-bot 0.80.0 and it worked on Ubuntu 22.04 + PHP 8.1 and I have never seen such errors in the logs.

@Alexell Alexell added the bug label Aug 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant