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

Bedtime crashes after re-login #35

Closed
helloandris opened this issue Nov 27, 2022 · 21 comments
Closed

Bedtime crashes after re-login #35

helloandris opened this issue Nov 27, 2022 · 21 comments
Assignees
Labels
bug Something isn't working

Comments

@helloandris
Copy link

helloandris commented Nov 27, 2022

Hello there,

Extension crashes after logout, when logging in to my user every time.
I use it in Ubuntu 20.04 & 22.04, and the issue is the same.
The icon of the extension disappers from top bar, and also not working at all.
Anyone else experience this issue? Maybe some workaround without a system restart to get it working?
It's for sure a must have extension!

Thanks a lot for looking into that!

OS: Ubuntu 22.04.1 LTS
Kernel: 5.15.0-53-generic
DE: GNOME 42.5
WM: Mutter

OS: Ubuntu 20.04.5 LTS x86_64
Kernel: 5.15.0-53-generic
GNOME Shell 3.36.9
WM: Mutter

In extensions manager it says:
entry.get_child is not a function
It cannot be re-activated, for me only system reboot helps.

bedtime metadata.json:

{ "_generated": "Generated by SweetTooth, do not edit", "description": "Hey Gnome, it's bedtime! Converts to grayscale the entire Gnome workspace by using a smooth transition. Best to use during evening/night.\n\nThis behaviour is similar to Android's bedtime mode which converts the phone screen to grayscale. It should somewhat make your device less appealing and limit the usage of it before bedtime. On my side, at least, it still requires a fair amount of self control in order to make that happen.\n\nThe extension has a nice Settings UI where you can customize it to your liking:\n- Set an automatic schedule for turning on/off the Bedtime Mode\n- Add an On Demand button to Top Bar or System Menu to manually toggle the mode\n- Control the On Demand button visibility, appearance and position in Top Bar\n- Choose another color preset and intensity, if you prefer a different color scheme\n- Change color intensity on the fly by scrolling over the On Demand button in Top Bar\n\nMulti language support is also available, please check the GitHub page if you want to help with the translations. So far, the extension is fully translated to Spanish, Dutch, German, Romanian and English.\n\nIf you want to use a keyboard shortcut in order to toggle the Bedtime Mode then you can use this command for the shortcut:\n\nbash -c 'schema_id=org.gnome.shell.extensions.bedtime-mode; schema_dir=~/.local/share/gnome-shell/extensions/gnomebedtime@ionutbortis.gmail.com/schemas/; if [[ $(gsettings --schemadir $schema_dir get $schema_id bedtime-mode-active) == \"true\" ]]; then turn_on=false; else turn_on=true; fi; gsettings --schemadir $schema_dir set $schema_id bedtime-mode-active $turn_on;'\n", "gettext-domain": "bedtime-mode", "name": "Bedtime Mode", "settings-schema": "org.gnome.shell.extensions.bedtime-mode", "shell-version": [ "3.36", "3.38", "40", "41", "42" ], "url": "https://github.com/ionutbortis/gnome-bedtime-mode", "uuid": "gnomebedtime@ionutbortis.gmail.com", "version": 10 }

@ionutbortis ionutbortis self-assigned this Nov 27, 2022
@ionutbortis
Copy link
Owner

ionutbortis commented Nov 27, 2022

Hello,

I'm daily driving and Ubuntu 20.04 with GNOME Shell 3.36.9 and I don't see any issue on my side.

I'm suspecting that on your side there is some interference with some other extensions...

Do you use some Gnome Extensions that removes or moves the System Menu from the right side in Top Bar?

@helloandris
Copy link
Author

Hi,

Thanks for the response!

I've got the following extensions activated:

Openweather
Places Status Indicator
Sound input & Output device chooser
User themes
Desktop Icons NG
Ubuntu AppIndicators
Ubuntu Dock

I use the default look of Ubuntu with a left side dock, and the top panel.
I might be playing with turning off some of the extensions later, it might help.

@ionutbortis
Copy link
Owner

Hmm,

It doesn't look like you have some extensions that fiddles with the System Menu, this is a weird one...

Just to be sure, you can try to disable some of them and see if that fixes the issue. I just installed all of them on my Ubuntu but Bedtime Mode works fine after log out and log in.

Also, please paste here the output of this command ran in a terminal:

dconf dump /org/gnome/shell/extensions/bedtime-mode/

@helloandris
Copy link
Author

helloandris commented Nov 27, 2022

Later I'll feedback on deactivating all other extension, and results.

Here you go with the output:

[/]
automatic-schedule=true
bedtime-mode-active=false
color-tone-factor=80
color-tone-preset='grayscale'
ondemand-button-bar-manual-position=false
ondemand-button-bar-position-value=1
ondemand-button-bar-scroll-enabled=true
ondemand-button-location='bar'

@ionutbortis
Copy link
Owner

Ok, please do the test when you have only Bedtime Mode enabled and all the other extensions disabled.

If you still experience the issue, you need to enable the Bedtime Mode extension logs by doing this in a terminal:

sed "s/debug = false/debug = true/" -i ~/.local/share/gnome-shell/extensions/gnomebedtime@ionutbortis.gmail.com/config.js

Log out and login in again and after you see the issue, open a terminal and run this:

journalctl -o cat GNOME_SHELL_EXTENSION_UUID=gnomebedtime@ionutbortis.gmail.com

Please copy the output of that command here.
Also, provide a screenshot after the login with the top bar, right side, click on the System Menu, so it is visible.

Thanks!

@helloandris
Copy link
Author

Look, now it seems Ubuntu appindicators extension was the culprit.
Its descriptions say something like: "legacy top icons in top panel"
To be honest I do not even know how I activated that one, or what did I use for, but now it looks bedtime extension works just fine.
I'll do some further testing later on.

Thank you for the great suggestions!

@ionutbortis
Copy link
Owner

ionutbortis commented Nov 27, 2022

That's weird. I also have the "Ubuntu AppIndicators" System Extension installed and I'm not able to reproduce the issue when I have it turned on...

It should't be any conflicts between Bedtime Mode and that extension.

Later edit: It seems that the https://extensions.gnome.org/extension/615/appindicator-support/ extension I recommended as an alternative to Ubuntu's App Indicatiors has some issues on Ubuntu 20.04.

@ionutbortis
Copy link
Owner

ionutbortis commented Nov 27, 2022

Update:

If you want to use https://extensions.gnome.org/extension/615/appindicator-support/ instead of problematic Ubuntu Appindicators you can install the other one and manually patch it so it can work properly.

This is just temporary until they release a new version having the fix.

After installation just run these commands in a terminal, log out and log in, and it should be working fine afterwards:

search="domain.replaceAll(' ', '-');"
replace="domain.replaceAll ? domain.replaceAll(' ', '-') : domain.split(' ').join('-');"

sed "s/$search/$replace/" -i ~/.local/share/gnome-shell/extensions/appindicatorsupport@rgcjonas.gmail.com/util.js

@helloandris
Copy link
Author

helloandris commented Nov 27, 2022

Did some further testing, and I do not have to log out from current session, just turning off and on bedtime, and the error message comes up. Appindicator was disabled, so it might be something else.

screen

@ionutbortis
Copy link
Owner

Please open a terminal and run this command:

journalctl -fo cat

This will output all the new system logs including the extension logs.

Go and enable/disable the Bedtime Mode extension and check if there are any errors when the Bedtime Mode logs appear. We should see something in the terminal that should resemble the error from Extension Manager.

@helloandris
Copy link
Author

helloandris commented Nov 27, 2022

This log is from opening extensions menu, turning off than turning on bedtime when the error happens:

