cubehouse / themeparks

Unofficial API for accessing ride wait times and schedules for Disneyland, Disney World, Universal Studios, and many more parks
MIT License
545 stars 126 forks source link

Couchbase Sync returns 502 #201

Closed senorihl closed 5 years ago

senorihl commented 5 years ago

Park All disney parks

Context

Describe the bug When getting changes from couchbase a 502 error is thrown

Output

$ NODE_DEBUG=themeparks PARKID=DisneylandParisMagicKingdom npm run testonline

> themeparks@5.1.10 testonline /home/senorihl/code/cubehouse/themeparks
> mocha --exit lib/testonline.js

THEMEPARKS 28498: DisneylandParisMagicKingdom: Set useragent to Mozilla/5.0 (Linux; U; Android 1.5; en-us; htc_bahamas Build/CRB17) AppleWebKit/528.5  (KHTML, like Gecko) Version/3.1.2 Mobile Safari/525.20.1
THEMEPARKS 28498: Setting up database ":memory:"

  Park DisneylandParisMagicKingdom
    Get Park Wait Times
THEMEPARKS 28498: Database version out-of-date. Got: 0, wants: 5
THEMEPARKS 28498: Updating database version to 1...
THEMEPARKS 28498: Updating database version to 2...
THEMEPARKS 28498: Updating database version to 3...
THEMEPARKS 28498: Updating database version to 4...
THEMEPARKS 28498: Updating database version to 5...
THEMEPARKS 28498: CouchbaseChannelDisney[facilitystatus_dlp]: Fetching full state from nothing
Error getting initial state: Error: Initial state status code: 502 ["<html>\r\n<head><title>502 Bad Gateway</title></head>\r\n<body bgcolor=\"white\">\r\n<center><h1>502 Bad Gateway</h1></center>\r\n</body>\r\n</html>\r\n"]
Error: Initial state status code: 502 ["<html>\r\n<head><title>502 Bad Gateway</title></head>\r\n<body bgcolor=\"white\">\r\n<center><h1>502 Bad Gateway</h1></center>\r\n</body>\r\n</html>\r\n"]
    at needle.then (/home/senorihl/code/cubehouse/themeparks/lib/disney/couchbaseChannel.js:436:33)
    at processTicksAndRejections (internal/process/next_tick.js:81:5)
THEMEPARKS 28498: Making request to https://authorization.go.com/token
THEMEPARKS 28498: Calling POST:https://authorization.go.com/token
THEMEPARKS 28498: Found 'application/json' header from in HTTP request, parsing JSON data
THEMEPARKS 28498: Successfully fetched body for URL https://authorization.go.com/token
THEMEPARKS 28498: DisneylandParisMagicKingdom: Fetched new WDW access_token 9e9a57493ed341569e5a6e05474eda5e, expires in 900, caching for a maximum of 810
THEMEPARKS 28498: Making request to https://api.wdpro.disney.go.com/explorer-service/public/ancestor-activities-schedules/dlp;entityType=destination
THEMEPARKS 28498: Calling GET:https://api.wdpro.disney.go.com/explorer-service/public/ancestor-activities-schedules/dlp;entityType=destination
THEMEPARKS 28498: Found 'application/json' header from in HTTP request, parsing JSON data
THEMEPARKS 28498: Successfully fetched body for URL https://api.wdpro.disney.go.com/explorer-service/public/ancestor-activities-schedules/dlp;entityType=destination
THEMEPARKS 28498: CouchbaseChannelDisney[facilities_dlp]: Fetching full state from nothing
THEMEPARKS 28498: FacilityChannel: Error getting initial state: Error: Initial state status code: 502 ["<html>\r\n<head><title>502 Bad Gateway</title></head>\r\n<body bgcolor=\"white\">\r\n<center><h1>502 Bad Gateway</h1></center>\r\n</body>\r\n</html>\r\n"]
Error: Initial state status code: 502 ["<html>\r\n<head><title>502 Bad Gateway</title></head>\r\n<body bgcolor=\"white\">\r\n<center><h1>502 Bad Gateway</h1></center>\r\n</body>\r\n</html>\r\n"]
    at needle.then (/home/senorihl/code/cubehouse/themeparks/lib/disney/couchbaseChannel.js:436:33)
    at processTicksAndRejections (internal/process/next_tick.js:81:5)
