Index  | Recent Threads  | Unanswered Threads  | Who's Active  | Guidelines  | Search
 

Quick Go »
No member browsing this thread
Thread Status: Active
Total posts in this thread: 9
[ Jump to Last Post ]
Post new Thread
Author
Previous Thread This topic has been viewed 741 times and has 8 replies Next Thread
adriverhoef
Master Cruncher
The Netherlands
Joined: Apr 3, 2009
Post Count: 2069
Status: Recently Active
Project Badges:
Reply to this Post  Reply with Quote 
[SOLVED] The URL for the API is returning ERROR 500: Internal Server Error.

Help!

I've been using the API each day since 2016 and today the URL has been returning Internal Server Error all day (since somewhere between UTC 00:20 and 01:00).
(See the Help pages for the API. More specific: https://www.worldcommunitygrid.org/help/topic.s?shortName=api#665)

I'm using the API to retrieve all my results on a regular basis.
I've tried two accounts and both are returning the ERROR 500: Internal Server Error.

To verify my team membership and statistics I've also used the API:
http://www.worldcommunitygrid.org/verifyMembe...amp;code=VERIFICATIONCODE
and this works! (MEMBERNAME and VERIFICATIONCODE replaced by my credentials)

Adri
----------------------------------------
[Edit 4 times, last edit by adriverhoef at Jan 25, 2024 6:34:44 PM]
[Jan 24, 2024 3:26:06 PM]   Link   Report threatening or abusive post: please login first  Go to top 
TigerLily
Senior Cruncher
Joined: May 26, 2023
Post Count: 280
Status: Offline
Project Badges:
Reply to this Post  Reply with Quote 
Re: The URL for the API is returning ERROR 500: Internal Server Error.

Hi Adri,

I have passed this on to a member of the tech team and they are investigating the issue. Thanks for bringing this to our attention.
[Jan 24, 2024 6:36:29 PM]   Link   Report threatening or abusive post: please login first  Go to top 
adriverhoef
Master Cruncher
The Netherlands
Joined: Apr 3, 2009
Post Count: 2069
Status: Recently Active
Project Badges:
Reply to this Post  Reply with Quote 
Re: The URL for the API is returning ERROR 500: Internal Server Error.

That's great, TigerLily, and congratulations on the badge for crunching 45 days of MCM1! :-)

Adri
[Jan 24, 2024 7:13:47 PM]   Link   Report threatening or abusive post: please login first  Go to top 
alanb1951
Veteran Cruncher
Joined: Jan 20, 2006
Post Count: 858
Status: Offline
Project Badges:
Reply to this Post  Reply with Quote 
Re: The URL for the API is returning ERROR 500: Internal Server Error.

I've also hit the same issue... My thanks to Adri for posting this, and thanks to TigerLily for passing it on promptly!

A bit of extra information follows, as I've been trying to narrow down the issue in my scripts using the old API. I hope this might help (and that the effort doesn't offend!)...

  • The issue seems to be entirely with URLs that start with /api/members/XXXXXX/results (where XXXXXX is the username)
  • If the call tries to access only "Pending Verification" data it works, probably because I don't currently have any results in that state.
  • If the call tries to access only "Pending Validation" data or "Valid" data it fails; I have data in both cases, rather a lot in the case of "Valid" :-(
It looks as if it can still determine whether there's data at all, and if there isn't it produces a valid JSON file as below:
{"ResultsStatus": {
"ResultsAvailable": "0",
"ResultsReturned": "0",
"Offset": "0",
"Results": [
]
}
}

So it seems to be having problems fetching the data or formatting it on receipt[*1]. Hopefully it should be fairly easy to track down the problem and to solve it.

All other aspects of both the old and new APIs seem to be working as expected, though switching to the new API would entail a lot of re-coding so getting the old one back would be nice :-)

Cheers - Al.

P.S. nice to see a badge -- there's no substitute for end user experience :-)

*1 I wonder about a possible formatting issue because sometimes data in the JSON files has obvious errors in dates (impossible values such as 31st November, or wrong values such as claiming the result hasn't been sent yet when I've already returned it!) Without access to the code I'm only speculating, of course :-)
[Jan 24, 2024 8:13:23 PM]   Link   Report threatening or abusive post: please login first  Go to top 
Sgt.Joe
Ace Cruncher
USA
Joined: Jul 4, 2006
Post Count: 7545
Status: Offline
Project Badges:
Reply to this Post  Reply with Quote 
Re: The URL for the API is returning ERROR 500: Internal Server Error.

Tiger Lily:
Congratulations on the badge. It shows you are crunching. Keep up the good work. Since you are crunching, you may be able to see in real time some of the problems we reference in the forum.

