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] Public Holiday Widget "Unable to fetch holiday data" #1268

Closed
5 tasks done
Salan54 opened this issue Jul 21, 2023 · 13 comments
Closed
5 tasks done

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

Salan54 opened this issue Jul 21, 2023 · 13 comments
Assignees
Labels
🐛 Bug [ISSUE] Ticket describing something that isn't working 🔨 Fixed 🛩️ Released 2.1.2

Comments

@Salan54
Copy link

Salan54 commented Jul 21, 2023

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 Salan54 added the 🐛 Bug [ISSUE] Ticket describing something that isn't working label Jul 21, 2023
@liss-bot
Copy link
Collaborator

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

@Pazdikan
Copy link

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.

@liss-bot liss-bot added the 👤 Awaiting Maintainer Response [ISSUE] Response from repo author is pending label Jul 24, 2023
@cauterize
Copy link

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.

@ViciousWall
Copy link

ViciousWall commented Jul 27, 2023

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

@liss-bot liss-bot removed the 👤 Awaiting Maintainer Response [ISSUE] Response from repo author is pending label Jul 27, 2023
@Salan54
Copy link
Author

Salan54 commented Aug 1, 2023

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.

@liss-bot liss-bot added the 👤 Awaiting Maintainer Response [ISSUE] Response from repo author is pending label Aug 1, 2023
@Polskovisk
Copy link

Polskovisk commented Aug 6, 2023

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

@liss-bot liss-bot removed the 👤 Awaiting Maintainer Response [ISSUE] Response from repo author is pending label Aug 7, 2023
@Salan54
Copy link
Author

Salan54 commented Aug 14, 2023

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"

@liss-bot liss-bot added the 👤 Awaiting Maintainer Response [ISSUE] Response from repo author is pending label Aug 14, 2023
@Polskovisk
Copy link

Polskovisk commented Aug 14, 2023

@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.

@liss-bot liss-bot removed the 👤 Awaiting Maintainer Response [ISSUE] Response from repo author is pending label Aug 15, 2023
@Salan54
Copy link
Author

Salan54 commented Aug 17, 2023

@Polskovisk

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

@liss-bot liss-bot added the 👤 Awaiting Maintainer Response [ISSUE] Response from repo author is pending label Aug 17, 2023
@Wuff-Bellmann
Copy link

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.

@liss-bot liss-bot removed the 👤 Awaiting Maintainer Response [ISSUE] Response from repo author is pending label Aug 18, 2023
@t3dium
Copy link

t3dium commented Oct 31, 2023

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.

@liss-bot liss-bot added the 👤 Awaiting Maintainer Response [ISSUE] Response from repo author is pending label Oct 31, 2023
@github-project-automation github-project-automation bot moved this to Todo in Dashy V3 Oct 31, 2023
@liss-bot liss-bot removed the 👤 Awaiting Maintainer Response [ISSUE] Response from repo author is pending label Nov 1, 2023
@EliasGagnef
Copy link

Thanks, lang: en worked for me :)

@liss-bot liss-bot added the 👤 Awaiting Maintainer Response [ISSUE] Response from repo author is pending label Dec 2, 2023
@github-project-automation github-project-automation bot moved this from Awaiting Triage to Done in Dashy V3 Feb 11, 2024
@liss-bot liss-bot removed the 👤 Awaiting Maintainer Response [ISSUE] Response from repo author is pending label Feb 11, 2024
@liss-bot
Copy link
Collaborator

liss-bot commented Mar 3, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug [ISSUE] Ticket describing something that isn't working 🔨 Fixed 🛩️ Released 2.1.2
Projects
Status: Done
Development

No branches or pull requests

10 participants