netbymatt / ws4kp

WeatherStar 4000+
https://weatherstar.netbymatt.com
MIT License
263 stars 44 forks source link

The "go" button doesnt do anything/Stuck on "enter location" screen #34

Closed August988 closed 4 months ago

August988 commented 9 months ago

Hello, whenever I enter my location (Dayton Ohio) the "go" button doesnt do anything, its just stuck on the enter location screen, i'm on MacOS 10.14 and ive tried Chrome, Chromium, and Safari. I've also tried to localhost it but it still is stuck.

netbymatt commented 9 months ago

This is an unfortunate issue with the upstream data from the national weather service. I checked "Dayton Ohio" myself as well as my location and it gets about 3 steps into getting forecast data and dies when it requests the "gridpoints" api: https://api.weather.gov/gridpoints/ILN/44,69/stations If you go to that page there's you'll get a message stating it is offline until 1/1/2024.

There's an ongoing discussion about why this happened and the overall reliability of the NWS API on their github repo https://github.com/weather-gov/api/discussions/688

I do acknowledge that Weatherstar doesn't do a good job of annunciating errors that are this early in the process. The "gridpoints" api is kind of the lynchpin to getting all of the other data provided. Had something more specific such as radar, hourly forecast or current conditions failed it's handled much more gracefully and will show an error on the table of contents screen and skip that display when cycling through all the displays.

netbymatt commented 9 months ago

Great! I'm seeing it work now too.

August988 commented 9 months ago

thanks!

yllekz commented 5 months ago

This is still happening for me. Update: got it working in Chromium but it's still broken in Firefox. Might be a browser compatibility issue....

yllekz commented 5 months ago

Interesting, I can't get it to work in Firefox or Librewolf, oddly enough (even with new profiles). I'll keep plunking away at it to see what makes it not function.

netbymatt commented 5 months ago

Hi guys. This is still an ongoing, intermittent problem with api.weather.gov. I'm fighting with it at my other weather app as well Temperature.Express.

One thing that would be very helpful in confirming this and helping me to get started on visualizing the proper error messages is to note any errors in the Network tab of Dev Tools in any browser. Any request to api.weather.gov that's red, pass along the requested URL and the status code, all available from the Network tab.

Node815 commented 5 months ago

Mine doesn't work if I run it locally from my ip:port and hit the "Go" button after entering my location- but if I reverse proxy it - it works.

netbymatt commented 5 months ago

I don't believe this is rate limiting. Currently there are no API keys in use per the weather.gov documentation. That means that everyone who has a copy of this open is likely unique and not counted against other weatherstar users. My analytics data for this also says there just aren't enough users to hit any kind of rate limit.

bgutman commented 5 months ago

Un-publish the rates for api.weather.gov for the average user is able to: Hit the API 30 times/sec without issue in 2 minute period Hit the API 75 times/sec in any 5 second period and not be blocked. If you are blocked, the service will return a Reference id like #18

In firefox the go button does not work for me either, looking at the network tab in developer tools. I get a blocked 400 error for: geocode.arcgis.com Type:octet stream Transferred: CORS Missing allowed Origin

I can open it chrome at same time and have no issue.

netbymatt commented 5 months ago

In firefox the go button does not work for me either, looking at the network tab in developer tools. I get a blocked 400 error for: geocode.arcgis.com Type:octet stream Transferred: CORS Missing allowed Origin

Thanks for capturing the info surrounding this problem! What version of Firefox and what OS?

bgutman commented 5 months ago

Windows 11 firefox 125.0.2 64 bit

scroguard commented 5 months ago

i can confirm this is a firefox only issue. i'm experiencing it as well. i'm running arch linux with the latest (as of 05/08/24) updates applied, firefox version 125.0.3 64 bit and i am unable to get past entering the zip code. however, if i open it in chromium everything works as expected.

netbymatt commented 5 months ago

I'm still struggling to reproduce this one. I'm running 125.0.3 on Windows 11. I've been watching the CORS headers as @bgutman noted in his report and didn't see anything out of the ordinary there.

I'm starting to think it's related to either a privacy setting, or an extension like an ad-blocker. I did turn set Enhanced Tracking Protection to Strict and did not cause this issue.

Is anyone running a privacy, ad-blocking, vpn or custom dns server who's seeing these errors? I'd like to get the same one going to further track this down.

scroguard commented 5 months ago

i do have various extensions enabled, and i figured those might be the cause of the issue. so i shut everything down. i even went as far as to open a private mode window which disabled all extensions on my system and still encountered the issue.

yllekz commented 5 months ago

