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] Refresh fails with SyntaxError: JSON.parse: unexpected end of data #248

Closed
holzbrenner opened this issue Oct 10, 2024 · 7 comments
Closed
Labels

Comments

@holzbrenner
Copy link

Describe the bug
The extension is unable to download images anymore (I am guessing that parsing API response from the Bing site is the problem; perhaps something is not working reliably there).

Screenshots

To Reproduce
Steps to reproduce the behavior:

  1. Log into gnome shell.
  2. Click on the extension menu in the top bar.
  3. Click 'refresh now'.
  4. The image is not refreshed and an error notification is shown (see the screenshot above).

Desktop:

  • OS: Arch Linux (kernel 6.6.54-1-lts)
  • Extension Version: 50
  • GNOME Version: 47

Additional context
This started happening around 1-2 days ago (perhaps with the extension upgrade to version 50?), yesterday I resolved the problem by reloading the extension in the "gnome extensions" dialog (switching it off and then on again), but this does not seem to be working today. The destination directory has all necessary permissions (is user writable).

journal log:

gnome-shell[1423]: BingWallpaper extension: next check in 86400 seconds
gnome-shell[1423]: BingWallpaper extension: Recieved 0 bytes
gnome-shell[1423]: BingWallpaper extension: _parseData() failed with error SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data @ 802
gnome-shell[1423]: error: BingWallpaper extension error: Bing metadata parsing error check SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data @ 802
gnome-shell[1423]: BingWallpaper extension: _parseData@file:///home/_user_/.local/share/gnome-shell/extensions/[email protected]/extension.js:802:31
                  _processMessageRefresh@file:///home/_user_/.local/share/gnome-shell/extensions/[email protected]/extension.js:738:18
                  _refresh/<@file:///home/_user_/.local/share/gnome-shell/extensions/[email protected]/extension.js:704:26
                  @resource:///org/gnome/shell/ui/init.js:21:20
gnome-shell[1423]: BingWallpaper extension: /th?id=OHR.AspensColorado_ROW9309949443
gnome-shell[1423]: BingWallpaper extension: key selected-image set to AspensColorado_ROW9309949443 (returned true)
gnome-shell[1423]: BingWallpaper extension: scale factor: 1
gnome-shell[1423]: BingWallpaper extension: image set to : /home/_user_/Pictures/BingWallpaper/20241009-AspensColorado_ROW9309949443_UHD.jpg
gnome-shell[1423]: BingWallpaper extension: Storing state as JSON: {"maxlongdate":202410090700,"title":"Aspens near Marble, Colorado, USA","explanation":"Bing Wallpaper of the Day for 2024-10-09","copyright":"© Jason Hatfield/TANDEM Stills + Motion","longstartdate":"202410090700","imageinfolink":"https://www.bing.com/search?q=Aspen+tree&form=hpcapt","imageURL":"https://www.bing.com/th?id=OHR.AspensColorado_ROW9309949443_UHD.jpg&qlt=100","filename":"/home/_user_/Pictures/BingWallpaper/20241009-AspensColorado_ROW9309949443_UHD.jpg","favourite":false,"width":3840,"height":2160,"shuffledue":0}
gnome-shell[1423]: BingWallpaper extension: key state set to {"maxlongdate":202410090700,"title":"Aspens near Marble, Colorado, USA","explanation":"Bing Wallpaper of the Day for 2024-10-09","copyright":"© Jason Hatfield/TANDEM Stills + Motion","longstartdate":"202410090700","imageinfolink":"https://www.bing.com/search?q=Aspen+tree&form=hpcapt","imageURL":"https://www.bing.com/th?id=OHR.AspensColorado_ROW9309949443_UHD.jpg&qlt=100","filename":"/home/_user_/Pictures/BingWallpaper/20241009-AspensColorado_ROW9309949443_UHD.jpg","favourite":false,"width":3840,"height":2160,"shuffledue":0} (returned true)
@holzbrenner
Copy link
Author

