gethomepage / homepage

A highly customizable homepage (or startpage / application dashboard) with Docker and service API integrations.
https://gethomepage.dev
GNU General Public License v3.0
19.71k stars 1.18k forks source link

[Bug] OpenMeteo not working: Error in GET request #1821

Closed uncapped1599 closed 1 year ago

uncapped1599 commented 1 year ago

Description

Hi Ben, I am trying to get the OpenMeteo weather widget to work but it keeps showing "API Error"

When checking the web console, it appears the GET request from the OpenMeteo API is inserting the base URL of homepage, rather than openmeteo URL.

i.e. http://homepage.pc.local/api/widgets/openmeteo?latitude=25.0772&longitude=55.3093&index=5&label=Dubai&units=metric&cache=5&style=[object Object]

NOT https://api.open-meteo.com/v1/forecast?latitude=25.0772&longitude=55.3093&index=5&label=Dubai&units=metric&cache=5&style=[object Object]

BTW can also see it producing the same effect with /api/releases

Steps to reproduce

Add OpenMeteo to widgets.yaml Refresh homepage

homepage version

latest

Installation method

Docker

Configuration

- openmeteo:
    label: Dubai # optional
    latitude: 25.0772
    longitude: 55.3093
    units: metric # or imperial
    #timezone: Asia/Dubai # optional
    cache: 5 # Time in minutes to cache API responses, to stay within limits

Container Logs

17/08/2023 12:56:44
[2023-08-17T08:56:44.436Z] error: undefined
17/08/2023 12:56:47
[2023-08-17T08:56:47.258Z] error: undefined
17/08/2023 12:57:04
[2023-08-17T08:57:04.711Z] error: undefined
17/08/2023 12:57:07
[2023-08-17T08:57:07.592Z] error: undefined

Browser Logs

GET http://homepage.pc.local/api/widgets/openmeteo?latitude=25.0772&longitude=55.3093&index=5&label=Dubai&units=metric&cache=5&style=[object+Object] [HTTP/1.1 500 Internal Server Error 10939ms]

Troubleshooting

I have tested the API request to openmeteo with the right URL and it works fine. The container logs are not very useful but browser console helped me identify the issue. I have tried changing base URL of homepage to see if that had an effect but no dice.

Also disabled traefik to see if it was the reverse proxy. Still same thing.

Other

No response

Before submitting, I have made sure to

shamoon commented 1 year ago

I do not think there is a problem with this widget, the request is proxied through homepage, thats normal. Presumably your homepage container isn't able to reach the openmeteo servers, thats going to be something on your end. Below is your exact config

Screenshot 2023-08-17 at 6 51 40 AM Screenshot 2023-08-17 at 6 54 29 AM
github-actions[bot] commented 9 months ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new discussion or issue for related concerns.