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

(Linux) Bad work directory by default #34

Open
EvilGremlin opened this issue Dec 21, 2024 · 6 comments
Open

(Linux) Bad work directory by default #34

EvilGremlin opened this issue Dec 21, 2024 · 6 comments
Labels
Bug Something isn't working Core Desktop Linux

Comments

@EvilGremlin
Copy link

when run by simple /home/eg/Soft_AppImage/Grayjay/Grayjay it crashes with CEF:File not found at native path '/home/user/cef/dotcefnative'.
so i had to use bash -c 'cd /home/eg/Soft_AppImage/Grayjay/ && ./Grayjay' for menu item

@Zvonimir-FUTO Zvonimir-FUTO added Bug Something isn't working Core Desktop Linux labels Dec 21, 2024
@jonathancutting
Copy link

This happens to me, too. Cannot launch GrayJay from either a .desktop file. Running Ubuntu Linux 22.04.5 LTS. See snippets below.

When launching via .desktop file, nothing happens (the errors and core dump happen in the background, invisibly).

If I cd to the directory with the GrayJay executable, and then launch it from the terminal (using ./Grayjay), then it launches, but there are a lot of errors thrown in the terminal window the whole time it's running and after it's terminated.

.desktop file

[Desktop Entry]
Type=Application
Name=GrayJay
Comment=Streaming video player and downloader
Exec=/home/[user]/.grayjay/Grayjay
Icon=/home/[user]/.grayjay/grayjay.png
Path=/home/[user]/.grayjay/
Terminal=False
Categories=Multimedia;

Terminal

[user]@[host]:~$ ./.grayjay/Grayjay
Directories:Base Directory: /home/[user]/.grayjay/
Directories:User Directory: /home/[user]/Grayjay
Directories:Temporary Directory: /home/[user]/.grayjay/temp_files
Directories:Log file path: /home/[user]/.grayjay//log.txt
T:PortFile path: /home/[user]/.grayjay/port
T:StartingUpFile path: /home/[user]/.grayjay/starting
T:Found StartingUpFile, waiting for PortFile and process
T:No PortFile after waiting, killing any lingering (stuck) process
T:Created StartingUpFile, removed PortFile
Program:Main: StateApp.Startup
StateApp:Startup: Initializing PluginEncryptionProvider
StateApp:Startup: Initializing DatabaseConnection
StateApp:Startup: Ensuring Table DBSubscriptionCache
StateApp:Startup: Ensuring Table DBHistory
StateApp:Startup: Initializing Download Cycle
StateDownloads:Started downloading cycle
StateDownloads:Ended downloading cycle
Program:Main: StateApp.Startup finished (97ms)
Program:Extra args: 
Program:Main: Starting DotCefProcess
CEF:CEF directory '/home/[user]/cef'.
CEF:Working directory '/home/[user]/cef'.
CEF:CEF exe path '/home/[user]/cef/dotcefnative'.
CEF:File not found at native path '/home/[user]/cef/dotcefnative'.
Keyring:Falling back to file keyring
Unhandled exception. System.Exception: Native executable not found.
   at DotCef.DotCefProcess.Start(String args)
   at Grayjay.Desktop.Program.Main(String[] args)
   at Grayjay.Desktop.Program.<Main>(String[] args)
Aborted (core dumped)

@lordscales91
Copy link

I'm experiencing similar issues, it doesn't launch no matter what. I'm running it on Kubuntu 24.04.1 LTS x86_64

I extracted the application to /home/[user]/Downloads/Grayjay.Desktop-linux-x64-v2.

Here's the log from the terminal:

