• Resolved Jacob

    (@jake33)


    WCBRS 2019 Contributor

    Hi,

    I wonder if you can shed any light on this – the website has been live and working fine for a few months now and yesterday the event listings page suddenly threw an error – nothing had been edited or changed and I can’t work out how to resolve it!

    It only happens with eventbrite_get_events()
    …eventbrite_get_event() and Eventbrite_Query both still work.

    The errors:

    Notice: Undefined property: Keyring_Error::$events in ..../wp-includes/class-wp-error.php on line 78

    Warning: Invalid argument supplied for foreach() in …./wp-content/themes/trichocare/404.php on line 28

    This is around line 28:

    $events_array = eventbrite_get_events();
    // loop through each of the events object array
    foreach ( $events_array->events as $event) {

    What do you think? I have tried reconnecting Keyring, perhaps this is better suited to the Keyring support page – I just find it odd that it’s only eventbrite_get_events that doesn’t work.

    WP 4.1.7
    EB API: 1.0.8
    KR: 1.6.1

    Cheers,

    Jacob

    https://wordpress.org/plugins/eventbrite-api/

Viewing 15 replies - 1 through 15 (of 17 total)
  • Thread Starter Jacob

    (@jake33)

    WCBRS 2019 Contributor

    I also get this when trying to print_r the events array:

    Keyring_Error Object
    (
        [errors:WP_Error:private] => Array
            (
                [keyring-request-error] => Array
                    (
                        [0] => WP_Error Object
                            (
                                [errors:WP_Error:private] => Array
                                    (
                                        [http_request_failed] => Array
                                            (
                                                [0] => Operation timed out after 5001 milliseconds with 0 bytes received
                                            )
                                    )
                                [error_data:WP_Error:private] => Array
                                    (
                                    )
                            )
                    )
            )
        [error_data:WP_Error:private] => Array
            (
            )
    )
    Plugin Author Automattic

    (@automattic)

    It looks like your server had problems connecting to the Eventbrite API. Are you still seeing the error? The version you’re on shouldn’t be caching failed results either, so that shouldn’t be a variable.

    Regardless, you’re right, we shouldn’t be throwing a warning; will get that fixed up.

    Plugin Author Automattic

    (@automattic)

    Oh, hang on – sorry, got confused. You’re using eventbrite_get_events() yourself in a custom theme; you would have to handle the error yourself in the theme. You could do something like:

    $events_array = eventbrite_get_events();
    
    if ( ! is_wp_error( $events_array ) ) {
    	// loop through each of the events object array
    	foreach ( $events_array->events as $event) {
    	...
    }
    Plugin Author Automattic

    (@automattic)

    Not sure what you’re doing with that loop, but if you can, you can use a standard loop like in the templates included with the plugin. By using $events->have_posts(), that error handling comes “built-in”, so to speak.

    Thread Starter Jacob

    (@jake33)

    WCBRS 2019 Contributor

    Yes, it’s still not working and it’s been 24hrs. Any idea how to fix the issue or things to try?

    Do you think it’s an Eventbrite API issue or Keyring?

    Cheers,

    Jacob

    Thread Starter Jacob

    (@jake33)

    WCBRS 2019 Contributor

    Thanks for the tip, I’ll get that adapted for better error handling. I’m using eventbrite_get_events() as I needed more bespoke information like ticket sale status and ticket quantities which Eventbrite_Query didn’t appear to cover.

    Any idea why the fail is happening? I’m wondering if it’s the server timing out perhaps? There are quit a few events if that gives any clues?

    Cheers,

    Jacob

    Plugin Author Automattic

    (@automattic)

    Hi Jacob,

    Can you give me more context? How many events, what your loop looks like; can I get a link to the page? Are you getting the same events fine with eventbrite_get_event() on single view pages, just not the full listing page? Thanks!

    Plugin Author Automattic

    (@automattic)

    Oh, another thing to try is using the Keyring debug mode; it will give you a ton of info with what goes on during its business. Add this to your wp-config.php:

    define('KEYRING__DEBUG_MODE', true);

    If you’ve got more than 50 events being loaded at the same time, you may need additional handling in the call. We’ve been trying to balance efficiency in the calls vs. various developer use-cases that have come up, so there have been changes lately (and another change upcoming for people using organizer_id in Eventbrite_Query). Let me know if any of this applies to you.

    Thread Starter Jacob

    (@jake33)

    WCBRS 2019 Contributor

    Hi,

    So I’ve got an interim solution working – swapping to use Eventbrite_Query which is working (though seems limited to 10 events, even with limit set to more), so the pressure has eased.

    Some more info:

    We’re loading 45 events (more than anticipated!)
    Eventbrite_Query works with all and p
    eventbrite_get_event works
    eventbrite_get_events struggles

    I say struggles as it’s now suddenly working albeit very slowly. It’s hard to tell if any caching is in place but it does seem to be caused by overloading issues, would you agree?

    I’m a bit hesitant about putting Keyring debug mode on as the site is live with visitors, unfortunately no dev site at the moment.

    So, how would I put additional handling in the call?

    (BTW no organizer_id used here)

    Thanks for the help,

    Jacob

    Thread Starter Jacob

    (@jake33)

    WCBRS 2019 Contributor

    Update: the Eventbrite_Query version is now also sporadic in loading if that helps.

    Here’s a temporary link: http://urlgone.com/790923/

    Cheers,

    Jacob

    Plugin Author Automattic

    (@automattic)

    Hi jake33,

    Great, glad Eventbrite_Query is working out for you. FWIW, your link seems to be loading well for me.

    though seems limited to 10 events, even with limit set to more

    That’s correct; by default, 10 events will be returned, but limit can be used to reduce that. If you want to be working with a larger set than the default 10, you can use nopaging set to true to bring back up to 50 events into your loop (the fixed maximum returned from an Eventbrite API call). of course, this only increases the time for your pageload if putting all 50 events on a page. We have users doing it, but YMMV.

    Frankly, it doesn’t make much difference at the API call level; their API just returns up to 50 events, and there’s no way to ask for more or less to lighten the load that way (it all ends up having to be done in the plugin after receiving results). I’m not sure what I could recommend if the problem is timeouts between the hosting and the Eventbrite API.

    By default, the plugin caches results for 24 hours, which seems to be active on the link above. How often are you seeing timeout errors?

    Thread Starter Jacob

    (@jake33)

    WCBRS 2019 Contributor

    Hi, thanks for the info.

    Unfortunately, it seems Eventbrite_Query is also having issues, with the page loading properly about 50% of the time. I’ve set it to output all of the events (thanks for the tip), as you say doesn’t make much difference. I haven’t noticed any caching whatsoever, is there a setting that might be missing or a way to ensure this happens?

    At the moment it gives full listings one moment, then none the next – presumably if the caching were in place it would give a consistent result?

    I’ll keep brainstorming the timeouts but any caching would be great if I can get that working.

    Cheers,

    Jacob

    Plugin Author Automattic

    (@automattic)

    Hi Jacob,

    So, you can hit refresh a bunch of times in a row, and sometimes it loads and sometimes not? If so, definitely odd and something we haven’t come across yet. When it fails to load, are there any errors in your PHP error log? What (if anything) happens on screen?

    Caching was working fine when I tested it myself (usually pretty obvious when it’s working as the page will load in a second or so). The caching bit is here; if you error log $cached, do you get anything, or what you expect?

    I also am having the same issue as jake33. I am calling

    eventbrite_get_events( array( "status" => "ended", "order_by" => 'start_desc' ) )

    It was working fine for a few months, but now gives me a

    object(Keyring_Error)#724 (2) { ["errors"]=> array(1) { ["keyring-request-error"]=> array(1)

    when I var_dump what the method returns.

    I am also using Eventbrite_Query to list upcoming events and there are upcoming events in Eventbrite, but Eventbrite_Query doesn’t return any results anymore.

    Plugin Author Automattic

    (@automattic)

    Hi bridgetwes, can you start your own thread please? This makes sure no-one falls through the cracks (you can just copy paste the above if you like). Thanks!

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘New eventbrite_get_events error’ is closed to new replies.