CodeForPhilly / laddr

http://codeforphilly.github.io/laddr/
MIT License
61 stars 34 forks source link

Meetup.com down causes Laddr site to be down completely #168

Closed schlos closed 7 years ago

schlos commented 7 years ago

Precondition: Has ongoing meetup event Has ongoing meetup.com maintenance

Current problem: Laddr site is down

Error:

Error

file_get_contents(https://api.meetup.com/2/events?offset=0&format=json&limited_events=False&group_urlname=HrOpen&photo-host=public&page=20&fields=&order=time&desc=false&status=upcoming&sig_id=**********): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found

Source: /emergence/sites/code-for-croatia/data/789 (Meetup.php)
Line: 36

Author: chris
Timestamp: 2014-11-17 10:20:00

URI

/

Request Method

GET

User Agent

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36

Remote Address

172.68.51.223

User

array (************)
Backtrace

Array
(
    [0] => Array
        (
            [function] => handleError
            [class] => Site
            [type] => ::
            [args] => Array
                (
                    [0] => 2
                    [1] => file_get_contents(https://api.meetup.com/2/events?offset=0&format=json&limited_events=False&group_urlname=HrOpen&photo-host=public&page=20&fields=&order=time&desc=false&status=upcoming&sig_id=**********): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found

                    [2] => /emergence/sites/code-for-croatia/data/789
                    [3] => 36
                    [4] => Array
                        (
                            [ttl] => 1800
                            [cacheKey] => meetup/events
                            [data] => 
                            [http_response_header] => Array
                                (
                                    [0] => HTTP/1.1 404 Not Found
                                    [1] => Content-Type: application/json
                                    [2] => Content-Length: 193
                                    [3] => Connection: close
                                    [4] => Last-Modified: Fri, 24 Feb 2017 17:19:02 GMT
                                    [5] => ETag: "1c51ebf9f42acdec703e86edce2f7f35"
                                    [6] => x-amz-error-code: NoSuchKey
                                    [7] => x-amz-error-message: The specified key does not exist.
                                    [8] => x-amz-error-detail-Key: 2/events
                                    [9] => Date: Sun, 05 Mar 2017 09:39:08 GMT
                                    [10] => Server: AmazonS3
                                    [11] => Age: 113
                                    [12] => X-Cache: Error from cloudfront
                                    [13] => Via: 1.1 9c3935366a39acd2af942625478df61e.cloudfront.net (CloudFront)
                                    [14] => X-Amz-Cf-Id: W0PpWYh2kzvdXjidfLCBrShzSupoWAEpGqxmeW6w-IaBJAEwzNB0cQ==
                                )

                        )

                )

        )

    [1] => Array
        (
            [function] => file_get_contents
            [args] => Array
                (
                    [0] => https://api.meetup.com/2/events?offset=0&format=json&limited_events=False&group_urlname=HrOpen&photo-host=public&page=20&fields=&order=time&desc=false&status=upcoming&sig_id=**********
                    [1] => 
                    [2] => Resource id #1
                )

        )

    [2] => Array
        (
            [file] => /emergence/sites/code-for-croatia/data/789
            [line] => 36
            [function] => file_get_contents
            [args] => Array
                (
                    [0] => https://api.meetup.com/2/events?offset=0&format=json&limited_events=False&group_urlname=HrOpen&photo-host=public&page=20&fields=&order=time&desc=false&status=upcoming&sig_id=**********
                )

        )

    [3] => Array
        (
            [file] => /emergence/sites/code-for-croatia/data/1249
            [line] => 9
            [function] => getEvents
            [class] => RemoteSystems\Meetup
            [type] => ::
            [args] => Array
                (
                )

        )

    [4] => Array
        (
            [file] => /usr/local/lib/node_modules/emergence/php-bootstrap/lib/Site.class.php
            [line] => 303
            [args] => Array
                (
                    [0] => /emergence/sites/code-for-croatia/data/1249
                )

            [function] => require
        )

    [5] => Array
        (
            [file] => /usr/local/lib/node_modules/emergence/php-bootstrap/lib/Site.class.php
            [line] => 256
            [function] => executeScript
            [class] => Site
            [type] => ::
            [args] => Array
                (
                    [0] => SiteFile Object
                        (
                            [_handle:SiteFile:private] => home.php
                            [_record:SiteFile:private] => Array
                                (
                                    [ID] => 1249
                                    [CollectionID] => 4
                                    [Handle] => home.php
                                    [Status] => Normal
                                    [SHA1] => f7551808421b539af1085c5bbc68c8e3fe0f3d89
                                    [Size] => 4316
                                    [Type] => application/php
                                    [Timestamp] => 2015-10-25 18:14:51
                                    [AuthorID] => 2
                                    [AncestorID] => 
                                )

                            [_author:protected] => 
                        )

                )

        )

    [6] => Array
        (
            [file] => /usr/local/lib/node_modules/emergence/php-bootstrap/web.php
            [line] => 9
            [function] => handleRequest
            [class] => Site
            [type] => ::
            [args] => Array
                (
                )

        )

)

When checking meetup API URL it returns:

https://api.meetup.com/2/events?offset=0&format=json&limited_events=False&group_urlname=HrOpen&photo-host=public&page=20&fields=&order=time&desc=false&status=upcoming&sig_id=**

{"errors":[{"code":"maintenance","message":"We're making some changes to our technology.\nAll of our platforms will be down today for about three to six hours.\n\nThanks for your patience."}]}

Expected: When meetup.com is under maintenance or down, it should not affect laddr site. Better handle these kind of exception errors.

themightychris commented 7 years ago

FIxed in #169