firecat53 / networkmanager-dmenu

Control NetworkManager via dmenu
MIT License
783 stars 74 forks source link

Crash after connecting to new network #123

Closed lstefanello closed 10 months ago

lstefanello commented 1 year ago

Hi there,

I appreciate your work on this software, thank you. After I connected to a network and enter the password, I'm always given this error:

`(process:12548): GLib-GObject-CRITICAL **: 22:42:26.021: g_object_get_qdata: assertion 'G_IS_OBJECT (object)' failed

(process:12548): GLib-GObject-CRITICAL **: 22:42:26.021: g_object_set_qdata_full: assertion 'G_IS_OBJECT (object)' failed

(process:12548): GLib-GObject-CRITICAL **: 22:42:26.021: g_object_set_qdata_full: assertion 'G_IS_OBJECT (object)' failed

(process:12548): GLib-GObject-CRITICAL **: 22:42:26.021: g_object_unref: assertion 'G_IS_OBJECT (object)' failed`

firecat53 commented 1 year ago

As long it's functioning properly, that's a pretty normal GTK error and doesn't cause any issues. Other GTK apps will also sometimes emit those errors when run from the command line. Bind the script to a key and you'll never notice! :smiley: It's been reported several times if you look through the closed issues.

lstefanello commented 1 year ago

I'm sorry, I should have been more clear in my initial post: it doesn't connect to the wifi network at all. I do have it bound to a key; I was only running it through the terminal to see if I could find some pertinent error. It turned out to be irrelevant though. Any time I try to connect to a network it tells me the connection has failed. I did set up pinentry. Thanks for your help.

Edit: I should mention, I am able to enable/disable wifi from networkmanager_dmenu so it isn't a polkit permissions issue I believe.

firecat53 commented 12 months ago
  1. Make sure you can connect to the same network using nmtui.
  2. Try disabling pinentry and just use the regular password entry.

These should narrow down the issue. Thanks.

lstefanello commented 12 months ago

Indeed, I've been using nmtui since I can't get this to work (although I would love to use this), and it does connect to my network.

If I disable pinentry (getting rid of its line in gpg-agent.conf and setting it to none in networkmanager_dmenu's config.ini) then I am never prompted with password entry at all and the connection immediately fails. If I give the network a password inside the gui connection editor from nm-applet then networkmanager_dmenu will connect to the network if I tell it to. Thanks for your help. I'm using fuzzel, but I've also tried this using dmenu-wayland and bemenu and got the same results.

firecat53 commented 12 months ago
  1. What distro, window-manager, keyboard layout and how did you install networkmanager_dmenu?
  2. Does it work with other networks or fail only for this particular network? Are there any non-standard characters in the password or the network name?
  3. echo | fuzzel -d or echo | bemenu and type the password for that network. Make sure it prints out the password to the terminal exactly as you typed it.
  4. Delete network connection and try without pinentry
    • nmcli conn del <your network name>
    • Disable pinentry. Just comment out the pinentry = line in the config. Don't set it to None
    • Run networkmanager_dmenu from the command line and see if it generates any error messages other than the gtk errors.

Edit:

Also check pinentry output:

echo -e "setdesc test\nsetprompt test\ngetpin \n"|pinentry-gtk then type your password. Make sure it's exactly output as D xxxxxxxxxx

lstefanello commented 12 months ago
  1. Voidlinux; Swayfx; en_US.UTF-8; I cloned this repository, chmod +x 'd the script, symlink'd the script to /usr/local/bin, put a .desktop file in /usr/share/applications, and followed the instructions in the manual.
  2. It does not work with other networks, and there are no special characters in either the password or the network name. But as I said, networkmanager_dmenu will connect if the password is given to nm-connection-editor.
  3. Everything is as expected; no problems.
  4. Unfortunately, doing this outputs no errors to the terminal; the connection simply fails.
firecat53 commented 12 months ago

At this point I'd suspect a polkit permissions issue even though the enable/disable wifi works. I'm not familiar with Void at all, but double check all the polkit setup and see if you can figure out how to test it.

I just can't see any other potential issues given the info you've provided. If I get a chance I'll try to spin up a VM to replicate.

regern80 commented 11 months ago

I had an almost similar issue but in my case, the script worked flawlessly with dmenu but crashed with rofi when accessing saved connections or when trying to get connections to delete (when the main rofi menu is killed and another showing the saved connections is to be drawn). I fixed it by adding 1 second delay on the rofi command. sleep 1s && rofi -dmenu -theme ~/.config/openbox/rofi/gruvbox/networkmenu.rasi

firecat53 commented 10 months ago

Closing. Please reopen if you have additional information. Thanks!