Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to select a folder for creating the very first graph #33

Open
yudistrange opened this issue Nov 30, 2022 · 9 comments
Open

Unable to select a folder for creating the very first graph #33

yudistrange opened this issue Nov 30, 2022 · 9 comments

Comments

@yudistrange
Copy link

On launching LogSeq it shows a tutorial graph. It then asks to select a folder to create a new graph at the end of the tutorial.

However I am unable to select a folder to start a new graph. The application does nothing and takes me back to the select folder screen.

Relevant Logs:

flatpak run com.logseq.Logseq
F: Can't get document portal: GDBus.Error:org.freedesktop.DBus.Error.NoReply: Remote peer disconnected
[3 zypak-helper] Wait found events, but sd-event found none
LaunchProcess: failed to execvp:
xdg-settings
[3:1129/120207.159028:ERROR:bus.cc(398)] Failed to connect to the bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory
[3:1129/120207.159072:ERROR:bus.cc(398)] Failed to connect to the bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory
LaunchProcess: failed to execvp:
xdg-settings
12:02:07.192 › Logseq App(0.8.11) Starting... 
libva error: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null)
[52:1129/120208.750948:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 1 times!
12:02:09.023 › :electron.handler/watch-dir {:path "/home/udit/.logseq/config"}
12:02:09.067 › :electron.handler/unwatch-dir {:path "/local"}
12:02:09.068 › :electron.handler/watch-dir {:path "/local"}
[3:1129/120210.117186:ERROR:bus.cc(398)] Failed to connect to the bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory
[3:1129/120210.117222:ERROR:bus.cc(398)] Failed to connect to the bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory
[3:1129/120210.117258:ERROR:bus.cc(398)] Failed to connect to the bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory
[3:1129/120210.117280:ERROR:bus.cc(398)] Failed to connect to the bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory
[3:1129/120210.117299:ERROR:bus.cc(398)] Failed to connect to the bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory
12:02:11.382 › :electron.handler/open-dir open folder selection dialog
12:02:13.357 › :electron.handler/open-dir {:path nil}
Error occurred in handler for 'main': Error: path empty
    at /app/logseq/resources/app/electron.js:14111:334
    at Function.$G__96157__1$$ [as $cljs$core$IFn$_invoke$arity$1$] (/app/logseq/resources/app/electron.js:4013:173)
    at /app/logseq/resources/app/electron.js:13161:80
    at async node:electron/js2c/browser_init:189:563

This issue only occurs if I install logseq via flatpak. I compiled the application from source and it was able to access disk for creating a new graph.
Also worth noting that once it worked with the compiled app, it started working with the flatpak installed app as well.

I added an issue on the logseq repo, I was redirected here. It seems like flatpak installation is not getting correct permissions.

@kanru
Copy link
Collaborator

kanru commented Nov 30, 2022

Hi, were you trying to open a directory outside of the $HOME dir?

The default permission of the flatpak only allows the app to access files inside $HOME. If you need you can use the Flatseal tool to adjust the permissions.

@yudistrange
Copy link
Author

@kanru no it was an empty subdirectory in my $HOME dir

@kanru
Copy link
Collaborator

kanru commented Nov 30, 2022

I see. Could you share your distro and desktop environment version?

12:02:09.023 › :electron.handler/watch-dir {:path "/home/udit/.logseq/config"}
12:02:09.067 › :electron.handler/unwatch-dir {:path "/local"}
12:02:09.068 › :electron.handler/watch-dir {:path "/local"}

The last two lines shows Logseq was trying to open a folder /local under root filesystem. It might be a symbolic link in your $HOME but actually was pointing to the root. It could be possible some distro has this kind of setup by default.

@yudistrange
Copy link
Author

I am using fedora-37 server edition, with sway-1.7 as the desktop compositor for wayland
It is a bare-bones installation, so I might have some things missing, but then the installation should prompt / fail for them, right?

@kanru
Copy link
Collaborator

kanru commented Nov 30, 2022

Yes, I agree this is unexpected.

I think there are two bugs

  1. Logseq should warn when it doesn't have permission to open a directory
  2. I'm using fedora-37 silverblue as well. I don't remember the default installation has a /local dir

I'll try to reproduce both issues. Did you follow any guide to setup your bare-bone installation?

@kanru
Copy link
Collaborator

kanru commented Nov 30, 2022

I can reproduce similar error message by either

ln -s /mnt $HOME/local

or

mkdir $HOME/local
chmod a-rwx $HOME/local

And then try to open the $HOME/local folder

In both cases, I think there's a bug in Logseq as it should show an access denied warning.

@yudistrange
Copy link
Author

Did you follow any guide to setup your bare-bone installation?

Nope. Just installed fedora-37 server edition. Then installed sway (which brought in display deps)

@almereyda
Copy link

almereyda commented May 11, 2023

The upstream issue is closed, and the fix from logseq/logseq#8200 was included with logseq/logseq@2e374f7 in the 0.8.17 release.

Is this eventually fixed for the Flatpak as well?

The link case seems to be covered by #32.

@kanru
Copy link
Collaborator

kanru commented Jul 15, 2023

The upstream issue is fixed, accessing folders without sufficient permission will show an error.

I also tested opening a folder symlinked to home and it seems to work.

sudo mkdir /mnt/TestNotes
sudo chown kanru:kanru /mnt/TestNotes
cd $HOME && ln -s /mnt/TestNotes

When opened in Logseq it shows the sandboxed user folder, but the rest works fine

All graphs

Local graphs:

b2088959/TmpNotes             Unlink

[Open a local directory]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants