向Ubuntu Tracker发送BitTorrent HTTP请求时遇错误求助
Let’s work through the problems you’re hitting with the Ubuntu 17.10 torrent announce requests step by step.
First Error: "you sent me garbage - id not of length 20"
This error is straightforward: the BitTorrent protocol requires an explicit peer_id parameter in every announce request, and this ID must be exactly 20 bytes long (when URL-encoded, that translates to properly formatted 20 %xx segments). Your first request didn’t include a peer_id at all, so the tracker rejected it immediately.
Second Request: Truncated URL & Incomplete Info Hash
Your second attempt included a peer_id but the URL was cut off. Even before that, there’s a critical issue with your info_hash:
- The
info_hashyou provided (%f0%7e%0b%05%84%74%5b%7b%cb%35%e9%80%97%48%8d%34%e6%86%23%d0) only has 19 URL-encoded byte segments. A validinfo_hashmust be exactly 20 bytes long (so 20%xxsegments total). This incomplete hash will cause the tracker to reject your request even if other parameters are correct.
Fixing the Announce Request
To get a valid response from the Ubuntu tracker, make sure your request includes all required parameters with correct formatting:
info_hash: Full 20-byte URL-encoded hash extracted from your Ubuntu 17.10 torrent file (double-check you didn’t truncate it)peer_id: A unique 20-byte identifier for your client (e.g., use a standard prefix like-UT1710-followed by random characters to make it unique, e.g.,-UT1710-abcdefghijklmnopqr)port: The port your BitTorrent client is listening on (typically between 6881-6889)uploaded: Number of bytes you’ve uploaded so far (start at0if you haven’t uploaded anything)downloaded: Number of bytes you’ve downloaded so far (start at0initially)left: Number of bytes remaining to download (equal to the total size of the torrent when you start)compact: Set to1to request a compact, efficient peer list from the tracker
Example Valid Request
Here’s what a properly formatted initial request might look like (replace the placeholder info_hash and left value with your actual torrent details):
http://torrent.ubuntu.com:6969/announce?info_hash=%f0%7e%0b%05%84%74%5b%7b%cb%35%e9%80%97%48%8d%34%e6%86%23%d0%xx&peer_id=-UT1710-abcdefghijklmnopqr&port=6881&uploaded=0&downloaded=0&left=1234567890&compact=1
Additional Checks
If you still run into issues:
- Verify you can reach
torrent.ubuntu.com:6969(useping torrent.ubuntu.comortelnet torrent.ubuntu.com 6969to test basic connectivity) - Double-check that all bytes in
info_hashandpeer_idare correctly URL-encoded as%xx - Ensure your request URL isn’t truncated—all parameters need to be fully included
内容的提问来源于stack exchange,提问作者Stav Alfi




