Skip to content

Commit cb53762

Browse files
committed
docs(readme): add troubleshooting section with common issues and solutions
1 parent f2514ea commit cb53762

File tree

2 files changed

+48
-2
lines changed

2 files changed

+48
-2
lines changed

README.md

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
A web service to get torrents' metadata from the infohashes.
66

7-
The API is based on the Rust BitTorrent client [rqbit](<https://github.com/ikatson/rqbit>). The client uses [BEP 9](https://www.bittorrent.org/beps/bep_0009.html) to get the Metadata Files from other peers.
7+
The API is based on the Rust BitTorrent client [rqbit](https://github.com/ikatson/rqbit). The client uses [BEP 9](https://www.bittorrent.org/beps/bep_0009.html) to get the Metadata Files from other peers.
88

99
> NOTICE: DHT must be enabled because the client needs to find peers first.
1010
@@ -43,6 +43,49 @@ Or with the browser:
4343
4444
You can check the API with the health_check endpoint: <http://127.0.0.1:3000/health_check>
4545

46+
## Troubleshooting
47+
48+
### Tokio Runtime Error
49+
50+
If you encounter an error like:
51+
52+
```text
53+
Registering a blocking socket with the tokio runtime is unsupported. If you wish to do anyways, please add `--cfg tokio_allow_from_blocking_fd` to your RUSTFLAGS.
54+
```
55+
56+
You need to set the RUSTFLAGS environment variable when building and running the application:
57+
58+
```console
59+
RUSTFLAGS="--cfg tokio_allow_from_blocking_fd" cargo run
60+
```
61+
62+
This is a known issue with the tokio runtime on certain systems. The flag allows the application to register blocking file descriptors with the async runtime.
63+
64+
### Session Directory Not Found
65+
66+
If you see an error about the session output directory not being found:
67+
68+
```text
69+
Error: Session output directory not found: /var/lib/torrust/hash2torrent/session
70+
```
71+
72+
Make sure you've run the setup script first:
73+
74+
```console
75+
sudo ./contrib/dev-tools/init/install.sh $(id -u)
76+
```
77+
78+
This script creates the necessary directories with proper permissions for the BitTorrent client session data.
79+
80+
### Torrent Not Found (408 Timeout)
81+
82+
The BitTorrent client needs to find peers through DHT before it can download the metadata. This process can take time, and the request may timeout (10 seconds default). If this happens:
83+
84+
- DHT needs time to bootstrap and find peers
85+
- Try the request again after a few moments
86+
- Some torrents may have very few or no active peers
87+
- Check that your network allows DHT traffic on the configured port
88+
4689
## Acknowledgments
4790

48-
[ikatson](<https://github.com/ikatson>) main contributor to [rqbit](https://github.com/ikatson/rqbit).
91+
[ikatson](https://github.com/ikatson) main contributor to [rqbit](https://github.com/ikatson/rqbit).

cSpell.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"comms",
1515
"Containerfile",
1616
"distroless",
17+
"dtolnay",
1718
"ikatson",
1819
"infohash",
1920
"letsencrypt",
@@ -25,6 +26,8 @@
2526
"realpath",
2627
"reqwest",
2728
"rqbit",
29+
"RUSTDOCFLAGS",
30+
"RUSTFLAGS",
2831
"serde",
2932
"Slowloris",
3033
"thiserror",

0 commit comments

Comments
 (0)