[session uid=1000 pid=2065] Activating service name='org.gnome.ControlCenter.SearchProvider' requested by ':1.41' (uid=1000 pid=2306 comm="/usr/bin/gnome-shell " label="unconfined")
[session uid=1000 pid=2065] Activating service name='org.gnome.Calculator.SearchProvider' requested by ':1.41' (uid=1000 pid=2306 comm="/usr/bin/gnome-shell " label="unconfined")
[session uid=1000 pid=2065] Activating service name='org.gnome.Calendar' requested by ':1.41' (uid=1000 pid=2306 comm="/usr/bin/gnome-shell " label="unconfined")
[session uid=1000 pid=2065] Activating service name='org.gnome.Characters.BackgroundService' requested by ':1.41' (uid=1000 pid=2306 comm="/usr/bin/gnome-shell " label="unconfined")
[session uid=1000 pid=2065] Activating service name='org.gnome.seahorse.Application' requested by ':1.41' (uid=1000 pid=2306 comm="/usr/bin/gnome-shell " label="unconfined")
[session uid=1000 pid=2065] Activating via systemd: service name='org.gnome.Terminal' unit='gnome-terminal-server.service' requested by ':1.41' (uid=1000 pid=2306 comm="/usr/bin/gnome-shell " label="unconfined")
Created slice Slice /app/org.gnome.Terminal.
Starting GNOME Terminal Server...
[session uid=1000 pid=2065] Successfully activated service 'org.gnome.ControlCenter.SearchProvider'
[session uid=1000 pid=2065] Successfully activated service 'org.gnome.seahorse.Application'
[session uid=1000 pid=2065] Successfully activated service 'org.gnome.Terminal'
Started GNOME Terminal Server.
[system] Activating via systemd: service name='org.freedesktop.timedate1' unit='dbus-org.freedesktop.timedate1.service' requested by ':1.111' (uid=1000 pid=3630 comm="/usr/bin/gnome-calendar --gapplication-service " label="unconfined")
Starting Time & Date Service...
[session uid=1000 pid=2065] Successfully activated service 'org.gnome.Calculator.SearchProvider'
[system] Successfully activated service 'org.freedesktop.timedate1'
Started Time & Date Service.
[session uid=1000 pid=2065] Successfully activated service 'org.gnome.Calendar'
[session uid=1000 pid=2065] Successfully activated service 'org.gnome.Characters.BackgroundService'
Connecting to org.freedesktop.Tracker3.Miner.Files
Source ID 2737 was not found when attempting to remove it
Source ID 2754 was not found when attempting to remove it
[session uid=1000 pid=2065] Activating service name='org.gnome.Extensions' requested by ':1.41' (uid=1000 pid=2306 comm="/usr/bin/gnome-shell " label="unconfined")
[session uid=1000 pid=2065] Successfully activated service 'org.gnome.Extensions'
resolve transaction /4416_dcdccabc from uid 1000 finished with cancelled after 483ms
internal error: failed, but no error code: cancelled
[session uid=1000 pid=2065] Activating service name='org.gnome.Shell.Extensions' requested by ':1.115' (uid=1000 pid=3727 comm="/usr/bin/gjs /usr/share/gnome-shell/org.gnome.Exte" label="unconfined")
[session uid=1000 pid=2065] Successfully activated service 'org.gnome.Shell.Extensions'
Window manager warning: Buggy client sent a _NET_ACTIVE_WINDOW message with a timestamp of 0 for 0x4a00004
Window manager warning: Buggy client sent a _NET_ACTIVE_WINDOW message with a timestamp of 0 for 0x4a00004
resolve transaction /4417_dcdebaee from uid 1000 finished with success after 482ms
Started Application launched by gnome-session-binary.
JS ERROR: TypeError: menuInstance is null
_updateMenuVisibility@/home/andris/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/extension.js:210:51
enable/<@/home/andris/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/extension.js:180:45
_updateVisibility@resource:///org/gnome/shell/ui/status/volume.js:110:9
_maybeShowInput@resource:///org/gnome/shell/ui/status/volume.js:305:14
destroy@/home/andris/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/extension.js:125:21
disable@/home/andris/.local/share/gnome-shell/extensions/sound-output-device-chooser@kgshank.net/extension.js:278:38
_callExtensionDisable@resource:///org/gnome/shell/ui/extensionSystem.js:117:49
_onEnabledExtensionsChanged/<@resource:///org/gnome/shell/ui/extensionSystem.js:539:45
_onEnabledExtensionsChanged@resource:///org/gnome/shell/ui/extensionSystem.js:539:24
createCheckedMethod/<@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:533:46
disableExtension@resource:///org/gnome/shell/ui/extensionSystem.js:225:29
DisableExtension@resource:///org/gnome/shell/ui/shellDBus.js:452:38
_handleMethodCall@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:310:38
_wrapJSObject/<@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:387:34

