deployer icon indicating copy to clipboard operation
deployer copied to clipboard

Sentry recipe : increase Httpie timeout

Open franck-grenier opened this issue 3 years ago • 7 comments

  • Deployer version: 7.0.0-rc-8
  • Deployment OS: Gitlab CI (Docker runner)

Hello Deployer, I'm having troubles to POST my releases and their deploys to my self-hosted Sentry.

Randomly, POST requests are ended on client-side by Httpie timeout of 5s (https://github.com/deployphp/deployer/blob/master/src/Utility/Httpie.php#L153). I can see them arrive on my Sentry server responding 499.

Do you know how i can increase these Curl timeout params for the Sentry recipe ?

Thanks

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar

franck-grenier avatar Jun 09 '22 12:06 franck-grenier

having same problem..

norkunas avatar Aug 05 '22 04:08 norkunas

What I did to avoid deployment failures due to timeouts : catch the exception

task('deploy:sentry:once', function(){
    try {
        invoke('deploy:sentry');
    } catch (\Exception $e) {
        info('Unable to push release or deploy to Sentry : ' . $e->getMessage());
    }
})->once();

franck-grenier avatar Aug 16 '22 08:08 franck-grenier

Clever)

antonmedv avatar Aug 16 '22 21:08 antonmedv

Hej, I'm having the same problem and wanted to ask, if there will be an option to increase the curl timeout? https://github.com/deployphp/deployer/blob/master/src/Utility/Httpie.php#L173

jackd248 avatar May 02 '23 09:05 jackd248

Okay I see, using the setopt function is helping with this issue: https://github.com/deployphp/deployer/blob/master/src/Utility/Httpie.php#L141

jackd248 avatar May 02 '23 09:05 jackd248

@jackd248 could you please give an example what you have written into your deploy.php to raise that timeout? Thanks a lot !

thyseus avatar Sep 12 '23 14:09 thyseus

Hej @thyseus, i have only adjusted my task to send a notification, no global configuration.

Httpie::post(get('webhook'))
        ->setopt(CURLOPT_TIMEOUT, 10)
        ->jsonBody(
            [
                'text'       => $message
            ]
        )
        ->send();

jackd248 avatar Sep 12 '23 15:09 jackd248