Cannot open wallet dump file (code-8) Does anyone know why I can't dump info into a text file?

It also doesn't allow me to back up my wallet.

i am using SNAP
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;
}