dashy icon indicating copy to clipboard operation
dashy copied to clipboard

[BUG] Public Holiday Widget "Unable to fetch holiday data"

Open Salan54 opened this issue 2 years ago • 12 comments
trafficstars

Environment

Self-Hosted (Docker)

System

Docker version 24.0.4, build 3713ee1

Version

2.1.1

Describe the problem

Was working till a few weeks ago. But now, the public holiday widget failed with :

An error occurred, see the logs for more info. Unable to fetch holiday data Retry

I tried to change the country from FR to US, but to no avail.

I have the Cryptocurrencies widget in my config, and this one works perfectly...

Thanks for your help.

Additional info

No response

Please tick the boxes

Salan54 avatar Jul 21 '23 12:07 Salan54

If you're enjoying Dashy, consider dropping us a ⭐
🤖 I'm a bot, and this message was automated

liss-bot avatar Jul 21 '23 12:07 liss-bot

Hi @Salan54, is the issue still persisting? If so, could you please provide the configuration details of your widget? I have tried to reproduce the issue on both the GB and PL region, but it seems to be working fine for me.

Pazdikan avatar Jul 24 '23 15:07 Pazdikan

Not the author, but pretty much same problem.

Config:

pageInfo:
  ...
appConfig:
  ...
sections:
  - name: Today
    icon: far fa-cloud-sun
    displayData:
      collapsed: false
      hideForGuests: false
    widgets:
      - type: clock
        options:
          timeZone: Europe/Berlin
          format: de-DE
        id: 0_513_clock
      - type: weather
        options:
          apiKey: efdbade728b37086877a5e83442004db
          city: Berlin
        id: 1_513_weather
      - type: public-holidays
        options:
          country: DE
          holidayType: all
          monthsToShow: 6
          state: SH
        id: 2_513_publicholidays

This results in the following query to the Api: https://kayaposoft.com/enrico/json/v2.0/?action=getHolidaysForDateRange&fromDate=26-7-2023&toDate=26-1-2024&country=DE&holidayType=all&region=SH

It returns 200 just fine... but the UI still states An error occurred, see the logs for more info. Unable to fetch holiday data. This is likely not an issue with Dashy, but rather your configuration. If you think it is a bug, please open a ticket on GitHub

This config worked for months and I can't find whats wrong. And yes I checked the docs.

cauterize avatar Jul 26 '23 13:07 cauterize

Update: An update that this is now working for me. Not sure what the issue was when I reloaded the config the next day it started working.

I am also having the same issue with my widget. Below is my widget config

  - type: public-holidays
    options:
      country: NZ
      holidayType: all
      monthsToShow: 12
      state: CAN

ViciousWall avatar Jul 27 '23 00:07 ViciousWall

Sorry for the delay. Thanks guys for your answers so far. Yes, the problem persists. My config is very straightforward :

- type:  public-holidays
  label: "Jours fériés"
  options:
  country: "US"
  holidayType: "all"
  monthsToShow: 3

Initially, country was FR, I switched to US to see if that changes something but to no avail. I'm using Dashy V-2.1.1 in a docker container. Thanks for your help.

Salan54 avatar Aug 01 '23 08:08 Salan54

I was having this problem, after looking what is causing I inserted a new option "lang" and this fixed for me.

The widget goes through all days, check if it has the lang of user, but "this.option.lang" return undefined and crashes the widget. Inserting an option with your lang or the lang that return in the request solve this error.

More info:

The line that has the error is line 96. name: holiday.name.filter(p => p.lang == this.options.lang)[0].text || holiday.name[0].text

this.options.lang)[0].text is missing the ? this.options.lang)[0]?.text

Polskovisk avatar Aug 06 '23 22:08 Polskovisk

Thanks @Polskovisk

I modified the line with the missing ? as you stated and added a 'lang' option in my config but I still have the same error : "Unable to fetch holiday data".

My config :

"type": "public-holidays"
"label": "Jours fériés"
"options":
    "country": "FR"
    "holidayType": "all"
    "monthsToShow": 3
    "lang": "FR"

Salan54 avatar Aug 14 '23 10:08 Salan54

@Salan54

Try to put lang in lowercase and see if this fix. If you fixed the code that I talked about earlier, you can remove lang entirely

If not, then i gonna need more information, maybe your web console can show more details of the error.

Polskovisk avatar Aug 14 '23 23:08 Polskovisk

@Polskovisk

Bingo !!! I changed "lang" (and "country") to lowercase : "fr" and it works. Thanks a lot for your help.

Salan54 avatar Aug 17 '23 08:08 Salan54

Thanks, i had the same issue and could fix it.

I used the restrict a country to a specific state string. The string was when I set up dashy "region". Now it seems to be "state". Changing that and put everything in lower case fixed it for me.

The docs still show under example "region" instead of "state" when I get it right.

Wuff-Bellmann avatar Aug 17 '23 09:08 Wuff-Bellmann

i managed to fix this issue by just removing the state line entirely, nothing i put in there managed to work lowercase or uppercase. "lnd" was what i tried which was in the docs.

     - type: public-holidays
        options:
          country: gb
          holidayType: all
          monthsToShow: 4
          lang: en

Is working, in case anyone wants an example.

t3dium avatar Oct 31 '23 10:10 t3dium

Thanks, lang: en worked for me :)

Gagnefs avatar Dec 02 '23 02:12 Gagnefs

The fix for this issue has now been released in 2.1.2 ✨

If you haven't done so already, please update your instance to 2.1.2 or later. See 2.1.2 for full info.

Feel free to reach out if you need any more support. If you are enjoying Dashy, consider supporting the project.

liss-bot avatar Mar 03 '24 15:03 liss-bot