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

[10.x] Added curl_error_code: 77 to DetectsLostConnections #46429

Merged
merged 1 commit into from
Mar 12, 2023
Merged

[10.x] Added curl_error_code: 77 to DetectsLostConnections #46429

merged 1 commit into from
Mar 12, 2023

Conversation

kima92
Copy link
Contributor

@kima92 kima92 commented Mar 10, 2023

My team encountered a few times on different servers that after day or tow of successful processing, our queue jobs are getting curl error 77, which is related to SSL errors.

Today I found this article and indeed there was an upgrade a day before

2023-03-08 10:05:49 configure php8.1-curl:amd64 8.1.16+repack-1+ubuntu18.04.1+deb.sury.org+1 <none>
2023-03-08 10:05:49 status unpacked php8.1-curl:amd64 8.1.16+repack-1+ubuntu18.04.1+deb.sury.org+1
2023-03-08 10:05:49 status half-configured php8.1-curl:amd64 8.1.16+repack-1+ubuntu18.04.1+deb.sury.org+1
2023-03-08 10:05:50 status installed php8.1-curl:amd64 8.1.16+repack-1+ubuntu18.04.1+deb.sury.org+1
2023-03-08 10:05:50 configure php8.1-opcache:amd64 8.1.16+repack-1+ubuntu18.04.1+deb.sury.org+1 <none>
2023-03-08 10:05:50 status unpacked php8.1-opcache:amd64 8.1.16+repack-1+ubuntu18.04.1+deb.sury.org+1
2023-03-08 10:05:50 status half-configured php8.1-opcache:amd64 8.1.16+repack-1+ubuntu18.04.1+deb.sury.org+1
2023-03-08 10:05:50 status installed php8.1-opcache:amd64 8.1.16+repack-1+ubuntu18.04.1+deb.sury.org+1
2023-03-08 10:05:50 configure php8.1-cli:amd64 8.1.16+repack-1+ubuntu18.04.1+deb.sury.org+1 <none>
2023-03-08 10:05:50 status unpacked php8.1-cli:amd64 8.1.16+repack-1+ubuntu18.04.1+deb.sury.org+1
2023-03-08 10:05:50 status half-configured php8.1-cli:amd64 8.1.16+repack-1+ubuntu18.04.1+deb.sury.org+1
2023-03-08 10:05:51 status installed php8.1-cli:amd64 8.1.16+repack-1+ubuntu18.04.1+deb.sury.org+1
2023-03-08 10:05:51 status triggers-pending php8.1-cli:amd64 8.1.16+repack-1+ubuntu18.04.1+deb.sury.org+1
2023-03-08 10:05:51 configure php8.1-fpm:amd64 8.1.16+repack-1+ubuntu18.04.1+deb.sury.org+1 <none>
2023-03-08 10:05:51 status unpacked php8.1-fpm:amd64 8.1.16+repack-1+ubuntu18.04.1+deb.sury.org+1
2023-03-08 10:05:51 status unpacked php8.1-fpm:amd64 8.1.16+repack-1+ubuntu18.04.1+deb.sury.org+1
2023-03-08 10:05:51 status unpacked php8.1-fpm:amd64 8.1.16+repack-1+ubuntu18.04.1+deb.sury.org+1
2023-03-08 10:05:51 status unpacked php8.1-fpm:amd64 8.1.16+repack-1+ubuntu18.04.1+deb.sury.org+1
2023-03-08 10:05:51 status unpacked php8.1-fpm:amd64 8.1.16+repack-1+ubuntu18.04.1+deb.sury.org+1
2023-03-08 10:05:51 status unpacked php8.1-fpm:amd64 8.1.16+repack-1+ubuntu18.04.1+deb.sury.org+1
2023-03-08 10:05:51 status half-configured php8.1-fpm:amd64 8.1.16+repack-1+ubuntu18.04.1+deb.sury.org+1
2023-03-08 10:05:53 status installed php8.1-fpm:amd64 8.1.16+repack-1+ubuntu18.04.1+deb.sury.org+1
2023-03-08 10:05:53 status triggers-pending php8.1-fpm:amd64 8.1.16+repack-1+ubuntu18.04.1+deb.sury.org+1

At first I thought about fixing it in my project using the JobFailed event

Queue::failing(function (JobFailed $event) {
    if ($event->exception instanceof \CurlException && $event->exception->getCode() == 77) {
          Artisan::call("queue:restart");
    }
});

But I don't want to restart all my queue workers in all servers only because of this error, and I think this problem should be fixed in the framework.

@ankurk91
Copy link
Contributor

What is the exact exception message?

@kima92
Copy link
Contributor Author

kima92 commented Mar 11, 2023

What is the exact exception message?

Unknown $curl_error_code: 77

@taylorotwell
Copy link
Member

You're getting this error from your database queries? This class is only for detecting lost database connections.

@kima92
Copy link
Contributor Author

kima92 commented Mar 11, 2023

You're getting this error from your database queries? This class is only for detecting lost database connections.

No, but the trait is also used in Illuminate/Queue/Worker::stopWorkerIfLostConnection(). Making it extendable or adding another class for queue errors looks like overengineering.

@GrahamCampbell GrahamCampbell changed the title Added curl_error_code: 77 to DetectsLostConnections [10.x] Added curl_error_code: 77 to DetectsLostConnections Mar 11, 2023
@taylorotwell taylorotwell merged commit 46ac3ec into laravel:10.x Mar 12, 2023
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

Successfully merging this pull request may close these issues.

4 participants