0

I'm trying to configure an external formatter for SQL queries in DBeaver, but I'm encountering a "permission denied" error. I'm not very experienced with the command line and just started learning Linux, so I'm not very familiar with permissions.

Here are the steps I’ve taken so far:

  1. To confirm that it's only an issue with DBeaver, I tested the formatter on a test.sql file, and the formatter worked from the terminal command.
  2. Installed DBeaver version 24.1.1.202406231636 via Snap.
  3. Attempted to use chmod +x to give DBeaver execute access to my formatter located at /my/nvm/directory/versions/node/v22.3.0/bin/pg-formatter.

Despite this, the error persists.

Cannot run program "/my/nvm/directory/versions/node/v22.3.0/bin/pg-formatter": error=13, Permission denied
error=13, Permission denied
error=13, Permission denied

The formatter I'm trying to use is pg-formatter.

Can anyone help me understand why I'm getting this error and how to properly configure a formatter for DBeaver?

4
  • Check file permission running ls -l /my/nvm/directory/versions/node/v22.3.0/bin/pg-formatter in the terminal.
    – Nifriz
    Commented Jul 9 at 7:15
  • The output is lrwxrwxrwx 1 my-user-name my-user-name 50 jul 5 22:09 /my/nvm/directory/.nvm/versions/node/v22.3.0/bin/pg-formatter -> ../lib/node_modules/pg-formatter/dist/bin/index.js so i think is rwx that is what i gave it. Commented Jul 9 at 21:02
  • I tried to use the index.js referenced to format, outside of dbeaver worked, but it still didn't run in dbeaver error=13, Permission denied on /my/nvm/directory/versions/node/v22.3.0/lib/node_modules/pg-formatter/dist/bin/index.js the output was -rwxrwxrwx 1 my-user-name my-user-name 3018 jul 5 22:09 /my/nvm/directory/versions/node/v22.3.0/lib/node_modules/pg-formatter/dist/bin/index.js the only difference was 3018, but i dont know what that means Commented Jul 9 at 21:26
  • PErmission are correct. The problem may be related to Snap's security restrictions. On Snap applications are isolated and have limited access to system
    – Nifriz
    Commented Jul 10 at 8:08

0