Elinvention / gnome-shell-extension-nasa-apod

Change your wallpaper daily to the NASA's astronomy picture of the day
https://extensions.gnome.org/extension/1202/nasa-apod/
GNU General Public License v3.0
120 stars 23 forks source link

Extension has stopped downloading new wallpapers since December 5 #66

Closed Prodeguerriero closed 11 months ago

Prodeguerriero commented 11 months ago

Describe the bug

After refreshing, the extension doesn't seem to download the new wallpaper. To sort out the problem, I have uninstalled the extension and also removed the settings using dconf-editor.

To Reproduce

  1. Click on the extension icon
  2. Click "refresh"
  3. Notice how the description of the current photo changes to show today's photo
  4. The wallpaper doesn't change. Clicking on "Set wallpaper" turns the wallpaper black.
  5. Opening the wallpaper destination folder shows an empty folder (on a clean install, of course)

Expected behavior

Wallpaper to be downloaded and set automatically.

Screenshots

N/A

Operating system with version

Ubuntu 22.04.3 LTS

GNOME Shell version

42.9

Installation method

Extension Manager

Logs <- VERY IMPORTANT

Please paste below the relevant parts of journalctl -f -o cat /usr/bin/gnome-shell. If you don't use systemd, you have to find where the logs are stored and paste them here.

NASA APOD extension: xdg-open /home/gabe/.cache/apod/
NASA APOD extension: xdg-open /home/gabe/.cache/apod/
Window manager warning: Invalid WM_TRANSIENT_FOR window 0xe00008 specified for 0xe00006.
meta_window_set_stack_position_no_sync: assertion 'window->stack_position >= 0' failed
Received error from D-Bus search provider org.gnome.seahorse.Application.desktop during GetResultMetas: Gio.DBusError: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: Object does not exist at path “/org/gnome/seahorse/Application”
Wrong number of result metas returned by search provider org.gnome.seahorse.Application.desktop: expected 1 but got 0
Window manager warning: Attempt to perform window operation 1 on window W30 when operation 1 on W30 already in effect
NASA APOD extension: https://api.nasa.gov/planetary/apod?api_key=XKSoS8Bv05ij8JH8UWa7eqMavXgGfFStcc6Pu3KH
NASA APOD extension: 1996/2000 requests per hour remaining
NASA APOD extension: Downloading https://apod.nasa.gov/apod/image/2312/_12P_Pons_Brooks_2023_12_04_184135PST_DEBartlett.jpg to file:///home/gabe/.cache/apod/2023-12-08-Vega%20and%20Comet%2012P/Pons-Brooks.jpg
NASA APOD extension error: Error downloading image: Gio.IOErrorEnum: Error opening file “/home/gabe/.cache/apod/2023-12-08-Vega and Comet 12P/Pons-Brooks.jpg”: No such file or directory
JS ERROR: TypeError: text.replace is not a function
setBody@resource:///org/gnome/shell/ui/messageList.js:412:46
_init@resource:///org/gnome/shell/ui/messageList.js:383:14
_init@resource:///org/gnome/shell/ui/calendar.js:756:15
Message@resource:///org/gnome/shell/ui/messageList.js:306:4
NotificationMessage@resource:///org/gnome/shell/ui/calendar.js:754:1
_onNotificationAdded@resource:///org/gnome/shell/ui/calendar.js:845:23
pushNotification@resource:///org/gnome/shell/ui/messageTray.js:756:14
showNotification@resource:///org/gnome/shell/ui/messageTray.js:763:14
notifyError@/home/gabe/.local/share/gnome-shell/extensions/nasa_apod@elinvention.ovh/notifications.js:84:16
_refresh/makeRequest</<@/home/gabe/.local/share/gnome-shell/extensions/nasa_apod@elinvention.ovh/extension.js:395:43

Source ID 61474 was not found when attempting to remove it
NASA APOD extension: Next check @ local time 02:26
NASA APOD extension: Refresh done.
Attempting to run a JS callback during garbage collection. This is most likely caused by destroying a Clutter actor or GTK widget with ::destroy signal connected, or using the destroy(), dispose(), or remove() vfuncs. Because it would crash the application, it has been blocked.
== Stack trace for context 0x55c6021824b0 ==
The offending callback was set_container(), a vfunc.

Extension's settings

org.gnome.shell.extensions.nasa-apod api-keys ['XKSoS8Bv05ij8JH8UWa7eqMavXgGfFStcc6Pu3KH', 'jCUjMOBpL523SxLoi4PogFZ3YsvvFtVNyEvRd0IB']
org.gnome.shell.extensions.nasa-apod background-options 'scaled'
org.gnome.shell.extensions.nasa-apod download-folder ''
org.gnome.shell.extensions.nasa-apod hide false
org.gnome.shell.extensions.nasa-apod image-resolution 'hd'
org.gnome.shell.extensions.nasa-apod image-resolution-metered 'lowres'
org.gnome.shell.extensions.nasa-apod last-json "{\"copyright\":\"Dan Bartlett\",\"date\":\"2023-12-08\",\"explanation\":\"On December 4, periodic Comet 12P/Pons-Brooks shared this telescopic field of view with Vega, alpha star of the northern constellation Lyra. Fifth brightest star in planet Earth's night, Vega is some 25 light-years distant while the much fainter comet was about 21 light-minutes away. In recent months, outbursts have caused dramatic increases in brightness for Pons-Brooks though. Nicknamed the Devil Comet for its hornlike appearance, fans of interstellar spaceflight have also suggested the distorted shape of this comet's large coma looks like the Millenium Falcon. A Halley-type comet, 12P/Pons-Brooks last visited the inner Solar System in 1954. Its next perihelion passage or closest approach to the Sun will be April 21, 2024. That's just two weeks after the April 8 total solar eclipse path crosses North America. But, highly inclined to the Solar System's ecliptic plane, the orbit of periodic Comet 12P/Pons-Brooks will never cross the orbit of planet Earth.\",\"hdurl\":\"https://apod.nasa.gov/apod/image/2312/_12P_Pons_Brooks_2023_12_04_184135PST_DEBartlett.jpg\",\"media_type\":\"image\",\"service_version\":\"v1\",\"title\":\"Vega and Comet 12P/Pons-Brooks\",\"url\":\"https://apod.nasa.gov/apod/image/2312/_12P_Pons_Brooks_2023_12_04_184135PST_DEBartlett1024.jpg\"}\n"
org.gnome.shell.extensions.nasa-apod last-refresh uint64 1702063596506
org.gnome.shell.extensions.nasa-apod notify true
org.gnome.shell.extensions.nasa-apod pinned-background ''
org.gnome.shell.extensions.nasa-apod refresh-metered false
org.gnome.shell.extensions.nasa-apod set-background true
org.gnome.shell.extensions.nasa-apod transient true
Elinvention commented 11 months ago

I updated the extension for GNOME 42 with a fix for this issue (version 39).

Prodeguerriero commented 11 months ago

Thanks! Out of curiosity, what was the problem?

Elinvention commented 11 months ago

The problem was that the image contained the character / in the title, causing the extension to look for a non existing path on the file system. Replacing / with _ is a quick fix. Unfortunately I couldn't find functions to properly sanitize file names and avoid these issues, so I will fix them as they present themselves.