THEMEPARKS 28498: FacilityChannel: No new facility data to bulk write to DB, skipping write
THEMEPARKS 28498: FacilityChannel: No new calendar data to bulk write to DB, skipping write
THEMEPARKS 28498: Making request to https://api.wdpro.disney.go.com/explorer-service/public/destinations/dlp;entityType=destination/facilities?region=fr
THEMEPARKS 28498: Calling POST:https://api.wdpro.disney.go.com/explorer-service/public/destinations/dlp;entityType=destination/facilities?region=fr
THEMEPARKS 28498: Found 'application/json' header from in HTTP request, parsing JSON data
THEMEPARKS 28498: Successfully fetched body for URL https://api.wdpro.disney.go.com/explorer-service/public/destinations/dlp;entityType=destination/facilities?region=fr
      ✓ should not return an error fetching ride times (3136ms)
      1) should have some ride data
      ✓ should have an ID for every ride
      ✓ should have a wait time for every operating ride (or should be null)
      ✓ should have a name for every ride
      ✓ should have an active state for every ride
      ✓ should have a fastpass field for every ride
      ✓ should have a status field for every ride
      ✓ should have matching status and active fields
    Get Schedule
THEMEPARKS 28498: Making request to https://api.wdpro.disney.go.com/explorer-service/public/ancestor-activities-schedules/dlp;entityType=destination
THEMEPARKS 28498: Calling GET:https://api.wdpro.disney.go.com/explorer-service/public/ancestor-activities-schedules/dlp;entityType=destination
THEMEPARKS 28498: Found 'application/json' header from in HTTP request, parsing JSON data
THEMEPARKS 28498: Successfully fetched body for URL https://api.wdpro.disney.go.com/explorer-service/public/ancestor-activities-schedules/dlp;entityType=destination
      ✓ should not error when fetching schedule (550ms)
      ✓ should have schedule data
      ✓ should have a valid date for each schedule entry
      ✓ should have a valid opening time for each schedule entry
      ✓ should have a valid closing time for each schedule entry (98ms)

  13 passing (4s)
  1 failing
senorihl commented 5 years ago

It seems that the hostname change cause even this

curl --request GET \
  --url https://realtime-sync-gw.wdprapps.disney.com/ \
  --header 'accept: application/json' \
  --header 'authorization: Basic V0RQUk8tTU9CSUxFLk1EWC5XRFcuQU5EUk9JRC1QUk9EOmllTmdhazRhaHBoNXRo'

returns a 502

cubehouse commented 5 years ago

Will look into this tonight, but will welcome pull requests if anyone knows what is up.

PhilippeP62 commented 5 years ago

Here , I couldn't check what it did wrong , but wait times for DLP weren't updated starting at 10am Paris time.... Without doing anything , it works normal again since 7.30pm ... so maybe a problem on the Disney side ?

And by the way , I really miss the rides opening times ... , they are in the app , so they must exist somewhere !

Philippe

Le jeu. 27 juin 2019 à 11:04, Jamie Holding notifications@github.com a écrit :

Will look into this tonight, but will welcome pull requests if anyone knows what is up.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/cubehouse/themeparks/issues/201?email_source=notifications&email_token=ACYETURVHP5A4TOVO2DBKBTP4R7C5A5CNFSM4H3ZREQKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYWO5BA#issuecomment-506261124, or mute the thread https://github.com/notifications/unsubscribe-auth/ACYETURRFFU4F6QIKK5IYR3P4R7C5ANCNFSM4H3ZREQA .

mooreandrew commented 5 years ago

Looks like a problem Disney's end:

https://www.reddit.com/r/WaltDisneyWorld/comments/c65xmo/anyone_know_whats_going_on_with_the_mk_wait_times/

cubehouse commented 5 years ago

Everything seems to be working again now? I just rebooted my instance and everything seems to be a-OK.

Can people confirm if they were having issues if they're now resolved?

jeanmatthieud commented 5 years ago

I saw the same issue today on DLP. I did not worried because the DLP endpoint was still available, but with constant values. Seems to work now as the majority of rides are now closed.

senorihl commented 5 years ago

I can confirm its works again. Thanks everyone. I close this issue :wink: