Error when listing files with query

后端 未结 3 2050
心在旅途
心在旅途 2021-01-23 11:19

When I try to retrieve a folder by listing with differents query criterias, in Python, I get an error HTTP 500 \"Internal error\".

The code to request the f

相关标签:
3条回答
  • 2021-01-23 11:45

    I'm finding the same issue, and it has nothing to do with backing off or waiting... The API explorer works perfectly, but a URL in the next tab, developed from the explorer, fails every time. Not often... always!

    The issue seems to be related to the query being more complex than a single item. e.g. if I ask for name= or something in parent then it works. If I combine both with "and" then it fails.

    For example:

    https://www.googleapis.com/drive/v3/files?q=%270B0ap0WDOII5mbjdwajNBMlRoZUU%27+in+parents&key={my key}

    works fine, but

    https://www.googleapis.com/drive/v3/files?q=%270B0ap0WDOII5mbjdwajNBMlRoZUU%27+in+parents+and+name%3D%27test.TXT%27&key={my key}

    fails with

    {
     "error": {
      "errors": [
       {
        "domain": "global",
        "reason": "internalError",
        "message": "Internal Error"
       }
      ],
      "code": 500,
      "message": "Internal Error"
     }
    }
    

    Note that both of those URLs are copied directly from the "API's Explorer" section of https://developers.google.com/drive/v3/reference/files/list with my API key added to the end of each.

    It also fails in exactly the same way with the v2 interface.

    Could there be a bug in the API? Having to do with files in a public folder?

    0 讨论(0)
  • 2021-01-23 12:01

    G recommends that your app should backoff and retry 500 errors. Did you try this and does it persistently fail on the retry?

    0 讨论(0)
  • 2021-01-23 12:05

    It's a known issue with drive.file scope, use drive.readonly.metadata additionally for queries.

    Edit: It looks like the query is also broken with drive.appdata scope. I'm making sure that we're fixing it as soon as possible.

    0 讨论(0)
提交回复
热议问题