davtur19 / TuriBot

TuriBot is a simple way to communicate with Telegram APIs in PHP
GNU Affero General Public License v3.0
120 stars 31 forks source link

getUpdates.php error #23

Closed TravisScottex closed 9 months ago

TravisScottex commented 1 year ago
#1 /var/www//TelegramBot/Bot2/vendor/amphp/http-client/src/Connection/HttpStream.php(88): Amp\Http\Client\Connection\Http1Connection->request()
#2 /var/www//TelegramBot/Bot2/vendor/amphp/http-client/src/Connection/ConnectionLimitingPool.php(123): Amp\Http\Client\Connection\HttpStream->request()
#3 /var/www//TelegramBot/Bot2/vendor/amphp/http-client/src/Connection/HttpStream.php(88): Amp\Http\Client\Connection\ConnectionLimitingPool->Amp\Http\Client\Connection\{closure}()
#4 /var/www//TelegramBot/Bot2/vendor/amphp/http-client/src/Interceptor/DecompressResponse.php(43): Amp\Http\Client\Connection\HttpStream->request()
#5 /var/www//TelegramBot/Bot2/vendor/amphp/http-client/src/Connection/InterceptedStream.php(43): Amp\Http\Client\Interceptor\DecompressResponse->requestViaNetwork()
#6 /var/www//TelegramBot/Bot2/vendor/amphp/http-client/src/Interceptor/ModifyRequest.php(40): Amp\Http\Client\Connection\InterceptedStream->request()
#7 /var/www//TelegramBot/Bot2/vendor/amphp/http-client/src/Connection/InterceptedStream.php(43): Amp\Http\Client\Interceptor\ModifyRequest->requestViaNetwork()
#8 /var/www//TelegramBot/Bot2/vendor/amphp/http-client/src/Interceptor/ModifyRequest.php(40): Amp\Http\Client\Connection\InterceptedStream->request()
#9 /var/www//TelegramBot/Bot2/vendor/amphp/http-client/src/Connection/InterceptedStream.php(43): Amp\Http\Client\Interceptor\ModifyRequest->requestViaNetwork()
#10 /var/www//TelegramBot/Bot2/vendor/amphp/http-client/src/PooledHttpClient.php(37): Amp\Http\Client\Connection\InterceptedStream->request()
#11 /var/www//TelegramBot/Bot2/vendor/amphp/http-client/src/Interceptor/RetryRequests.php(36): Amp\Http\Client\PooledHttpClient->request()
#12 /var/www//TelegramBot/Bot2/vendor/amphp/http-client/src/InterceptedHttpClient.php(30): Amp\Http\Client\Interceptor\RetryRequests->request()
#13 /var/www//TelegramBot/Bot2/vendor/amphp/http-client/src/Interceptor/FollowRedirects.php(129): Amp\Http\Client\InterceptedHttpClient->request()
#14 /var/www//TelegramBot/Bot2/vendor/amphp/http-client/src/InterceptedHttpClient.php(30): Amp\Http\Client\Interceptor\FollowRedirects->request()
#15 /var/www//TelegramBot/Bot2/vendor/amphp/http-client/src/Interceptor/ModifyRequest.php(52): Amp\Http\Client\InterceptedHttpClient->request()
#16 /var/www//TelegramBot/Bot2/vendor/amphp/http-client/src/InterceptedHttpClient.php(30): Amp\Http\Client\Interceptor\ModifyRequest->request()
#17 /var/www//TelegramBot/Bot2/vendor/amphp/http-client/src/HttpClient.php(26): Amp\Http\Client\InterceptedHttpClient->request()
#18 /var/www//TelegramBot/Bot2/src/Client.php(95): Amp\Http\Client\HttpClient->request()
#19 /var/www//TelegramBot/Bot2/src/Api.php(427): TuriBot\Client->Request()
#20 /var/www//TelegramBot/Bot2/getUpdates.php(34): TuriBot\Api->sendDocument()
#21 {main}
  thrown in /var/www//TelegramBot/Bot2/vendor/amphp/http-client/src/Connection/Http1Connection.php on line 462

after a few hours the bot gives me these errors and crashes, I think it's because it receives too many requests, there is a way to fix it because it's really boring to restart it every time

davtur19 commented 1 year ago

A quick fix might be to upgrade to a more stable version, but you would lose the async https://github.com/davtur19/TuriBot#stable-1

Could you try running a composer update to make sure you have the latest vesion of amphp? In the text you wrote is missing the error, you only sent the stacktrace, are you sure it doesn't say anything else?

danog commented 1 year ago

This issue is missing the actual error message

TravisScottex commented 1 year ago

I think with "composer update" I fixed it, until now it hasn't crashed yet. I can't see the whole error unfortunately because the code is executed in a screen

danog commented 1 year ago

You can scroll in screen: https://stackoverflow.com/questions/18489216/how-to-scroll-up-and-down-in-sliced-screen-terminal

TravisScottex commented 1 year ago

PHP Fatal error: Uncaught Amp\Http\Client\SocketException: Receiving the response headers for 'https://api.telegram.org/bot/sendVideo' failed, because the socket to 'api.telegram.org' @ '???' closed early with 0 bytes received within 9.906 seconds in /var/www/./TelegramBot/Bot2/vendor/amphp/http-client/src/Connection/Http1Connection.php:462

davtur19 commented 9 months ago

It seems to be a problem related to Telegram, if you still have the problem reopen the issue