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

thread 'main' panicked at src/config.rs:126:14: download_dir() #175

Closed
EvVlF opened this issue Aug 10, 2024 · 16 comments
Closed

thread 'main' panicked at src/config.rs:126:14: download_dir() #175

EvVlF opened this issue Aug 10, 2024 · 16 comments

Comments

@EvVlF
Copy link

EvVlF commented Aug 10, 2024

Hello. It's just local (only on my system) or global (somewhere in code) problem?
vanilla archlinux x86_64, no chrome in system))

$ rqbit server start /home/koshon/Home3/Downloads
2024-08-10T12:25:10.437397Z INFO rqbit: inreased open file limit limit=524288
2024-08-10T12:25:10.437443Z INFO librqbit::session: Listening on 0.0.0.0:4240 for incoming peer connections
2024-08-10T12:25:10.437458Z INFO librqbit_dht::persistence: will store DHT routing table periodically filename="/home/koshon/.cache/dht/dht.json"
2024-08-10T12:25:10.437542Z INFO librqbit_dht::persistence: loaded DHT routing table from filename="/home/koshon/.cache/dht/dht.json"
2024-08-10T12:25:10.437561Z INFO librqbit_dht::dht: DHT listening on 0.0.0.0:39014
2024-08-10T12:25:10.437567Z INFO librqbit_dht::dht: starting up DHT with peer id 2d7251303030312dd0d34a79b36b09e8f20b72af
2024-08-10T12:25:10.437653Z INFO librqbit::session: will use "/home/koshon/.local/share/session/session.json" for session persistence
2024-08-10T12:25:10.437808Z INFO librqbit::http_api: starting HTTP server addr=127.0.0.1:3030


$ RUST_BACKTRACE=full rqbit-desktop
2024-08-10T12:25:13.110933Z INFO rqbit_desktop: inreased open file limit limit=524288

** (rqbit-desktop:108176): WARNING **: 16:25:13.219: webkit_settings_set_enable_offline_web_application_cache is deprecated and does nothing.
src/nv_gbm.c:300: GBM-DRV error (nv_gbm_create_device_native): nv_common_gbm_create_device failed (ret=-1)

thread 'main' panicked at src/config.rs:126:14:
download_dir()
stack backtrace:
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Access denied
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Access denied
Failed to create GBM buffer of size 1024x600: Access denied
0: 0x61c62c306f25 -
1: 0x61c62c33425b -
2: 0x61c62c30326f -
3: 0x61c62c306cfe -
4: 0x61c62c308249 -
5: 0x61c62c307fea -
6: 0x61c62c3086e3 -
7: 0x61c62c3085c4 -
8: 0x61c62c3073e9 -
9: 0x61c62c3082f7 -
10: 0x61c62badb703 -
11: 0x61c62badb6cb -
12: 0x61c62bbb3fba -
13: 0x61c62baf4db5 -
14: 0x61c62bbcac91 -
15: 0x61c62bb2b5dd -
16: 0x61c62bb22be0 -
17: 0x61c62bc9e738 -
18: 0x7a9a3c9b264a - g_closure_invoke
19: 0x7a9a3c9e2ce5 -
20: 0x7a9a3c9d35dc -
21: 0x7a9a3c9d3842 - g_signal_emit_valist
22: 0x7a9a3c9d3904 - g_signal_emit
23: 0x7a9a39bec843 -
24: 0x7a9a3976aec6 -
25: 0x7a9a3976b59f -
26: 0x7a9a39a9916b -
27: 0x7a9a39b38ff3 -
28: 0x7a9a39a8dc88 -
29: 0x7a9a39a9200d -
30: 0x7a9a3e8efc9b -
31: 0x7a9a3e8efd80 -
32: 0x7a9a3ea81ab9 -
33: 0x7a9a3eae39e7 -
34: 0x7a9a3ea80fc5 - g_main_context_iteration
35: 0x7a9a3f1e3a3f - gtk_main_iteration_do
36: 0x61c62bce05bf -
37: 0x61c62bb50a30 -
38: 0x61c62bb342ff -
39: 0x61c62bb4a572 -
40: 0x61c62baecdf4 -
41: 0x61c62bb25a19 -
42: 0x61c62bb226f4 -
43: 0x61c62bbe6553 -
44: 0x61c62bb22874 -
45: 0x61c62bb7c380 -
46: 0x61c62bbe7c86 -
47: 0x61c62bb8627c -
48: 0x61c62c2fbb0d -
49: 0x61c62bb7c934 -
50: 0x7a9a37f45e08 -
51: 0x7a9a37f45ecc - __libc_start_main
52: 0x61c62badc0d5 -
53: 0x0 -

