`ipfs dht provide -r <hash>` not working?

I’ve just tested the ipfs dht provide -r <hash> command on a directory with a couple of files in them. After waiting for ca. 30 minutes, ipfs hadn’t finished yet, so I killed it.

Before that, I had announced the files individually with while read -r LINE ; do ; HASH=$(echo "$LINE" | awk '{print $2}') ; ipfs dht provide "$HASH" ; done < <(ipfs files ls -l /path/to/directory), and that had worked flawlessly. Some objects took a bit longer to announce than others, but in the end the whole process was done in a couple of minutes.

Now, why doesn’t the recursive variant work? Anyone got an idea?

What do you get when you run ipfs dht provide -v -r <hash>?

I might have been too impatient that first time around. When trying it again, it finished in just under 30 minutes. The verbose output had a lot of errors, but the command finished eventually. Errors e.g. like this:

18:42:01.297: error: dial attempt failed: context deadline exceeded
18:42:01.298: error: dial attempt failed: context deadline exceeded
18:42:01.298: error: dial attempt failed: <peer.ID SYCBeu> --> <peer.ID TtRKJY> dial attempt failed: dial tcp4 107.2.240.208:40002: getsockopt: connection refused
18:42:01.298: error: dial attempt failed: <peer.ID SYCBeu> --> <peer.ID WLsZ1n> dial attempt failed: dial tcp6 [fdfc::1]:4001: connect: no route to host
18:42:01.299: error: dial attempt failed: <peer.ID SYCBeu> --> <peer.ID WwVWWN> dial attempt failed: dial tcp4 10.81.1.123:4001: i/o timeout
18:42:01.299: error: dial attempt failed: <peer.ID SYCBeu> --> <peer.ID Rm1hBY> dial attempt failed: dial tcp4 103.18.139.230:56864: i/o timeout
18:42:01.299: error: dial attempt failed: context deadline exceeded
18:42:01.300: error: dial attempt failed: <peer.ID SYCBeu> --> <peer.ID YebHWd> dial attempt failed: dial tcp4 94.70.38.41:37665: i/o timeout
18:42:01.300: error: dial attempt failed: context deadline exceeded
18:42:01.302: error: dial attempt failed: <peer.ID SYCBeu> --> <peer.ID bHT8qk> dial attempt failed: dial tcp6 [2400:8902::f03c:91ff:fee0:4d7e]:4001: connect: no route to host
18:42:01.303: error: dial attempt failed: context deadline exceeded
18:42:01.304: error: dial attempt failed: context deadline exceeded
18:42:01.306: error: dial attempt failed: context deadline exceeded
18:42:01.395: error: dial attempt failed: <peer.ID SYCBeu> --> <peer.ID aFAvaF> dial attempt failed: dial tcp4 14.221.237.118:64348: i/o timeout
18:42:01.395: error: dial attempt failed: <peer.ID SYCBeu> --> <peer.ID cbpXTf> dial attempt failed: dial tcp4 164.15.134.116:47328: i/o timeout
18:42:01.395: error: dial attempt failed: <peer.ID SYCBeu> --> <peer.ID eBT8g5> dial attempt failed: dial tcp6 [fd95:6ce4:3fa2:ca:2e0:81ff:fe2f:d9d7]:4001: connect: no route to host