【问题标题】:Errors on google cloud api - Uncaught exception 'Google_Service_Exception'谷歌云 api 上的错误 - 未捕获的异常“Google_Service_Exception”
【发布时间】:2023-04-09 01:52:01
【问题描述】:

我正在使用谷歌云 API。

以下错误使我的页面空白。调试日志文件在加载每个空白页时显示以下错误。

Fatal error:  Uncaught exception 'Google_Service_Exception' with message '{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "backendError",
    "message": "Backend Error"
   }
  ],
  "code": 500,
  "message": "Backend Error"
 }
}
' in /var/www/html/wp-content/plugins/test/google_api/src/Google/Http/REST.php:123
Stack trace:
#0 /var/www/html/wp-content/plugins/test/google_api/src/Google/Http/REST.php(82): Google_Http_REST::decodeHttpResponse(Object(GuzzleHttp\Psr7\Response), Object(Guzz
leHttp\Psr7\Request), 'Google_Service_...')
#1 [internal function]: Google_Http_REST::doExecute(Object(GuzzleHttp\Client), Object(GuzzleHttp\Psr7\Request), 'Google_Service_...')
#2 /var/www/html/wp-content/plugins/test/google_api/src/Google/Task/Runner.php(181): call_user_func_array(Array, Array)
#3 /var/www/html/wp-content/plugins/test/google_api/src/Google/Http/REST.php(57): Google_Task_Runner->run()
#4 /var/www/html/wp-content/plugins/test/google_api/src/Google/Client.p in /var/www/html/wp-content/plugins/test/google_api/src/Google/Http/REST.php on li
ne 123

Fatal error:  Uncaught exception 'Google_Service_Exception' with message 'Not Found' in /var/www/html/wp-content/plugins/test/google_api/src/Google/Http/REST.php:123
Stack trace:
#0 /var/www/html/wp-content/plugins/test/google_api/src/Google/Http/REST.php(82): Google_Http_REST::decodeHttpResponse(Object(GuzzleHttp\Psr7\Response), Object(Guzz
leHttp\Psr7\Request), 'Google_Service_...')
#1 [internal function]: Google_Http_REST::doExecute(Object(GuzzleHttp\Client), Object(GuzzleHttp\Psr7\Request), 'Google_Service_...')
#2 /var/www/html/wp-content/plugins/test/google_api/src/Google/Task/Runner.php(181): call_user_func_array(Array, Array)
#3 /var/www/html/wp-content/plugins/test/google_api/src/Google/Http/REST.php(57): Google_Task_Runner->run()
#4 /var/www/html/wp-content/plugins/test/google_api/src/Google/Client.php(758): Google_Http_REST::execute(Object(GuzzleHttp\Client), Object(GuzzleHttp\Psr7\Request)
, 'Google_Service_...', Array)
#5 /var/www/html/wp-content/plugins/test in /var/www/html/wp-content/plugins/test/google_api/src/Google/Http/REST.php on line 123

我认为这两个错误是相关的。 提前致谢。

【问题讨论】:

  • “未捕获异常 'Google_Service_Exception' 并带有消息 '未找到'”。在不知道您要做什么的情况下,仅共享错误消息并没有太大帮助。我只能说,无论您尝试访问什么,它都不存在,至少不在您期望的位置。

标签: php google-api google-cloud-platform google-cloud-sql


【解决方案1】:

我假设您使用的是Google APIs Client Library for PHP。如果是这样,您可以直接report this issue 给开发此库的工程师。

我确实看到similar reports 解决方案是用户端代码修复。 'Google_Service_Exception' 表示您发出的请求未经过身份验证,帖子正文无效/格式错误,和/或发出的网址无效。

因此,我建议您尝试进一步调试代码,以查看代码的哪一行引发了此错误。确保您是using the library properly,并且您的API request 是正确的。还要确保您使用的是库的latest version

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-08-25
    • 1970-01-01
    • 2017-05-22
    相关资源
    最近更新 更多