I turned off all my adblockers/etc and had the network inspector open both when loading the page and doing "nothing"

I noted two errors, the first appears to have to do with "custom.js" and "NS_ERROR_CORRUPTED_CONTENT" when simply loading the page:

Request:
GET /scripts/custom.js HTTP/1.1
Host: myservernamehere:8047
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:125.0) Gecko/20100101 Firefox/125.0
Accept: */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: keep-alive
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IvSmFhbzRycHZ1VUNNQlNuVGF0SmR4VWpWZXphSFdtS2hRRDBzOGFZKzUrU2VlUjJCSnduQlB5ZWxtWGFHZkRkV3VWS0NZbjFWOGlXd25nZnNjRlEiLCJtYWMiOiJiNzY3MTQ0NDY1ZWJjYWRhMTFhNzA4MWY0OGNhODhkNTlmMTRiZDZmZDQwNjA2NGE3OWFhNjJjMWYwMmYwZTE4IiwidGFnIjoiIn0%3D

Response:
HTTP/1.1 404 Not Found
X-Powered-By: Express
Content-Security-Policy: default-src 'none'
X-Content-Type-Options: nosniff
Content-Type: text/html; charset=utf-8
Content-Length: 156
Date: Wed, 08 May 2024 20:28:22 GMT
Connection: keep-alive
Keep-Alive: timeout=5

Then, I get this when entering a sample location ("CORS Missing Allow Origin"):

Request:
GET /arcgis/rest/services/World/GeocodeServer/find?text=Boston+College-Main+Campus%2C+140+Commonwealth+Ave%2C+Chestnut+Hill%2C+MA%2C+02467%2C+USA&magicKey=dHA9MCN0dj02NjIyYjk2NiNsb2M9NzM5NzE2MCNsbmc9NDEjcGw9NTc1MTEwMyNsYnM9MTQ6MTI4OTUwMjc7MTA5OjcyMTY5NjE4Ozk6MTU5MzE5MTc7MjozNjQ2MjQwODswOjU5OTE5MzI1OzEwOjI0NzkxNyNsbj1Xb3JsZA%3D%3D&f=json HTTP/1.1
Host: geocode.arcgis.com
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:125.0) Gecko/20100101 Firefox/125.0
Accept: */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: http://myservernamehere:8047/
Origin: http://myservernamehere:8047
Connection: keep-alive

Response:
HTTP/1.1 400 Bad Request
Date: Wed, 08 May 2024 20:31:00 GMT
Content-Type: application/octet-stream
Content-Length: 66
Connection: keep-alive
Server: nginx

These seem to be the only clues in an otherwise quiet/errorless network log.

scroguard commented 5 months ago

here is a screenshot of an error i finally found in my network log in firefox:

weather-star_4000-error

i also received the cors error mentioned by yllekz

on top of that i found the other items listed in this screenshot: weather-star_4000-error2

the first line for custom.js shows a 404 error, the rest are all 304 not modified errors.

i am running the app via docker in unraid 6.12.10.

netbymatt commented 5 months ago

@yllekz Thank you for this capture. I now know where the problem is and was able to recreate it. It has to do with running on a server locally that isn't localhost.

I'm deliberately matching the protocol with this line, which causes a downgrade of the call to https://geocode.arcgis.com/... https://github.com/netbymatt/ws4kp/blob/20b4d22115c6dfeb2e3e1fe14b6a97993b1a0821/server/scripts/modules/utils/fetch.mjs#L24 I need to dig into the git history and see why this line exists before I can come up with a solution.

The custom.js error is expected. It's a feature that I put in so (in my case) I can inject the github links on https://weatherstar.netbymatt.com It always looks for the file, and if it's there it'll get run. Otherwise all it does is produce a 404 error in the network log.

TVsIan commented 4 months ago

I'm experiencing this issue if I access the page via my ddns address, port forwarded by the router. But if I'm accessing it via LAN, everything seems to work except for the Copy Permalink function, which does nothing when clicked. I'm not sure if that's related or a different issue.

Also running the latest version in Docker on an Unraid server.

netbymatt commented 4 months ago

Sorry I forgot to post here. I addressed this last week in v5.11.3 7be20490e8916855d2aa4bade9886db2505dbcee. Does anyone have feedback as to whether this is still happening with the new version?

bgutman commented 4 months ago

It is working for me now in firefox windows10. I run ws4kp on a different computer on the local lan.

scroguard commented 4 months ago

i can confirm it is now working for me as well, firefox in arch linux.

yllekz commented 4 months ago

Works for me now! Thanks! We fixed it!