[DEBUG] Bedtime Mode: Disabling extension...
[DEBUG] Bedtime Mode: Disabling Decorator...
[DEBUG] Bedtime Mode: Removing On-demand button...
[DEBUG] Bedtime Mode: Turning off Colorizer...
[DEBUG] Bedtime Mode: Disabling Scheduler...
[DEBUG] Bedtime Mode: Removing connections managed by SignalManager...
[DEBUG] Bedtime Mode: Extension disabled
[system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service' requested by ':1.84' (uid=1000 pid=2306 comm="/usr/bin/gnome-shell " label="unconfined")
Starting Hostname Service...
[system] Successfully activated service 'org.freedesktop.hostname1'
Started Hostname Service.
loading user theme: /usr/share/themes/Yaru-viridian-dark/gnome-shell/gnome-shell.css
[session uid=1000 pid=2065] Activating service name='org.gnome.ArchiveManager1' requested by ':1.118' (uid=1000 pid=3830 comm="gjs /usr/share/gnome-shell/extensions/ding@rasters" label="unconfined")
[session uid=1000 pid=2065] Successfully activated service 'org.gnome.ArchiveManager1'
DING: Detected async api for thumbnails
DING: GNOME nautilus 42.2
Window manager warning: Overwriting existing binding of keysym 33 with keysym 33 (keycode c).
Window manager warning: Overwriting existing binding of keysym 31 with keysym 31 (keycode a).
Window manager warning: Overwriting existing binding of keysym 32 with keysym 32 (keycode b).
Window manager warning: Overwriting existing binding of keysym 30 with keysym 2f7259c9 (keycode 31).
Window manager warning: Overwriting existing binding of keysym 34 with keysym 34 (keycode d).
Window manager warning: Overwriting existing binding of keysym 35 with keysym 35 (keycode e).
Window manager warning: Overwriting existing binding of keysym 36 with keysym 36 (keycode f).
Window manager warning: Overwriting existing binding of keysym 37 with keysym 37 (keycode 10).
Window manager warning: Overwriting existing binding of keysym 38 with keysym 38 (keycode 11).
Window manager warning: Overwriting existing binding of keysym 39 with keysym 39 (keycode 12).
Window manager warning: Overwriting existing binding of keysym 30 with keysym 2f7259c9 (keycode 31).
[DEBUG] Bedtime Mode: Cleaning up Colorizer related changes...
[DEBUG] Bedtime Mode: Destroying Transition Loop Source 11087
[DEBUG] Bedtime Mode: Enabling extension...
[DEBUG] Bedtime Mode: Creating connections for Settings...
[DEBUG] Bedtime Mode: Enabling Scheduler...
[DEBUG] Bedtime Mode: Creating connections for Scheduler...
[DEBUG] Bedtime Mode: Bedtime Mode Active changed to 'false'
[DEBUG] Bedtime Mode: Enabling Decorator...
[DEBUG] Bedtime Mode: Creating connections for Decorator...
[DEBUG] Bedtime Mode: Adding On-demand button to Top Bar...
JS ERROR: Extension gnomebedtime@ionutbortis.gmail.com: TypeError: entry.get_child is not a function
aggregateMenuFinder@/home/andris/.local/share/gnome-shell/extensions/gnomebedtime@ionutbortis.gmail.com/modules/Decorator.js:160:50
_getTopBarPosition@/home/andris/.local/share/gnome-shell/extensions/gnomebedtime@ionutbortis.gmail.com/modules/Decorator.js:161:67
_addButtonToBar@/home/andris/.local/share/gnome-shell/extensions/gnomebedtime@ionutbortis.gmail.com/modules/Decorator.js:99:77
_addButton@/home/andris/.local/share/gnome-shell/extensions/gnomebedtime@ionutbortis.gmail.com/modules/Decorator.js:49:14
enable@/home/andris/.local/share/gnome-shell/extensions/gnomebedtime@ionutbortis.gmail.com/modules/Decorator.js:23:10
enable@/home/andris/.local/share/gnome-shell/extensions/gnomebedtime@ionutbortis.gmail.com/extension.js:32:13
_callExtensionEnable@resource:///org/gnome/shell/ui/extensionSystem.js:183:32
_onEnabledExtensionsChanged/<@resource:///org/gnome/shell/ui/extensionSystem.js:532:35
_onEnabledExtensionsChanged@resource:///org/gnome/shell/ui/extensionSystem.js:532:14
createCheckedMethod/<@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:533:46
enableExtension@resource:///org/gnome/shell/ui/extensionSystem.js:210:29
EnableExtension@resource:///org/gnome/shell/ui/shellDBus.js:448:38
_handleMethodCall@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:310:38
_wrapJSObject/<@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:387:34

@ionutbortis
Copy link
Owner

ionutbortis commented Nov 27, 2022

Can you provide a screenshot of you desktop where you cliked the system menu in top bar, right side?

It's really weird what is happening on your system... It shouldn't behave that way 😅

@helloandris
Copy link
Author

I mean I just simply go into extensions app, then hitting the deactivate slide, than I'm unable to reactivate it.
The same thing happen after re-login into the desktop session, just easier to reproduce the error without logout.

screen2

@ionutbortis
Copy link
Owner

ionutbortis commented Nov 27, 2022

Not that, I want to see how your top bar and system menu looks like:

Screenshot from 2022-11-27 21-28-52

@helloandris
Copy link
Author

Here you go:
screen4

@ionutbortis
Copy link
Owner

ionutbortis commented Nov 27, 2022

Hmm, nothing wrong there.
This screenshot is from Ubuntu 22.04.1 LTS with GNOME 42.5, right?

Tomorrow I will install it in a VM and try to reproduce it also there.

@helloandris
Copy link
Author

helloandris commented Nov 27, 2022

Yeah exactly it is Ubuntu 22.04.1 LTS x86_64 & DE: GNOME 42.5
Thank you for looking into that, sometimes it is a bit annoying that I have t reboot to use my favorite extension, but still love it.

@ionutbortis ionutbortis added the bug Something isn't working label Nov 28, 2022
@ionutbortis ionutbortis added this to In progress in Gnome Bedtime Mode Nov 28, 2022
@ionutbortis
Copy link
Owner

ionutbortis commented Nov 28, 2022

I managed to reproduce the issue, the OpenWeather extension configured to be displayed on the right side is causing Bedtime Mode to crash.

There's also an issue that I need to address on the following days, my mechanism of finding the System Menu's position and adding the Bedtime Mode icon just before it, doesn't seem to work anymore on Gnome 42.

Gnome Shell is notorious for breaking their backwards compatibility in APIs, so with each new release, extensions code could not work properly anymore... 😞

I will create a new release for these fixes but in the meantime, you can fix your local Bedtime Mode installs by running these in a terminal:

sed "s/debug = true/debug = false/" -i ~/.local/share/gnome-shell/extensions/gnomebedtime@ionutbortis.gmail.com/config.js

The above will turn off logging since it's not needed anymore.

search="const aggregateMenuIndex = .*$"
replace="const aggregateMenuIndex = 0;"

sed "s/$search/$replace/" -i ~/.local/share/gnome-shell/extensions/gnomebedtime@ionutbortis.gmail.com/modules/Decorator.js

The above should make the code stable and avoid the conflicts with OpenWeather.

Please let me know if these are fixing your issues, thanks! 😃

@helloandris
Copy link
Author

Thanks for the feedback!

Yeah, after running your code it actually fixes the issue completely!
Support is just amazing, really appreciate your effort!

ionutbortis added a commit that referenced this issue Nov 28, 2022
This extra check ensures that the code will not break if on the
right box we find some other objects that don't have children.
@ionutbortis ionutbortis moved this from In progress to Done in Gnome Bedtime Mode Nov 29, 2022
@ionutbortis
Copy link
Owner

@helloandris

Thank you for submitting the issue and helping out in reproducing it!

A new package was submitted to the Gnome Extensions Website and an update should come soon 🎉

@helloandris
Copy link
Author

@ionutbortis
Awesome job, thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

No branches or pull requests

2 participants