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

[BUG] TypeError: image is null error on newly created user accounts #246

Open
pacho2 opened this issue Sep 24, 2024 · 8 comments
Open

[BUG] TypeError: image is null error on newly created user accounts #246

pacho2 opened this issue Sep 24, 2024 · 8 comments
Labels

Comments

@pacho2
Copy link

pacho2 commented Sep 24, 2024

Hello,

I am not sure why extension runs fine on my user account but it doesn't on newly created ones. Maybe some folder (or subfolder) is missing on the newly one, but I am unsure about which one :(

Desktop (please complete the following information):

  • OS: Gentoo
  • Extension Version: 49
  • GNOME Version: 45

The following errors are logged:

gnome-shell[1695]: Extension [email protected]: TypeError: image is null
                                             
                                             Stack trace:
                                               _selectImage@file:///usr/share/gnome-shell/extensions/[email protected]/extension.js:870:17
                                               _setImage@file:///usr/share/gnome-shell/extensions/[email protected]/extension.js:343:14
                                               _setConnections@file:///usr/share/gnome-shell/extensions/[email protected]/extension.js:256:14
                                               _init@file:///usr/share/gnome-shell/extensions/[email protected]/extension.js:205:14
                                               ButtonBox@resource:///org/gnome/shell/ui/panelMenu.js:13:1
                                               PanelMenuButton@resource:///org/gnome/shell/ui/panelMenu.js:99:4
                                               BingWallpaperIndicator@file:///usr/share/gnome-shell/extensions/[email protected]/extension.js:83:1
                                               enable@file:///usr/share/gnome-shell/extensions/[email protected]/extension.js:1099:34
                                               _callExtensionEnable@resource:///org/gnome/shell/ui/extensionSystem.js:253:38
                                               loadExtension@resource:///org/gnome/shell/ui/extensionSystem.js:461:32
                                               async*_loadExtensions@resource:///org/gnome/shell/ui/extensionSystem.js:759:24
                                               async*_enableAllExtensions@resource:///org/gnome/shell/ui/extensionSystem.js:765:48
                                               _sessionUpdated@resource:///org/gnome/shell/ui/extensionSystem.js:800:20
                                               async*init@resource:///org/gnome/shell/ui/extensionSystem.js:72:14
                                               _initializeUI@resource:///org/gnome/shell/ui/main.js:303:22
                                               start@resource:///org/gnome/shell/ui/main.js:176:11
                                               @resource:///org/gnome/shell/ui/init.js:12:47
                                               @resource:///org/gnome/shell/ui/init.js:21:20

Thanks for your help

@pacho2 pacho2 added the bug label Sep 24, 2024
@neffo
Copy link
Owner

neffo commented Sep 24, 2024

This is the default, can you if your Pictures or Desktop folders are writable?

let userPicturesDir = GLib.get_user_special_dir(GLib.UserDirectory.DIRECTORY_PICTURES);
let userDesktopDir = GLib.get_user_special_dir(GLib.UserDirectory.DIRECTORY_DESKTOP);
BingWallpaperDir = (userPicturesDir?userPicturesDir:userDesktopDir) + '/BingWallpaper/';

It's possible your Distro has read-only for one of those?

@neffo
Copy link
Owner

neffo commented Sep 24, 2024

Are you able to test the version 50 branch?

I've added error notifications:
image

@pacho2
Copy link
Author

pacho2 commented Sep 30, 2024

Sadly the notification is not shown because extension fails to start at login with:

Extension [email protected]: TypeError: image is null
                                              
                                              Stack trace:
                                                _selectImage@file:///usr/share/gnome-shell/extensions/[email protected]/extension.js:930:17
                                                _setImage@file:///usr/share/gnome-shell/extensions/[email protected]/extension.js:382:14
                                                _setConnections@file:///usr/share/gnome-shell/extensions/[email protected]/extension.js:267:14
                                                _init@file:///usr/share/gnome-shell/extensions/[email protected]/extension.js:211:14
                                                ButtonBox@resource:///org/gnome/shell/ui/panelMenu.js:13:1
                                                PanelMenuButton@resource:///org/gnome/shell/ui/panelMenu.js:99:4
                                                BingWallpaperIndicator@file:///usr/share/gnome-shell/extensions/[email protected]/extension.js:89:1
                                                enable@file:///usr/share/gnome-shell/extensions/[email protected]/extension.js:1164:34
                                                _callExtensionEnable@resource:///org/gnome/shell/ui/extensionSystem.js:253:38
                                                loadExtension@resource:///org/gnome/shell/ui/extensionSystem.js:461:32
                                                async*_loadExtensions@resource:///org/gnome/shell/ui/extensionSystem.js:759:24
                                                async*_enableAllExtensions@resource:///org/gnome/shell/ui/extensionSystem.js:765:48
                                                _sessionUpdated@resource:///org/gnome/shell/ui/extensionSystem.js:800:20
                                                async*init@resource:///org/gnome/shell/ui/extensionSystem.js:72:14
                                                _initializeUI@resource:///org/gnome/shell/ui/main.js:303:22
                                                start@resource:///org/gnome/shell/ui/main.js:176:11
                                                @resource:///org/gnome/shell/ui/init.js:12:47
                                                @resource:///org/gnome/shell/ui/init.js:21:20

