|
4 | 4 |
|
5 | 5 | A web service to get torrents' metadata from the infohashes. |
6 | 6 |
|
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. |
8 | 8 |
|
9 | 9 | > NOTICE: DHT must be enabled because the client needs to find peers first. |
10 | 10 |
|
@@ -43,6 +43,49 @@ Or with the browser: |
43 | 43 |
|
44 | 44 | You can check the API with the health_check endpoint: <http://127.0.0.1:3000/health_check> |
45 | 45 |
|
| 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 | + |
46 | 89 | ## Acknowledgments |
47 | 90 |
|
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). |
0 commit comments