本文介绍了使用服务帐户请求谷歌大查询API时发生HTTP错误500的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在一直在使用Big query来通过Web服务生成报表,但是在过去的一个月左右,我已经注意到HTTP 500错误响应我的大部分查询请求,即使没有对其进行更改Web服务。在我目前的设置中,我做了5个同时查询,并且通常5个查询中有4个失败,出现500错误。有时候,所有5个查询都会返回,但最近这种情况很少发生,导致我的应用程序几乎无法使用。

I have been using Big query to generate reports through a web service for a year now, however in the past month or so I have noticed HTTP 500 errors in response to most of my query requests even though no changes have been made to the web service. In my current setup I make 5 simultaneous queries and often 4 out of the 5 queries fail with 500 error. At times all 5 queries are returned but in recent times this rarely happens rendering my application almost unusable.

我使用服务器到服务器身份验证,使用我的服务帐户令牌和我的大查询客户端应用程序严格模拟此处给出的示例 -

I use server to server authentication using my service account token and my big query client app is closely modeled on the example given here -

以下是完整的错误讯息 -

Here is the full error message -

我的bigquery客户端的代码片段 -

Snippet of my bigquery client -

def generateToken():
    """
    generates OAuth2.0 token/credentials for login to google big query
    """
    credentials = SignedJwtAssertionCredentials(
        SERVICE_ACCOUNT_EMAIL,
        KEY,
        "https://www.googleapis.com/auth/bigquery")
    return credentials

class BigQueryClient(object):
    def authenticate(self, credentials):
        http = httplib2.Http(proxy_info = httplib2.ProxyInfo(
                                 socks.PROXY_TYPE_HTTP,
                                 PROXY_IP,
                                 PROXY_PORT))
        http = credentials.authorize(http)
        return http

    def __init__(self, credentials, project):
        http = self.authenticate(credentials)
        self.service = build('bigquery', 'v2', http=http)

请让我知道如果我做错了什么在这里,或者如果bigquery后端上的任何内容发生了变化,例如限制在特定时间段内允许的查询请求的数量。

Please let me know if I am doing something incorrectly here or if anything has changed on the bigquery backend such as limits to the number of query requests allowed over a certain period of time.

谢谢。

推荐答案

500s始终是BigQuery的错误。我相信我已经查明了BigQuery服务器日志中的一个错误,并且正在调查。

500s are always BigQuery bugs. I believe I've tracked down one of your errors in the BigQuery server logs, and am investigating.

这篇关于使用服务帐户请求谷歌大查询API时发生HTTP错误500的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-07 09:14