Directories:Base Directory: /home/[user]/Downloads/Grayjay.Desktop-linux-x64-v2/
Directories:User Directory: /home/[user]/Grayjay
Directories:Temporary Directory: /home/[user]/Downloads/Grayjay.Desktop-linux-x64-v2/temp_files
Directories:Log file path: /home/[user]/Downloads/Grayjay.Desktop-linux-x64-v2//log.txt
T:PortFile path: /home/[user]/Downloads/Grayjay.Desktop-linux-x64-v2/port
T:StartingUpFile path: /home/[user]/Downloads/Grayjay.Desktop-linux-x64-v2/starting
T:Found StartingUpFile, waiting for PortFile and process
T:No PortFile after waiting, killing any lingering (stuck) process
T:Created StartingUpFile, removed PortFile
Program:Main: StateApp.Startup
StateApp:Startup: Initializing PluginEncryptionProvider
StateApp:Startup: Initializing DatabaseConnection
StateApp:Startup: Ensuring Table DBSubscriptionCache
StateApp:Startup: Ensuring Table DBHistory
StateApp:Startup: Initializing Download Cycle
StateDownloads:Started downloading cycle
StateDownloads:Ended downloading cycle
Program:Main: StateApp.Startup finished (86ms)
Program:Extra args: 
Program:Main: Starting DotCefProcess
CEF:CEF directory '/home/[user]/Downloads/Grayjay.Desktop-linux-x64-v2/cef'.
CEF:Working directory '/home/[user]/Downloads/Grayjay.Desktop-linux-x64-v2/cef'.
CEF:CEF exe path '/home/[user]/Downloads/Grayjay.Desktop-linux-x64-v2/cef/dotcefnative'.
--change-stack-guard-on-fork=disable --disable-chrome-runtime --parent-to-child 111 --child-to-parent 114 --disable-web-security --use-views 
Program:Main: Starting DotCefProcess finished (4ms)
Program:Main: Starting window.
Receive loop started.
GrayjayServer:RunServerAsync: Called with (proxyUrl = ).
CEF:[1225/161758.438710:INFO:pipe.cc(141)] Pipe set handles readFd 111, writeFd 114
CEF:[1225/161758.438815:INFO:main_linux.cc(149)] Cache path: /tmp/dotcef_1735139878438
CEF:[1225/161758.439127:ERROR:chrome_main_delegate.cc(1200)] Web security may only be disabled if '--user-data-dir' is also specified with a non-default value.
CEF:[20812:20812:1225/161758.443016:FATAL:setuid_sandbox_host.cc(163)] The SUID sandbox helper binary was found, but is not configured correctly. Rather than run without sandboxing I'm aborting now. You need to make sure that /home/[user]/Downloads/Grayjay.Desktop-linux-x64-v2/cef/chrome-sandbox is owned by root and has mode 4755.
An exception occurred in the IPC: Unable to read beyond the end of the stream.    at System.IO.Stream.ReadAtLeastAsyncCore(Memory`1 buffer, Int32 minimumBytes, Boolean throwOnEndOfStream, CancellationToken cancellationToken)
   at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder`1.StateMachineBox`1.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
   at DotCef.DotCefProcess.<Start>b__34_3()
Receive loop stopped.
GrayjayServer:RunServerAsync: Static files path '/home/[user]/Downloads/Grayjay.Desktop-linux-x64-v2/wwwroot'.
GrayjayServer:RunServerAsync: MapWhen Websocket.
GrayjayServer:RunServerAsync: Start StateCasting.
StateCasting:Casting listener starting
Starting
Starting
Unhandled exception. System.AggregateException: One or more errors occurred. (A task was canceled.)
 ---> System.Threading.Tasks.TaskCanceledException: A task was canceled.
   at System.Threading.Tasks.Task.GetExceptions(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at Grayjay.Desktop.Program.Main(String[] args)
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
   at Grayjay.Desktop.Program.Main(String[] args)
   at Grayjay.Desktop.Program.<Main>(String[] args)
--- End of stack trace from previous location ---

   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at Grayjay.Desktop.Program.Main(String[] args)
   at Grayjay.Desktop.Program.<Main>(String[] args)
Aborted (core dumped)

@Zvonimir-FUTO Zvonimir-FUTO added the Solved Issue/feature has been fixed/implemented in development branch but not yet pushed to end users label Jan 13, 2025
@Zvonimir-FUTO
Copy link
Collaborator

Done. It now checks to see if the old style dir exists first and then uses that. Otherwise, it will use a new style dir which prioritizes:

  1. XDG_DATA_HOME
  2. ~/.local.share
  3. ~/.config

Depending on what exists.

This will be released in the next update.

@Zvonimir-FUTO
Copy link
Collaborator

Implemented in latest version.

@EvilGremlin
Copy link
Author

EvilGremlin commented Jan 23, 2025

@Zvonimir-FUTO Not fixed, now app launches, but with blank window.
Issue is not about config location, but about properly detecting and enforcing working directory.

@Zvonimir-FUTO Zvonimir-FUTO reopened this Jan 23, 2025
@Zvonimir-FUTO Zvonimir-FUTO removed the Solved Issue/feature has been fixed/implemented in development branch but not yet pushed to end users label Jan 23, 2025
@MoralCode
Copy link

I believe I am seeing this while working on #14

It seems like this line

cef.Start("--disable-web-security --use-alloy-style --use-native --no-sandbox " + extraArgs);
passes the flag --disable-web-security for what I presume is an internal web server that displays the UI.

Log snippet:

CEF:Working directory '/app/grayjay/cef'.
CEF:CEF exe path '/app/grayjay/cef/dotcefnative'.
--change-stack-guard-on-fork=disable --parent-to-child 114 --child-to-parent 117 --disable-web-security --use-alloy-style --use-native --no-sandbox 
Program:Main: Starting DotCefProcess finished (15ms)
Program:Main: Starting window.
Receive loop started.
GrayjayServer:RunServerAsync: Called with (proxyUrl = ).
CEF:[0302/171227.940272:INFO:pipe.cc(149)] Pipe set handles readFd 114, writeFd 117
CEF:[0302/171227.940412:INFO:main_linux.cc(100)] Set handles.
CEF:[0302/171227.940489:INFO:main_linux.cc(180)] Cache path: /tmp/dotcef_1740953547940
CEF:[0302/171227.941386:ERROR:chrome_main_delegate.cc(1193)] Web security may only be disabled if '--user-data-dir' is also specified with a non-default value.

it seems like there should be a --user-data-dir passed in here (it doesnt look like this happens in the extra args). I think the value should be set to {Directories.Base}/cef

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Core Desktop Linux
Projects
None yet
Development

No branches or pull requests

5 participants