@ikatson
Copy link
Owner

ikatson commented Aug 10, 2024

Hmm, can you try setting environment variables "XDG_DATA_HOME" and "XDG_CACHE_HOME" and "XDG_CONFIG_HOME" to something and see if it works?

we need to modify the code to more gracefully handle the case when user directories can't be determined automatically in desktop app.

@EvVlF
Copy link
Author

EvVlF commented Aug 10, 2024

# ~/.bashrc -->
export XDG_DATA_HOME="/home/koshon/Home3/Downloads/rqbit/share"
export XDG_CACHE_HOME="/home/koshon/Home3/Downloads/rqbit/.cache"
export XDG_CONFIG_HOME="/home/koshon/Home3/Downloads/rqbit/.config"


source ~/.bashrc

$ printenv shows that the variables have been set but.. same error

@ikatson
Copy link
Owner

ikatson commented Aug 12, 2024

Can you try setting XDG_DOWNLOAD_DIR?

ikatson added a commit that referenced this issue Aug 12, 2024
ikatson added a commit that referenced this issue Aug 12, 2024
@ikatson
Copy link
Owner

ikatson commented Aug 12, 2024

Also please try the fix attached (merged into main already)

@EvVlF
Copy link
Author

EvVlF commented Aug 13, 2024

I've tried all the options, but it's still the same. And with the user logged out.
If I don't manually set the XDG options -
echo $XDG_DATA_HOME
echo $XDG_CACHE_HOME
echo $XDG_CONFIG_HOME
echo $XDG_DOWNLOAD_DIR
I get an empty string.
Maybe I should have additionally mentioned that I'm using openbox and not full DE? Hmm... Because I don't remember ever specifying default values or I just forgot already. Maybe I'm doing something else wrong, but I don't remember encountering anything like this.

@ikatson
Copy link
Owner

ikatson commented Aug 13, 2024

Did you try compiling with the workaround above?

Also, to ensure you're setting the values correctly, it's not enough to set these values in .bashrc usually for your DE to pick it up.

To test this, set it in .bashrc like you did above AND launch rqbit-desktop binary from the same terminal you set the variables in.

@EvVlF
Copy link
Author

EvVlF commented Aug 13, 2024

same)

@ikatson
Copy link
Owner

ikatson commented Aug 13, 2024

Is it the same exact stacktrace saying "download_dir()" or another one maybe?

@ikatson
Copy link
Owner

ikatson commented Aug 13, 2024

For context, we are using external crate dirs, so the error is coming somewhere from it, and I didn't look deep into how exactly it works, just at its docs. The docs reference XDG_* variables, specifically XDG_DOWNLOAD_DIR for the download_dir() which is failing.

But I also put a workaround for download_dir() so that it never fails, so it's weird if it's the same stacktrace

@EvVlF
Copy link
Author

EvVlF commented Aug 14, 2024

Is it the same exact stacktrace saying "download_dir()" or another one maybe?

I didn't compare bitwise) but on a line with

