getsentry / sentry-laravel

The official Laravel SDK for Sentry (sentry.io)
https://sentry.io
MIT License
1.24k stars 188 forks source link

php artisan sentry:test -> Timeout #68

Closed pablopaul closed 7 years ago

pablopaul commented 7 years ago

I am on Laravel 5.4 and php artisan sentry:test

gives me

[sentry] Client configuration:
-> server: https://sentry.io/api/107080/store/
-> project: 107080
-> public_key: xxx
-> secret_key: xxx
[sentry] Generating test event
[sentry] Sending test event with ID: xxx
[sentry] There was an error sending the test event:
 Operation timed out after 2002 milliseconds with 0 bytes received

How to track this down?

dcramer commented 7 years ago

Have you tried debugging if its network slowness or firewall issues? You could also try increasing the timeout, though I'm not sure if we make that easily available via Laravel settings.

time curl -i https://sentry.io/
pablopaul commented 7 years ago

@dcramer thanks, was an temp. issue on my side, working now as expected 😄

jeanjoe commented 6 years ago

@dcramer is there a way i can change the timeout? mine is failing the test with

[sentry] There was an error sending the test event: Resolving timed out after 2512 milliseconds

stayallive commented 6 years ago

Hey @jeanjoe, there is you can add the following to your config to change the timeout.

config/sentry.php:

<?php

return [
    // ... Your other config / DSN etc.

    'timeout' => 2, // 2 is the default, change to anything you want (in seconds)
];

Below applies if you are using sentry.io.

However it might be worth finding out why it's timing out in the first place using:

time curl -i https://sentry.io/

Because more than 2 seconds should not be needed to sent an event to Sentry, maybe hit up support if you have trouble connecting to sentry.io from your infrastructure.

jeanjoe commented 6 years ago

Thanks a lot @stayallive. your tip was Helpful.

Siva-93 commented 5 years ago

@stayallive,

return [
    // ... Your other config / DSN etc.

    'timeout' => 2, // 2 is the default, change to anything you want (in seconds)
];

Is the above code would work in the newer version of sentry?

stayallive commented 5 years ago

@Siva-93 no this option was removed because we no longer "know" which HTTP client is used by Sentry, we use httplug to provide a transport.

You can read more about how to customize the transport here:

You will have to define a different transport to customize any options for it, otherwise the default options of the client are used. By default we supply the CURL client.

If the above does not provide the answers you are looking for do please open a new issue with what you are trying to achieve or which problem you are facing so we are able to investigate without discussing this on a very old issue 😄

Siva-93 commented 5 years ago

Thank you @stayallive

PetengDedet commented 1 year ago

For someone in the future, it's now changed to http_timeout