I have full permissions on my ~/Pictures/ directory, but I don't know why it fails to create the subdir :/

@pacho2
Copy link
Author

pacho2 commented Sep 30, 2024

But even creating manually the dir, it keeps failing in the same way. I have tried to enable debug from the extension settings, but it is the same error:

Extension [email protected]: TypeError: image is null
                                              
                                              Stack trace:
                                                _selectImage@file:///usr/share/gnome-shell/extensions/[email protected]/extension.js:930:17
                                                _setImage@file:///usr/share/gnome-shell/extensions/[email protected]/extension.js:382:14
                                                _setConnections@file:///usr/share/gnome-shell/extensions/[email protected]/extension.js:267:14
                                                _init@file:///usr/share/gnome-shell/extensions/[email protected]/extension.js:211:14
                                                ButtonBox@resource:///org/gnome/shell/ui/panelMenu.js:13:1
                                                PanelMenuButton@resource:///org/gnome/shell/ui/panelMenu.js:99:4
                                                BingWallpaperIndicator@file:///usr/share/gnome-shell/extensions/[email protected]/extension.js:89:1
                                                enable@file:///usr/share/gnome-shell/extensions/[email protected]/extension.js:1164:34
                                                _callExtensionEnable@resource:///org/gnome/shell/ui/extensionSystem.js:253:38
                                                loadExtension@resource:///org/gnome/shell/ui/extensionSystem.js:461:32
                                                async*_loadExtensions@resource:///org/gnome/shell/ui/extensionSystem.js:759:24
                                                async*_enableAllExtensions@resource:///org/gnome/shell/ui/extensionSystem.js:765:48
                                                _sessionUpdated@resource:///org/gnome/shell/ui/extensionSystem.js:800:20
                                                async*init@resource:///org/gnome/shell/ui/extensionSystem.js:72:14
                                                _initializeUI@resource:///org/gnome/shell/ui/main.js:303:22
                                                start@resource:///org/gnome/shell/ui/main.js:176:11
                                                @resource:///org/gnome/shell/ui/init.js:12:47
                                                @resource:///org/gnome/shell/ui/init.js:21:20

@pacho2
Copy link
Author

pacho2 commented Sep 30, 2024

Maybe it is failing to download the image? But I cannot see anywhere in the logs where it is trying to fetch it from, and nothing is downloaded to the BingWallpaper folder

@neffo
Copy link
Owner

neffo commented Sep 30, 2024

This triggering an error in startup possibly. I don't understand how it's triggering an error there but can you comment out the log function call on row 930 in extension.js?

log('_selectImage: ' + this.selected_image + ' = ' + (image && image.urlbase) ? image.urlbase : 'not found');

@pacho2
Copy link
Author

pacho2 commented Oct 1, 2024

Nice, now it can start and the failure is:

 JS ERROR: TypeError: time.to_unix is not a function
                                              friendly_time_diff@file:///usr/share/gnome-shell/extensions/[email protected]/utils.js:396:24
                                              _openMenu@file:///usr/share/gnome-shell/extensions/[email protected]/extension.js:367:30
                                              @resource:///org/gnome/shell/ui/init.js:21:20
Oct 01 09:34:07 gec-pacho gjs[91944]: g_task_return_error: assertion '!task->ever_returned' failed

@martywesley
Copy link

I was getting the same "TypeError: image is null" error on my account. I commented out the log call on line 930 as you suggested and it started working for me. So not entirely the same problem as OP reported, but there's clearly a problem with that log line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants