nning / transmission-rss

Adds torrents from RSS feeds to Transmission web frontend
GNU General Public License v3.0
448 stars 47 forks source link

docker container stop unexpected overnight #49

Closed fpfeng closed 7 years ago

fpfeng commented 7 years ago

aggregate https://xxx/torrentrss.php? 1503150700(debug) on_new_item event https://xxx/download.php? 1503150700(debug) request :19091 1503150704(debug) got session id xx 1503150704(debug) request :19091 1503150709(debug) connection timeout 1503150709(debug) request :19091 /usr/local/bundle/gems/json-2.1.0/lib/json/common.rb:156:in parse': 765: unexpected token at '<h1>409: Conflict</h1><p>Your request had an invalid session-id header.</p><p>To fix this, follow these steps:<ol><li> When reading a response, get its X-Transmission-Session-Id header and remember it<li> Add the updated header to your outgoing requests<li> When you get this 409 error message, resend your request with the updated header</ol></p><p>This requirement has been added to help prevent <a href="http://en.wikipedia.org/wiki/Cross-site_request_forgery">CSRF</a> attacks.</p><p><code>X-Transmission-Session-Id: xxx</code></p>' (JSON::ParserError) from /usr/local/bundle/gems/json-2.1.0/lib/json/common.rb:156:inparse' from /home/ruby/transmission-rss/lib/transmission-rss/client.rb:37:in rpc' from /home/ruby/transmission-rss/lib/transmission-rss/client.rb:56:inadd_torrent' from ./bin/transmission-rss:150:in block in <main>' from /home/ruby/transmission-rss/lib/transmission-rss/callback.rb:12:inblock (3 levels) in callback' from /home/ruby/transmission-rss/lib/transmission-rss/aggregator.rb:103:in process_link' from /home/ruby/transmission-rss/lib/transmission-rss/aggregator.rb:64:inblock (3 levels) in run' from /home/ruby/transmission-rss/lib/transmission-rss/aggregator.rb:63:in each' from /home/ruby/transmission-rss/lib/transmission-rss/aggregator.rb:63:inblock (2 levels) in run' from /home/ruby/transmission-rss/lib/transmission-rss/aggregator.rb:43:in each' from /home/ruby/transmission-rss/lib/transmission-rss/aggregator.rb:43:inblock in run' from /home/ruby/transmission-rss/lib/transmission-rss/aggregator.rb:42:in loop' from /home/ruby/transmission-rss/lib/transmission-rss/aggregator.rb:42:inrun' from ./bin/transmission-rss:181:in `

'

nning commented 7 years ago

transmission-rss fetches a session id before every request to add a torrent. This seemed to have worked according to the pasted log. However, the actual request to add the torrent timed out. Do you have an explanation for that?

Transmission responds the session id missmatch error to the retried torrent add request, because the session id is no longer valid. Did the Transmission daemon restart?

This seems not to be an issue with transmission-rss, primarily. However, the error handling could be improved, so that it survives a daemon restart.

fpfeng commented 7 years ago

The transmission daemon is non-stop running for days, I guess timeout caused by hard workload. Thank you very much for your explanation.