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

Error 403 for 7-day weather forecast #38

Closed
mf1x opened this issue May 18, 2023 · 23 comments
Closed

Error 403 for 7-day weather forecast #38

mf1x opened this issue May 18, 2023 · 23 comments

Comments

@mf1x
Copy link

mf1x commented May 18, 2023

Hi,

For a couple of weeks now I have been getting the following error message where the 7-day forecast should be:

"Cannot get 7 day weather forecast
Request failed with status code 403"

Has the weather provider changed something?

Edit: Same with the Docker version.

Regards
Max

@k5map
Copy link

k5map commented May 18, 2023

I'm experiencing the same problem but don't know when it started.

@ZeroCool-Dade
Copy link

ZeroCool-Dade commented May 20, 2023

I have the same issue, wondering if its related to the tomorrow.io free account only getting a 5 day forecast?

@mf1x
Copy link
Author

mf1x commented May 20, 2023

Could be. Have they changed that recently?

@k5map
Copy link

k5map commented May 21, 2023

I just logged into my Tomorrow.io account and it shows no calls for my account. Anyone know if the current weather is coming from Tomorrow or Mapbox?

The call stats was on the main page as well as this link: https://docs.tomorrow.io/reference/weather-forecast

@klamer
Copy link

klamer commented May 23, 2023

I'm so glad I'm not the only one. Been looking for this issue for at least a week or two. I'm making the API call into tomorrow.io but just getting the 24 hour.
tomorrow

@mf1x
Copy link
Author

mf1x commented May 24, 2023

Let's hope someone can help :D

@klamer
Copy link

klamer commented May 27, 2023

I messaged him on reddit, I'm hoping it's an easy fix... I'm no coder.

@jbeckley11
Copy link

Had this issue so I looked into it. This is because the free tier only lets you show 5 days into the future.
To fix this, go to client\src\AppContext.js on line 377: new Date().getTime() + 6 * 60 * 60 * 24 * 1000
Change the 6 to a 5, rebuild the project and it should work.

@k5map
Copy link

k5map commented Jun 4, 2023

@jbeckley11 ... can't thank you enough for figuring this out issue and coming up with the fix.

I'm not very experienced with JS... so to rebuild the project, do I run "npm install" from the app directory?

@jbeckley11
Copy link

@k5map To rebuild the project, navigate into the client folder and do npm run prod
Then go back to the app directory and do npm start

@k5map
Copy link

k5map commented Jun 4, 2023

@jbeckley11 ... thanks for the commands. When I run "npm run prod", I get this error:

pi@pi-Weather:~/pi-weather-station/client $ npm run prod

[email protected] prod
webpack -p --env.BUILD_PRODUCTION=1

sh: 1: webpack: not found
npm ERR! code 127
npm ERR! path /home/pi/pi-weather-station/client
npm ERR! command failed
npm ERR! command sh -c webpack -p --env.BUILD_PRODUCTION=1

npm ERR! A complete log of this run can be found in:
npm ERR! /home/pi/.npm/_logs/2023-06-04T11_48_42_756Z-debug.log

Any ideas what could be wrong?

@ZeroCool-Dade
Copy link

@k5map not sure if its the correct way to do it but this is how I got around the webpack error.. :
from the client folder run
sudo npm install
sudo npm run prod

@k5map
Copy link

k5map commented Jun 4, 2023

@ZeroCool-Dade ... that did it, Much Thanks!

@mf1x
Copy link
Author

mf1x commented Jun 5, 2023

Thanks for that :D

Has anyone tried that with the Docker container?

@elewin
Copy link
Owner

elewin commented Jun 5, 2023

#39
7 day forecast changed to 5 day forecast to meet new API requirements

@elewin elewin closed this as completed Jun 5, 2023
@k5map
Copy link

k5map commented Jun 5, 2023

@elewin... this is not a big deal but did you also update file client/src/components/weatherCharts/DailyCharts/index.js line 30 from 7 Day to 5 Day?

@elewin
Copy link
Owner

elewin commented Jun 5, 2023

@elewin... this is not a big deal but did you also update file client/src/components/weatherCharts/DailyCharts/index.js line 30 from 7 Day to 5 Day?

Yep!

da05477

@mf1x
Copy link
Author

mf1x commented Jun 6, 2023

@elewin Are you able to merge the fix with Sean Riggs's Docker fork?

Edit: Never mind, I updated the file in the container.

@klamer
Copy link

klamer commented Jun 9, 2023

Thanks all for their help in resolving this and @elewin for updating the code.

@mf1x
Copy link
Author

mf1x commented Jun 9, 2023

Yep. Thanks a lot guys :)

@duarch
Copy link

duarch commented Jun 20, 2023

What about docker image?
Captura de Tela 2023-06-19 às 21 46 44

@mf1x
Copy link
Author

mf1x commented Jun 20, 2023

Not sure. I haven't gotten any response regarding this topic. I guess you need to change it yourself for now.

Install nano inside the container and change it (it's Alpine Linux btw).

@seancasey0702
Copy link

Had this issue so I looked into it. This is because the free tier only lets you show 5 days into the future. To fix this, go to client\src\AppContext.js on line 377: new Date().getTime() + 6 * 60 * 60 * 24 * 1000 Change the 6 to a 5, rebuild the project and it should work.

I tried this and I'm still getting an error code 403 on the 5-day forecast. I restarted the server, tried rebuilding it, everything. Any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants