bruno icon indicating copy to clipboard operation
bruno copied to clipboard

Error while running `sudo bruno` to resolve access issues

Open ved-asole opened this issue 1 year ago • 7 comments

I have checked the following:

  • [X] I use the newest version of bruno.
  • [X] I've searched existing issues and found nothing related to my issue.

Describe the bug

ved@vedasole:~$ sudo bruno
Preferences file is located at: /root/snap/bruno/50/.config/bruno/preferences.json
[138730:0901/201704.332944:ERROR:ozone_platform_x11.cc(245)] Missing X server or $DISPLAY
[138730:0901/201704.333014:ERROR:env.cc(258)] The platform failed to initialize.  Exiting.
Segmentation fault

.bru file to reproduce the bug

No response

Screenshots/Live demo link

bruno_error

ved-asole avatar Sep 01 '24 14:09 ved-asole

I don't think you are supposed to run any GUI application that is accessing x server as root. Maybe if you set DISPLAY=:0 But why do you have access issues with bruno ?

https://askubuntu.com/questions/164819/how-can-i-run-an-application-with-a-gui-as-admin-from-a-non-admin-user-session

i don't think this issue is a bruno one

berlingoqc avatar Sep 01 '24 16:09 berlingoqc

The problem is if I don't run bruno with sudo then I get the below error while creating the collections :

Command : Open bruno directly from Ubuntu app menu

Error :

caError: EACCES: permission denied, mkdir '/run/user/1000/doc/e1553bdf/pdf-assistant/Demo Collection'
    at Object.mkdirSync (node:fs:1372:26)
    at createDirectory (/snap/bruno/50/resources/app.asar/src/utils/filesystem.js:123:13)
    at /snap/bruno/50/resources/app.asar/src/ipc/collection.js:121:15
    at WebContents.<anonymous> (node:electron/js2c/browser_init:2:83270)
    at WebContents.emit (node:events:519:28) {
  errno: -13,
  code: 'EACCES',
  syscall: 'mkdir',
  path: '/run/user/1000/doc/e1553bdf/pdf-assistant/Demo Collection'
}
Error occurred in handler for 'renderer:create-collection': Error: EACCES: permission denied, mkdir '/run/user/1000/doc/e1553bdf/pdf-assistant/Demo Collection'
    at Object.mkdirSync (node:fs:1372:26)
    at createDirectory (/snap/bruno/50/resources/app.asar/src/utils/filesystem.js:123:13)
    at /snap/bruno/50/resources/app.asar/src/ipc/collection.js:121:15
    at WebContents.<anonymous> (node:electron/js2c/browser_init:2:83270)
    at WebContents.emit (node:events:519:28) {
  errno: -13,
  code: 'EACCES',
  syscall: 'mkdir',
  path: '/run/user/1000/doc/e1553bdf/pdf-assistant/Demo Collection'
}

ved-asole avatar Sep 01 '24 17:09 ved-asole

It is not having access to mounted drives

ved-asole avatar Sep 13 '24 17:09 ved-asole

can you please suggest on the above issue?

ved-asole avatar Oct 03 '24 20:10 ved-asole

The problem is if I don't run bruno with sudo then I get the below error while creating the collections : Command : sudo ./run-cli.sh download gpt2-medium

The command you reference - run-cli.sh - where does it come from and what does it do? Does it create files?

pietrygamat avatar Oct 03 '24 20:10 pietrygamat

no, that's the wrong command. Please ignore it. Updated my comment

ved-asole avatar Oct 03 '24 20:10 ved-asole

Your user cannot write in directories - presumably owned by root if you created them with sudo, there's really nothing more to it. Fix the permissions on the OS level, and never launch bruno (or any gui app really) with sudo.

pietrygamat avatar Oct 03 '24 21:10 pietrygamat