-
Notifications
You must be signed in to change notification settings - Fork 41
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
HTTP request failed! HTTP/1.0 426 Upgrade Required #86
Comments
I was having the same issue when requesting the payload from a async job. The response from $job->getUrl() returns a URL that you are probably passing directly to the gzfile() function. I've noticed that there's a timing issue (on the Twitter side) that the GZ'd payload at the getUrl() location isn't ready. So, on failure, if you sleep for a second and try again (a few times) eventually the payload returns. Rough example of a solution:
|
Thanks for your message, I haven't got enough time to take a deeper look at
it.
I'll check your solution
Thanks again!
Missatge de Josh <[email protected]> del dia dc., 27 de gen. 2021 a
les 19:57:
… I was having the same issue when requesting the payload from a async job.
The response from $job->getUrl() returns a URL that you are probably
passing directly to the gzfile() function. I've noticed that there's a
timing issue (on the Twitter side) that the GZ'd payload at the getUrl()
location isn't ready. So, on failure, if you sleep for a second and try
again (a few times) eventually the payload returns.
Rough example of a solution:
$job->read();
if ($job->getStatus() == JobFields::SUCCESS) {
$cnt = 5; // 5 attempts before abandoning
$result = false;
while($cnt--) {
$result = @gzfile($job->getUrl());
if( !$result ) {
sleep(1);
} else {
break; // Leave while loop because we have a result
}
}
if( $result ) {
// Do your processing here.
}
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#86 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AATKEBB6SCQIU7QFEDDWR4TS4BOZRANCNFSM4WNIQHZA>
.
|
Checked it and it's working: This is the test code I'm using: `$job = $lineItem->stats(
|
Hi any idea why this happens sometimes? It is happening again and I didn't change anything. ErrorException: gzfile(https://ton.twimg.com/advertiser-api-async-analytics/tOMs85xJqNl4ZqFzCkGYyYFmgwirELTozxz3Vkw7I8cPeVZnyDgcusfLPs9E9IPJmM_v6SqK07vsXuu-8Ko5_gfG8XmkI_sphweYDLBrjzr43raU9D1GhtXjS_21p_0L.json.gz): failed to open stream: HTTP request failed! HTTP/1.0 426 Upgrade Required |
If it happens "somentimes" it could be an error on Twitter's side, what do you think? |
Hi, I'm getting this error now. Any ideas? thanks
ErrorException: gzfile(https://ton.twimg.com/advertiser-api-async-analytics/slKanmA6oZyP8UlbYrjfkN6tbke2ZMQVFp_d1sWiQWKfpLiGd4AuannFvvEFS0Kv7s55-2n4sl7q7aawZy2kW7o6ZQ-jMp_PrA_7I9Lyx_UiuuiFSAlbfZwJbufS7RAg.json.gz): failed to open stream: HTTP request failed! HTTP/1.0 426 Upgrade Required
The text was updated successfully, but these errors were encountered: