question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"Unknown Location" errors do not follow requested `format` nor `lang`

See original GitHub issue

The format is handled in the lines below, but this is always sent as a string, I noticed it because I got a JSON parse error while looking for antarctica, and it’s also not translated:

https://github.com/chubin/wttr.in/blob/e0cc061a64ba86cda1380f0409203a0fb8ae889c/lib/view/line.py#L349-L356

Query

❯ curl -v "wttr.in/antarctica?format=j1&lang=es"
*   Trying 5.9.243.187...
* TCP_NODELAY set
* Connected to wttr.in (5.9.243.187) port 80 (#0)
> GET /antarctica?format=j1&lang=es HTTP/1.1
> Host: wttr.in
> User-Agent: curl/7.55.1
> Accept: */*
>
< HTTP/1.1 200 OK
< Server: nginx/1.10.3
< Date: Sun, 21 Mar 2021 10:58:19 GMT
< Content-Type: application/json
< Content-Length: 50
< Connection: keep-alive
< Access-Control-Allow-Origin: *
<
Unknown location; please try ~-82.1081821,34.37824* Connection #0 to host wttr.in left intact

(As a side note, could this be also changed so it doesn’t return 200 OK?)

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
kyranetcommented, Apr 4, 2021

Something like this?

{
  "error": "Unknown location"
}

That’s right.

This one isn’t caused by the outage

Yes. And besides that, in this particular case the error message is wrong. The real error was that it could not find data for this location, and the location itself was resolved properly.

Ah, makes sense πŸ‘πŸΌ

0reactions
chubincommented, Apr 4, 2021

Something like this?

{
  "error": "Unknown location"
}

This one isn’t caused by the outage

Yes. And besides that, in this particular case the error message is wrong. The real error was that it could not find data for this location, and the location itself was resolved properly.

By the way, if you need just some location in Antarctica, you can use the Vostok Station for the query:

$ curl wttr.in/Vostok+Station
Weather report: Vostok+Station

                Overcast
       .--.     -54 Β°C
    .-(    ).   β†— 23 km/h
   (___.__)__)  10 km
                0.0 mm
                                                       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€  Sun 04 Apr β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚            Morning           β”‚             Noon      β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜     Evening           β”‚             Night            β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚               Overcast       β”‚               Overcast       β”‚               Overcast       β”‚               Overcast       β”‚
β”‚      .--.     -50(-70) Β°C    β”‚      .--.     -51(-71) Β°C    β”‚      .--.     -52 Β°C         β”‚      .--.     -58 Β°C         β”‚
β”‚   .-(    ).   β†— 23-48 km/h   β”‚   .-(    ).   β†— 24-51 km/h   β”‚   .-(    ).   β†— 23-49 km/h   β”‚   .-(    ).   β†— 22-47 km/h   β”‚
β”‚  (___.__)__)  10 km          β”‚  (___.__)__)  10 km          β”‚  (___.__)__)  10 km          β”‚  (___.__)__)  10 km          β”‚
β”‚               0.0 mm | 0%    β”‚               0.0 mm | 0%    β”‚               0.0 mm | 0%    β”‚               0.0 mm | 0%    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                                       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€  Mon 05 Apr β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚            Morning           β”‚             Noon      β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜     Evening           β”‚             Night            β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚               Overcast       β”‚               Overcast       β”‚               Overcast       β”‚               Overcast       β”‚
β”‚      .--.     -51(-70) Β°C    β”‚      .--.     -53(-72) Β°C    β”‚      .--.     -55(-75) Β°C    β”‚      .--.     -56(-75) Β°C    β”‚
β”‚   .-(    ).   β†— 21-44 km/h   β”‚   .-(    ).   β†— 21-43 km/h   β”‚   .-(    ).   β†— 19-40 km/h   β”‚   .-(    ).   β†— 18-38 km/h   β”‚
β”‚  (___.__)__)  10 km          β”‚  (___.__)__)  10 km          β”‚  (___.__)__)  10 km          β”‚  (___.__)__)  10 km          β”‚
β”‚               0.0 mm | 0%    β”‚               0.0 mm | 0%    β”‚               0.0 mm | 0%    β”‚               0.0 mm | 0%    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                                       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€  Tue 06 Apr β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚            Morning           β”‚             Noon      β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜     Evening           β”‚             Night            β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚               Overcast       β”‚               Overcast       β”‚               Overcast       β”‚               Overcast       β”‚
β”‚      .--.     -60(-77) Β°C    β”‚      .--.     -60(-78) Β°C    β”‚      .--.     -61 Β°C         β”‚      .--.     -66 Β°C         β”‚
β”‚   .-(    ).   β†— 13-28 km/h   β”‚   .-(    ).   β†— 15-32 km/h   β”‚   .-(    ).   β†’ 16-33 km/h   β”‚   .-(    ).   β†’ 15-32 km/h   β”‚
β”‚  (___.__)__)  10 km          β”‚  (___.__)__)  10 km          β”‚  (___.__)__)  10 km          β”‚  (___.__)__)  10 km          β”‚
β”‚               0.0 mm | 0%    β”‚               0.0 mm | 0%    β”‚               0.0 mm | 0%    β”‚               0.0 mm | 0%    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
Location: Vostok Station, станция Восток, AAT, Antarctica [-78.4642714,106.8364678]
Read more comments on GitHub >

github_iconTop Results From Across the Web

"Unknown Location" errors do not follow requested `format` nor `lang`
The format is handled in the lines below, but this is always sent as a string, I noticed it because I got a...
Read more >
Troubleshoot Dataflow errors - Google Cloud
When you run a Dataflow job created from a template, the job might fail with the following error: Error: CommitWork failed: status: APPLICATION_ERROR(3):...
Read more >
How to Fix a 400 Bad Request Error (Causes and Fixes) - Kinsta
The 400 Bad Request error indicates that the server cannot or process the request due to a client error. Read about the common...
Read more >
Resolve "AWS Access Key Id" errors when sending requests ...
I'm using the AWS CLI, an AWS SDK, or an application to access my Amazon S3 bucket, but I'm getting the error "The...
Read more >
org.xml.sax.SAXParseException: Content is not allowed in ...
This is often caused by a white space before the XML declaration, but it could be any text, like a dash or any...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found