sixeyed / diamol

Code samples for the book "Learn Docker in a Month of Lunches"
https://www.manning.com/books/learn-docker-in-a-month-of-lunches
Creative Commons Attribution Share Alike 4.0 International
505 stars 273 forks source link

CH04 Image of the day; nasa site errors with 404 between 8 pm - 11:59 pm EDT because it could not generate image for the next day (nasa site assumes it's the next day due to UTC time it uses) #21

Open mohamed-a opened 3 years ago

mohamed-a commented 3 years ago

Exercise CH04 packaging java

Problem CH04 Image of the day; nasa site errors with 404 between 8 pm - 11:59 EST pm because it could not generate an image for the next day (nasa site assumes it's the next day due to UTC time it uses)

On 2020-10-25, when launching //localhost:800/image between 8 pm CST and just before 11:00 pm CST, the nasa site for astronomy image of the day returns 404 error and outputs the date as 2020-10-26. Clearly, it's using UTC. Once the time rolls to 11 pm CST (12 am EST), //localhost:800/image returns the expected json with image url.

The workaround is to provide start and end time as the url parameters.

Docker version Please run docker version and paste the output.

Client: Docker Engine - Community Version: 19.03.6 API version: 1.40 Go version: go1.12.16 Git commit: 369ce74a3c Built: Thu Feb 13 01:27:49 2020 OS/Arch: linux/amd64 Experimental: false

Server: Docker Engine - Community Engine: Version: 19.03.6 API version: 1.40 (minimum version 1.12) Go version: go1.12.16 Git commit: 369ce74a3c Built: Thu Feb 13 01:26:23 2020 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.2.13 GitCommit: 7ad184331fa3e55e52b890ea95e65ba581ae3429 runc: Version: 1.0.0-rc10 GitCommit: dc9208a3303feef5b3839f4323d9beb36df0a9dd docker-init: Version: 0.18.0 GitCommit: fec3683

Code version Please run git log -n 1 and paste the output.

commit 19a8d04b1b4df0392ae6091c6ead8a680ad72368 (HEAD -> master, origin/master, origin/HEAD) Author: Elton Stoneman elton@sixeyed.com Date: Fri Sep 25 09:10:55 2020 +0100

Add ep. 20

Additional context Add any other context about the problem here.

sixeyed commented 3 years ago

There's a known issue in the APOD API - https://github.com/nasa/apod-api/issues/48. I guess they'll fix it one day, but the NASA team probably have other things to work on. The fix can be ported from here - https://github.com/gumbarros/kepler/blob/master/lib/src/services/api/api.dart#L38.

nwunderly commented 3 years ago

Does this still happen? nasa/apod-api#51 back in November should have fixed that.