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

Running gnome-extensions list makes the playbook fail if empty #28

Open
LorenzoBettini opened this issue Feb 23, 2023 · 6 comments
Open

Comments

@LorenzoBettini
Copy link
Contributor

Unfortunately, this commit 9cc4673 for fixing #25 broke my playbooks:

TASK [petermosmans.customize-gnome : Create a list of current enabled extensions] ***
fatal: [instance]: FAILED! => {"changed": true, "cmd": "gnome-extensions list --enabled > /tmp/before.txt", "delta": "0:00:00.020725", "end": "2023-02-23 10:07:43.979387", "msg": "non-zero return code", "rc": 2, "start": "2023-02-23 10:07:43.958662", "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []}

I'm testing with with Molecule, and entering the container shows this:

[root@instance /]# gnome-extensions list
[root@instance /]# echo $?
2

So, you see that if the list of current extensions is empty, the command returns non zero code, making everything fail.

Maybe, it's enough to add a failed_when: false when running gnome-extensions list?

@PeterMosmans
Copy link
Owner

Hey @LorenzoBettini - Apologies for the regression there. That's a weird return code if the extension list is empty and yes, I think your solution is correct. Let me devise a fix...

@PeterMosmans
Copy link
Owner

Could you please check branch fix/28 to see whether that solves it? I haven't tested this locally

@LorenzoBettini
Copy link
Contributor Author

@PeterMosmans I've just tested, again with Molecule, and now there's another problem:

TASK [petermosmans.customize-gnome : Restart Gnome Shell to ensure all extensions are visible] ***
fatal: [instance-arch]: FAILED! => {"changed": true, "cmd": ["killall", "-3", "gnome-shell"], "delta": "0:00:00.005887", "end": "2023-02-23 14:26:04.915698", "msg": "non-zero return code", "rc": 1, "start": "2023-02-23 14:26:04.909811", "stderr": "gnome-shell: no process found", "stderr_lines": ["gnome-shell: no process found"], "stdout": "", "stdout_lines": []}

Again, I think that gnome-shell should not be assumed to be up and running (failed_when: false), e.g., when running tests with Molecule.

On a side note, does this mean that if I run it instead from a currently running GNOME, the session will be restarted? Isn't that too dangerous?

@mjbogusz
Copy link

mjbogusz commented Aug 18, 2023

I'm hitting the same issue.

After installing the fix/28 branch I'm getting through the first 3 steps (download, create directories, unzip) but then it fails on the "restart shell" with a slightly different message:

TASK [petermosmans.customize-gnome : Restart Gnome Shell to ensure all extensions are visible] *************************************************************
fatal: [192.168.122.183]: FAILED! => {"changed": true, "cmd": ["killall", "-3", "gnome-shell"], "delta": "0:00:00.045724", "end": "2023-08-18 11:45:20.342190", "msg": "non-zero return code", "rc": 1, "start": "2023-08-18 11:45:20.296466", "stderr": "gnome-shell(7197): Operation not permitted\ngnome-shell: no process found", "stderr_lines": ["gnome-shell(7197): Operation not permitted", "gnome-shell: no process found"], "stdout": "", "stdout_lines": []}

This might be due to the fact that I'm trying to install some extensions for a non-sudoer user - do you think that #30 would help with this?

My target is Debian 12 (Gnome 43).

Edit:
I've tried running this for a sudo-enabled user, restarting the shell worked but enabling extensions did not:

TASK [petermosmans.customize-gnome : Enable extensions] ****************************************************************************************************
failed: [192.168.122.183] (item=No overview at start-up) => {"ansible_loop_var": "item", "changed": false, "cmd": ["gnome-shell-extension-tool", "-e", "No","overview", "at", "start-up"], "delta": "0:00:00.023427", "end": "2023-08-18 12:00:50.172116", "failed_when_result": true, "item": {"enable": true, "id": 4099, "name": "No overview at start-up", "url": "https://extensions.gnome.org/download-extension/[email protected]?version_tag=39960"}, "msg": "non-zero return code", "rc": 1, "start": "2023-08-18 12:00:50.148689", "stderr": "", "stderr_lines": [], "stdout": "Usage: gnome-shell-extension-tool [options]", "stdout_lines": ["Usage: gnome-shell-extension-tool [options]"]}

This might be a separate issue though.

Edit2: the last bit indeed is a different issue - I've removed the "name" field from the gnome_extensions list as it contained spaces and now it works.

@PeterMosmans
Copy link
Owner

Thanks for reporting, and apologies for the bugs you're hitting. I'll try to look into this later next week

@mjbogusz
Copy link

No, thank you for the module ;) Even with the small problems it's quite helpful and I can see how many weird edge cases it already covers.

As I'm hitting some other weird behaviors (e.g. extensions being installed but not enabled) I'll try summarizing them in a separate issue(s) and/or creating PRs if I find fixes

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