question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Net::HTTPTooManyRequests

See original GitHub issue

import_extra.rb実行時に Net::HTTPTooManyRequests が出る場合があるようです。適宜ウェイトを挟む必要があるかもしれません。

.
.
.
importing zigokukayo...
importing mekarauroko...
importing donokyaraerabimasuka...
Traceback (most recent call last):
        7: from import_extra.rb:87:in `<main>'
        6: from import_extra.rb:15:in `import_decomojis'
        5: from import_extra.rb:55:in `upload_decomojis'
        4: from import_extra.rb:55:in `each'
        3: from import_extra.rb:69:in `block in upload_decomojis'
        2: from /usr/lib/ruby/gems/2.5.0/gems/mechanize-2.7.5/lib/mechanize.rb:536:in `post'
        1: from /usr/lib/ruby/gems/2.5.0/gems/mechanize-2.7.5/lib/mechanize.rb:1323:in `post_form'
/usr/lib/ruby/gems/2.5.0/gems/mechanize-2.7.5/lib/mechanize/http/agent.rb:323:in `fetch': 429 => Net::HTTPTooManyRequests for https://....slack.com/api/emoji.add -- unhandled response (Mechanize::ResponseCodeError)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
tockncommented, May 30, 2019

便利なプロダクトを開発してくださりありがとうございます! TooManyRequestsのヘッダの retry-after の時間(2 or 3 sec?)だけsleepするようにしましたが、@syguerさんの仰る通り一度TooManyRequestsに引っかかると再ログインしない限り毎回引っかかるようになりますね。。。(3000個あったら単純計算で2時間くらいかかります。。。) とりあえず、2段階認証の場合は上記の方法で、それ以外では自動で再ログインするようにしてみましたので、PR投げておきます!

2reactions
oticommented, Jul 8, 2019

@tockn さんが改修してくれたスクリプトですと、手元の環境では TooManyRequests が発生しないようになった感じがします。

一応解決したと皆して本件はCloseします。

皆さま、ありがとうございました。

Read more comments on GitHub >

github_iconTop Results From Across the Web

429 Too Many Requests - HTTP - MDN Web Docs
The HTTP 429 Too Many Requests response status code indicates the user has sent too many requests in a given amount of time...
Read more >
How to Fix 429 Too Many Requests Error - Kinsta
The HTTP 429 error is returned when too many requests are made to a page within a short period of time. Find out...
Read more >
429 Error – Too Many Requests HTTP Code Explained
The 429 error is an HTTP status code. It tells you when the use of an internet resource has surpassed the number of...
Read more >
Handling the “HTTP 429 – Too Many Requests” error when ...
The HTTP 429 - Too Many Requests response status code indicates the user has sent too many requests in a given amount of...
Read more >
HttpStatusCode is missing code 429 (TooManyRequests)
Net.Primitives referenced is missing status code 429 Here is th... ... <summary>Contains the values of status codes defined for HTTP.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found