** (rqbit-desktop:14100): WARNING **: 20:03:10.415: webkit_settings_set_enable_offline_web_application_cache is deprecated and does nothing.
src/nv_gbm.c:300: GBM-DRV error (nv_gbm_create_device_native): nv_common_gbm_create_device failed (ret=-1)

thread 'main' panicked at src/config.rs:126:14:
download_dir()

looks like the same thing except (rqbit-desktop:108176) (rqbit-desktop:14100)

full output

[koshon@Koshon ~]$ RUST_BACKTRACE=full rqbit-desktop
2024-08-14T16:03:10.275888Z INFO rqbit_desktop: inreased open file limit limit=524288

** (rqbit-desktop:14100): WARNING **: 20:03:10.415: webkit_settings_set_enable_offline_web_application_cache is deprecated and does nothing.
src/nv_gbm.c:300: GBM-DRV error (nv_gbm_create_device_native): nv_common_gbm_create_device failed (ret=-1)

thread 'main' panicked at src/config.rs:126:14:
download_dir()
stack backtrace:
0: 0x630fe81dff25 -
1: 0x630fe820d25b -
2: 0x630fe81dc26f -
3: 0x630fe81dfcfe -
4: 0x630fe81e1249 -
5: 0x630fe81e0fea -
6: 0x630fe81e16e3 -
7: 0x630fe81e15c4 -
8: 0x630fe81e03e9 -
9: 0x630fe81e12f7 -
10: 0x630fe79b4703 -
11: 0x630fe79b46cb -
12: 0x630fe7a8cfba -
13: 0x630fe79cddb5 -
14: 0x630fe7aa3c91 -
15: 0x630fe7a045dd -
16: 0x630fe79fbbe0 -
17: 0x630fe7b77738 -
18: 0x7f3ecaa6464a - g_closure_invoke
19: 0x7f3ecaa94ce5 -
20: 0x7f3ecaa855dc -
21: 0x7f3ecaa85842 - g_signal_emit_valist
22: 0x7f3ecaa85904 - g_signal_emit
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Access denied
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Access denied
Failed to create GBM buffer of size 1024x600: Access denied
23: 0x7f3ec7bec843 -
24: 0x7f3ec776aec6 -
25: 0x7f3ec776b59f -
26: 0x7f3ec7a9916b -
27: 0x7f3ec7b38ff3 -
28: 0x7f3ec7a8dc88 -
29: 0x7f3ec7a9200d -
30: 0x7f3eccaefc9b -
31: 0x7f3eccaefd80 -
32: 0x7f3ecab0eab9 -
33: 0x7f3ecab709e7 -
34: 0x7f3ecab0dfc5 - g_main_context_iteration
35: 0x7f3ecd1e3a3f - gtk_main_iteration_do
36: 0x630fe7bb95bf -
37: 0x630fe7a29a30 -
38: 0x630fe7a0d2ff -
39: 0x630fe7a23572 -
40: 0x630fe79c5df4 -
41: 0x630fe79fea19 -
42: 0x630fe79fb6f4 -
43: 0x630fe7abf553 -
44: 0x630fe79fb874 -
45: 0x630fe7a55380 -
46: 0x630fe7ac0c86 -
47: 0x630fe7a5f27c -
48: 0x630fe81d4b0d -
49: 0x630fe7a55934 -
50: 0x7f3ec6034e08 -
51: 0x7f3ec6034ecc - __libc_start_main
52: 0x630fe79b50d5 -
53: 0x0 -


[koshon@Koshon ~]$ echo $XDG_CONFIG_HOME
~/.config
[koshon@Koshon ~]$ echo $XDG_CACHE_HOME
~/.cache
[koshon@Koshon ~]$ echo $XDG_CONFIG_HOME
~/.config
[koshon@Koshon ~]$ echo $XDG_DOWNLOAD_DIR
~/Downloads


