Cannot open wallet dump file (code-8)
If you installed Bitcoin Core via Snap, then you can easily dump your wallet keys to snap/bitcoin-core/common/ directory, like
dumpwallet /home/alex/snap/bitcoin-core/common/walletdump.txt

In case of success, you'll see the following response:
{
  &quot;filename&quot;: &quot;/home/alex/snap/bitcoin-core/common/walletdump.txt&quot;
}