I think there is some intermittent problem with Bing servers. I just clicked on "Refresh Now" and the image was replaced. Restarting the extension to resolve the problem was probably just a coincidence. I'll leave this open for now, perhaps there can be some improvement (retry mechanism?) based on this report, but otherwise this can be closed.

@neffo
Copy link
Owner

neffo commented Oct 11, 2024

Yeah the error notifications are new, these wouldn't have been apparent previously. Agree this shouldn't hassle users so much with non-fatal errors. (It should retry in 5 minutes.)

@holzbrenner
Copy link
Author

This hasn't happened anymore since I reported it last week, so I'll close this (can't reproduce; as I already wrote it looks like an intermittent server-side problem).

@proninyaroslav
Copy link

@neffo
Today I have been experiencing this problem all day. However, I use a similar app for Android and it updated the wallpaper without any problems.

gnome-shell[2595]: error: BingWallpaper extension error: Bing metadata parsing error check SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data @ 802
gjs[10789]: BingWallpaper extension: create carousel...
gnome-shell[2595]: BingWallpaper extension: scale factor: 1
gnome-shell[2595]: BingWallpaper extension: image set to : /home/yaroslav/Изображения/BingWallpaper/20241228-CoralTurtle_ROW9351762717_UHD.jpg
gnome-shell[2595]: BingWallpaper extension: scale factor: 1
gnome-shell[2595]: BingWallpaper extension: image set to : /home/yaroslav/Изображения/BingWallpaper/20241228-CoralTurtle_ROW9351762717_UHD.jpg
gnome-shell[12675]: BingWallpaper extension: next check in 86400 seconds
gnome-shell[12675]: BingWallpaper extension: Recieved 0 bytes
gnome-shell[12675]: BingWallpaper extension: _parseData() failed with error SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data @ 802
gnome-shell[12675]: error: BingWallpaper extension error: Bing metadata parsing error check SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data @ 802
gnome-shell[12675]: BingWallpaper extension: _parseData@file:///home/yaroslav/.local/share/gnome-shell/extensions/[email protected]/extension.js:802:31
                                                   _processMessageRefresh@file:///home/yaroslav/.local/share/gnome-shell/extensions/[email protected]/extension.js:738:18
                                                   _refresh/<@file:///home/yaroslav/.local/share/gnome-shell/extensions/[email protected]/extension.js:704:26
                                                   @resource:///org/gnome/shell/ui/init.js:21:20
gnome-shell[12675]: BingWallpaper extension: /th?id=OHR.CoralTurtle_ROW9351762717
gnome-shell[12675]: BingWallpaper extension: key selected-image set to CoralTurtle_ROW9351762717 (returned true)
gnome-shell[12675]: BingWallpaper extension: scale factor: 1
gnome-shell[12675]: BingWallpaper extension: image set to : /home/yaroslav/Изображения/BingWallpaper/20241228-CoralTurtle_ROW9351762717_UHD.jpg
gnome-shell[12675]: BingWallpaper extension: Storing state as JSON: {"maxlongdate":202412280800,"title":"A green sea turtle swims in the Pacific Ocean near the French overseas territ>
gnome-shell[12675]: BingWallpaper extension: key state set to {"maxlongdate":202412280800,"title":"A green sea turtle swims in the Pacific Ocean near the French overseas territory of>
gjs[14463]: BingWallpaper extension: create carousel...

@proninyaroslav
Copy link

It seems that the wallpaper API is simply blocked in my country, through VPN it works. Although I can still go to the Bing website and I see wallpapers there, apparently a different address is used there.

@neffo
Copy link
Owner

neffo commented Dec 30, 2024

Just to confirm, you are in Russia? There might be a redirect occurring that we aren't following.

So does opening the link to the API end point give any error messages? One option might be to select a different market in the settings (like English rest of world, etc).

@proninyaroslav
Copy link

@neffo
I described my observations here #257 (comment)

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