Cheers
----------------------------------------
Sgt. Joe
*Minnesota Crunchers*
[Jan 24, 2024 9:05:59 PM]   Link   Report threatening or abusive post: please login first  Go to top 
adriverhoef
Master Cruncher
The Netherlands
Joined: Apr 3, 2009
Post Count: 2069
Status: Recently Active
Project Badges:
Reply to this Post  Reply with Quote 
Re: The URL for the API is returning ERROR 500: Internal Server Error.

Dear TigerLily, there is a light at the end of the tunnel!

Al, thanks for taking the time to respond and to try some things. Thanks to you I've been experimenting with some parameters and what do you know: JSON fails, but XML works!
$ wget -O /tmp/wcg.xml 'https://www.worldcommunitygrid.org/api/member...xml=true&Limit=0'
--2024-01-24 22:58:44-- https://www.worldcommunitygrid.org/api/member...&xml=true&Limit=0
Resolving www.worldcommunitygrid.org (www.worldcommunitygrid.org)... 199.241.167.118
Connecting to www.worldcommunitygrid.org (www.worldcommunitygrid.org)|199.241.167.118|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/xml]
Saving to: ‘/tmp/wcg.xml’

/tmp/wcg.xml [ <=> ] 55.32M 10.5MB/s in 17s

2024-01-24 22:59:11 (3.29 MB/s) - ‘/tmp/wcg.xml’ saved [58002853]


Adri
----------------------------------------
[Edit 1 times, last edit by adriverhoef at Jan 24, 2024 10:15:49 PM]
[Jan 24, 2024 10:05:30 PM]   Link   Report threatening or abusive post: please login first  Go to top 
TigerLily
Senior Cruncher
Joined: May 26, 2023
Post Count: 280
Status: Offline
Project Badges:
Reply to this Post  Reply with Quote 
Re: The URL for the API is returning ERROR 500: Internal Server Error.

Hi Adri,

The tech team have said they can now retrieve results in both JSON and XML. Can you please confirm whether you are able to retrieve results as normal again?
[Jan 25, 2024 5:28:27 PM]   Link   Report threatening or abusive post: please login first  Go to top 
adriverhoef
Master Cruncher
The Netherlands
Joined: Apr 3, 2009
Post Count: 2069
Status: Recently Active
Project Badges:
Reply to this Post  Reply with Quote 
Re: The URL for the API is returning ERROR 500: Internal Server Error.

Marvellous, TigerLily! Retrieving the results is working again in both XML and JSON. It's working as before. Fantastic! rose

I hope all experimenting posted in this thread helped a bit in finding the solution.

Thanks,
Adri
----------------------------------------
[Edit 2 times, last edit by adriverhoef at Jan 25, 2024 6:41:06 PM]
[Jan 25, 2024 6:34:12 PM]   Link   Report threatening or abusive post: please login first  Go to top 
alanb1951
Veteran Cruncher
Joined: Jan 20, 2006
Post Count: 858
Status: Offline
Project Badges:
Reply to this Post  Reply with Quote 
It did it again for a while: The URL for the API is returning ERROR 500: Internal Server Error.

Unfortunately, this problem seems to have returned.

[Edited to reflect the eventual return of normal service...]

This problem raised its head again during the early morning of 2024-02-04, but it seems to have resolved by the afternoon.

At 02:00 UTC on 2024-02-04 my collector script that uses JSON files with the old API failed; I used the xml option to get data, converting it to the equivalent JSON so my script would run without change...

Having dealt with that, I repeated the tests I did on 2024-01-24, trying to acquire "Pending Verification" data and "Pending Validation" data (both small sets)...

Using the default (JSON), the Pending Verification fetch worked (no data to fetch!) and Pending Validation got a Server Internal Error (500) fail. Adding the xml=true option to the Pending Validation query got a viable XML file. These outcomes matched my tests when this was first reported -- looks like the same problem. (And yes, I repeated the tests to make sure it wasn't just coincidental...)

Hopefully the solution is still the same, and easy to apply :-) It seems to have recovered by mid-day (UTC) when I had an unattended batch fetch succeed, and I've repeated my tests once I noticed that (18:00 UTC) and JSON fetching is still o.k.

It would be interesting to know what causes this fault to happen, and whether it is preventable...

Cheers - Al.
----------------------------------------
[Edit 4 times, last edit by alanb1951 at Feb 4, 2024 6:45:49 PM]
[Feb 4, 2024 4:57:07 AM]   Link   Report threatening or abusive post: please login first  Go to top 
[ Jump to Last Post ]
Post new Thread