fennb / phirehose

PHP interface to Twitter Streaming API
709 stars 189 forks source link

Connection keeps failing once a day #119

Closed JPeterson2015 closed 3 years ago

JPeterson2015 commented 6 years ago

Instead of just always being connected, I find myself waking up in the morning and seeing that I am no longer pulling in tweets and have to restart my artisan command for this. Now I am pulling in like 30,000 tweets a day. But that shouldn't be the issue...

Here is the error I have.

`[2018-05-25 04:29:26] local.ERROR: fgets(): SSL: Connection reset by peer {"exception":"[object] (ErrorException(code: 0): fgets(): SSL: Connection reset by peer at /home/174711.cloudwaysapps.com/dhewyfpjgy/public_html/vendor/fennb/phirehose/lib/Phirehose.php:443) [stacktrace]

0 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'fgets(): SSL: C...', '/home/174711.cl...', 443, Array)

1 /home/174711.cloudwaysapps.com/dhewyfpjgy/public_html/vendor/fennb/phirehose/lib/Phirehose.php(443): fgets(Resource id #391)

2 /home/174711.cloudwaysapps.com/dhewyfpjgy/public_html/app/Console/Commands/ConnectToStreamingAPI.php(61): Phirehose->consume()

3 [internal function]: App\Console\Commands\ConnectToStreamingAPI->handle()

4 /home/174711.cloudwaysapps.com/dhewyfpjgy/public_html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(29): call_user_func_array(Array, Array)

5 /home/174711.cloudwaysapps.com/dhewyfpjgy/public_html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(87): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()

6 /home/174711.cloudwaysapps.com/dhewyfpjgy/public_html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(31): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object(Closure))

7 /home/174711.cloudwaysapps.com/dhewyfpjgy/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php(564): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL)

8 /home/174711.cloudwaysapps.com/dhewyfpjgy/public_html/vendor/laravel/framework/src/Illuminate/Console/Command.php(183): Illuminate\Container\Container->call(Array)

9 /home/174711.cloudwaysapps.com/dhewyfpjgy/public_html/vendor/symfony/console/Command/Command.php(251): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))

10 /home/174711.cloudwaysapps.com/dhewyfpjgy/public_html/vendor/laravel/framework/src/Illuminate/Console/Command.php(170): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))

11 /home/174711.cloudwaysapps.com/dhewyfpjgy/public_html/vendor/symfony/console/Application.php(865): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

12 /home/174711.cloudwaysapps.com/dhewyfpjgy/public_html/vendor/symfony/console/Application.php(241): Symfony\Component\Console\Application->doRunCommand(Object(App\Console\Commands\ConnectToStreamingAPI), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

13 /home/174711.cloudwaysapps.com/dhewyfpjgy/public_html/vendor/symfony/console/Application.php(143): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

14 /home/174711.cloudwaysapps.com/dhewyfpjgy/public_html/vendor/laravel/framework/src/Illuminate/Console/Application.php(89): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

15 /home/174711.cloudwaysapps.com/dhewyfpjgy/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(122): Illuminate\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

16 /home/174711.cloudwaysapps.com/dhewyfpjgy/public_html/artisan(37): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

17 {main}

"} `

DarrenCook commented 6 years ago

Instead of just always being connected, I find myself waking up in the morning and seeing that I am no longer pulling in tweets and have to restart ...

|[2018-05-25 04:29:26] local.ERROR: fgets(): SSL: Connection reset by peer {"exception":"[object] (ErrorException(code: 0): fgets(): SSL: Connectio This is probably your ISP killing long-running sockets.

You could voluntarily disconnect and reconnect every few hours (watching out for Twitter's restrictions on too many reconnects). Or you could have another program that watches the flow of tweets, and kills your script and restarts it when it the tweets stop. (The latter way is more flexible, coping with more outages.)

Darren

dandv commented 4 years ago

We're seeing the stream stall with Node and . NET. Might be a Twitter issue.

https://github.com/draftbit/twitter-lite/issues/59#issuecomment-653723553