[koshon@Koshon ~]$ rqbit server start /home/koshon/Home3/Downloads/rqbit
2024-08-14T16:01:25.821560Z INFO rqbit: inreased open file limit limit=524288
2024-08-14T16:01:25.824954Z INFO librqbit::session: Listening on 0.0.0.0:4240 for incoming peer connections
2024-08-14T16:01:25.825475Z INFO librqbit_dht::persistence: will store DHT routing table periodically filename="/home/koshon/.cache/dht/dht.json"
2024-08-14T16:01:25.827745Z INFO librqbit_dht::persistence: loaded DHT routing table from filename="/home/koshon/.cache/dht/dht.json"
2024-08-14T16:01:25.827766Z INFO librqbit_dht::dht: DHT listening on 0.0.0.0:39014
2024-08-14T16:01:25.827771Z INFO librqbit_dht::dht: starting up DHT with peer id 2d7251303030312dd0d34a79b36b09e8f20b72af
2024-08-14T16:01:25.827804Z INFO librqbit::session: will use "/home/koshon/.local/share/session/session.json" for session persistence
2024-08-14T16:01:25.828754Z INFO librqbit::http_api: starting HTTP server addr=127.0.0.1:3030

@EvVlF
Copy link
Author

EvVlF commented Aug 15, 2024

To test this, set it in .bashrc like you did above AND launch rqbit-desktop binary from the same terminal you set the variables in.

with the condition above, of course.

@ikatson
Copy link
Owner

ikatson commented Aug 15, 2024

@EvVlF and just to double-check, you've compiled rqbit-desktop yourself from main?

@ikatson
Copy link
Owner

ikatson commented Aug 15, 2024

Btw in the example above you didn't set XDG_DOWNLOAD_DIR, try it out:

# ~/.bashrc -->
export XDG_DATA_HOME="/home/koshon/Home3/Downloads/rqbit/share"
export XDG_CACHE_HOME="/home/koshon/Home3/Downloads/rqbit/.cache"
export XDG_CONFIG_HOME="/home/koshon/Home3/Downloads/rqbit/.config"
export XDG_DOWNLOAD_DIR="/home/koshon/Home3/Downloads"

source ~/.bashrc

@ikatson
Copy link
Owner

ikatson commented Aug 15, 2024

@EvVlF and just to double-check, you've compiled rqbit-desktop yourself from main?

I'm pretty sure that's not the case as I removed this line entirely recently:

thread 'main' panicked at src/config.rs:126:14:
download_dir()

@EvVlF
Copy link
Author

EvVlF commented Sep 5, 2024

Hello there ☺
local/rqbit 7.0.1-1
A bittorrent client in Rust
local/rqbit-desktop 7.0.1-1
A bittorrent client in Rust (desktop app)

[koshon@Koshon ~]$ rqbit-desktop
2024-09-05T15:58:16.342319Z INFO rqbit_desktop: inreased open file limit limit=524288

** (rqbit-desktop:7455): WARNING **: 19:58:16.456: webkit_settings_set_enable_offline_web_application_cache is deprecated and does nothing.
src/nv_gbm.c:300: GBM-DRV error (nv_gbm_create_device_native): nv_common_gbm_create_device failed (ret=-1)

KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Access denied
KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Access denied
Failed to create GBM buffer of size 1024x600: Access denied

but now i can see blank window)
https://ibb.co/ZxjY1Dc

@ikatson
Copy link
Owner

ikatson commented Sep 13, 2024

Failed to create GBM buffer of size 1024x600: Access denied this is probably the reason? some permission issue on your particular system.

I just tried on arch VM:
pacman -S rqbit-desktop weston

from console: weston. Then run rqbit-desktop and it works just fine. But I don't have NVIDIA in VM obviously.

Try running with "WEBKIT_DISABLE_DMABUF_RENDERER=1", first google suggest this is a workaround for running webkit on nvidia.

Otherwise, closing as it's smth in your system you need to tweak, there's nothing in rqbit-desktop that we can do.

@ikatson ikatson closed this as completed Sep 13, 2024
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

2 participants