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

Laravel Vapor - HTTP/2 stream 15 was not closed cleanly before end of the underlying stream #165

Open
ryangittings opened this issue Apr 12, 2023 · 3 comments

Comments

@ryangittings
Copy link

ryangittings commented Apr 12, 2023

Hey all,

I'm getting an issue in Laravel Vapor that I can't recreate locally. Stack trace attached:

Exception: HTTP/2 stream 15 was not closed cleanly before end of the underlying stream in /var/task/vendor/edamov/pushok/src/Client.php:161
Stack trace:
#0 /var/task/vendor/laravel-notification-channels/apn/src/ApnChannel.php(79): Pushok\Client->push()
#1 /var/task/vendor/laravel-notification-channels/apn/src/ApnChannel.php(58): NotificationChannels\Apn\ApnChannel->sendNotifications(Object(Pushok\Client), Object(NotificationChannels\Apn\ApnMessage), Array)
#2 /var/task/vendor/laravel/framework/src/Illuminate/Notifications/NotificationSender.php(148): NotificationChannels\Apn\ApnChannel->send(Object(App\Models\User), Object(App\Notifications\NewEpisode))

Thank you!

@yetdog
Copy link

yetdog commented Jun 4, 2023

Sounds similar to my recent issue. Hmm. Perhaps Apple changed something on their end?

@ahinkle
Copy link

ahinkle commented Jul 27, 2023

Hey there, did either of you happen to find a solution?

@yetdog
Copy link

yetdog commented Jul 27, 2023

Only thing I did (that worked for me) is break the push messages up into chunks of 10000 tokens per client object

So for each group of 10000 tokens, here's my pseudo-code:

$client = new Client($authProvider, $production = $pushenv);
$client->setAutoCloseConnections ( true );
$client->setNbConcurrentRequests( 40 );
$client->setMaxConcurrentConnections( 15 );
$client->addNotifications($notifications); //have previously built the $notifications array

$responses = $client->push();

$client->close();
unset($client);
unset($notifications);

I loop through that however many times it takes to get through all the tokens and it seems to be working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants