Does getroute not know the capacity/liquidity of channels in transit?
No, liquidity is not advertised across the network. That would be a privacy infringement. It knows the total channel capacity, though.
Makes perfect sense, I confused capacity with current liquidity.
Otherwise it would be possible to see which channels are used or not by taking snapshots of the liquidity balance from them. My thinking error.
Or what other reasons can make a transaction fail (locally or remote)?
Locally: Check out
this comment. There are apparently five possible causes.
lightning-cli listforwards returns the exact error if a transaction fails locally.
Remotely: Some node might fail a transaction locally or suddenly go offline. There might be some other causes that I am not aware of at the moment too.
Thanks, funny enough the two errors I get locally are not listed there:
"failreason": "WIRE_TEMPORARY_CHANNEL_FAILURE",
"failreason": "WIRE_REQUIRED_NODE_FEATURE_MISSING",
From grepping the sources I conclude these are both related to tor connections in some way.
The first seems to be nodes down the routing path being unreachable and the second I do not understand completely yet but it seems related to a disagreement of nodes regarding some HTLC parameters.
Will keep reading the debug.log around successful and failed transactions to try to get a better understanding on what exactly happens under the hood.