Page MenuHomePhabricator

Cargo surfacing API errors/timeouts
Closed, InvalidPublic


My cargo installation was silently failing to work, because the API endpoint was stuck in a redirect loop (T215857).

I think Cargo should surface API errors/timeouts when it has problems, especially in the maintenance scripts.

At first this seemed like a cargo problem, because the whole wiki worked otherwise. It was just when I clicked create table on a template that it would time out, and the table never appeared. Running the maintenance script from cargo even with --mwdebug produced no error messages, but also no cargo table.

It didn't seem like a permission issue because maintenance/update.php created the two initial cargo tables just fine. And SMW worked fine all this time as well (obviously it does not use the API).

I then had to use the dev tools in Edge (corporate network, I know) to spy on the network ajax calls, which is when I saw the API call. I then curl'ed the API call and finally got the error message, which, unfortunately for me was a bit cryptic and led to me having to dig into api.php code.

All this to say Cargo should surface these errors, and likely timeout faster too.

Otherwise, thanks for the great extension!

Event Timeline

Ofbeaton created this task.Feb 12 2019, 2:15 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptFeb 12 2019, 2:15 PM

Sorry, I don't understand. What script did you call that failed without producing an error message - cargoRecreateData.php? If so, does that script even call the API? I can't remember now.

I tried the Recreate data tab and after I hit OK I got infinite spinner. I tried php extensions/Cargo/maintenance/cargoRecreateData.php and got no output even with debug on.

I would appreciate if both of these (especially the later) complained if it can't successfully create the tables because the API is inoperable.

I'm still not sure that cargoRecreateData.php is calling the API. After you got the API fixed on your wiki, did you try calling cargoRecreateData.php again?

Yup, then I got tons of output. ie Recreating data for Cargo table... But when api was borked I got nothing.

Okay, I looked through the code for cargoRecreateData.php and it indeed does not call the MediaWiki API. I mean, it calls MediaWiki code, which can be considered an API too, but it's not calling anything related to api.php. So I don't know how your fixes affected that script.

Ofbeaton closed this task as Invalid.Feb 12 2019, 6:55 PM

OK then, thank you for taking a look. I just tried to reintroduce the problem with my API and I can't recreate it simply. I'll close this for now.