问题
Example:
Courses.Get successfully gets the course like this:
Request
GET https://classroom.googleapis.com/v1/courses/1053592526?key={YOUR_API_KEY}
Response
200
- HIDE HEADERS -
cache-control: private
content-encoding: gzip
content-length: 232
content-type: application/json; charset=UTF-8
date: Wed, 27 Apr 2016 11:45:29 GMT
server: ESF
vary: Origin, X-Origin, Referer
{
"id": "1053592526",
"name": "Test course 18",
"ownerId": "118150671162893595524",
"creationTime": "2016-03-11T12:49:19.459Z",
"updateTime": "2016-03-11T12:49:18.734Z",
"enrollmentCode": "aaiauvf",
"courseState": "ACTIVE",
"alternateLink": "http://classroom.google.com/c/MTA1MzU5MjUyNlpa"
}
Deleting it however gives the following:
Request
DELETE https://classroom.googleapis.com/v1/courses/1053592526?key={YOUR_API_KEY}
Response
500
- HIDE HEADERS -
cache-control: private
content-encoding: gzip
content-length: 104
content-type: application/json; charset=UTF-8
date: Wed, 27 Apr 2016 11:47:21 GMT
server: ESF
vary: Origin, X-Origin, Referer
{
"error": {
"code": 500,
"message": "Internal error encountered.",
"status": "INTERNAL"
}
}
Result is the same through code or through the web interface at https://developers.google.com/classroom/reference/rest/v1/courses/delete?authuser=0#try-it
This seems to happen if the user behind the OwnerId no longer exists. It only happens to some old courses that have been lying around for some time, and the owner have been deleted long ago. I also tried adding a teacher to the course, but the result is still the same. I did also try to create a new course with an ownerId referencing an existing user, deleting the user and finally deleting the course. Works.
There are 20 something courses on the domain that this happens for. I was able to delete another 50 something courses where the owning users still existed.
So, is this a bug that we can have fixed? And if not, how do I get rid of the courses?
回答1:
It looks like this is a bug. Can you please file an issue for it?
来源:https://stackoverflow.com/questions/36888984/500-internal-server-error-when-trying-to-delete-certain-courses