简体   繁体   English

从 Google Vault API 导出查询结果时的 FAILD 状态

[英]FAILD status when export query result from Google Vault API

I'm using Google Vault API (python script) to query message data from google chat.我正在使用 Google Vault API(python 脚本)从 Google 聊天中查询消息数据。 I have about 1800 emails but when I queried from the 1000th email to 1050th email, the export status returned FAILED without any error message and there was no error message.我有大约 1800 封电子邮件,但是当我从第 1000 个 email 到第 1050 个 email 查询时,导出状态返回 FAILED,没有任何错误消息,也没有错误消息。 Then when I queried from 1050th to 1100th email, the file was exported normally.然后我从第1050到第1100查询email,文件正常导出。

Considering that there are some anomalies in the emails from 1000 to 1050, I tried to queried from 1000 to 1010, from 1010 to 1020,… from 1040 to 1050. But at this time they all worked!考虑到从1000到1050的邮件有一些异常,我尝试从1000到1010,从1010到1020,……从1040到1050进行查询。但是此时它们都起作用了!

I need to build a system to automate this process, so I cannot do it manually like this and query by each 10 emails is so time-consuming.我需要建立一个系统来自动化这个过程,所以我不能像这样手动完成,而且每 10 封电子邮件查询非常耗时。 So please help me to figure out what was wrong so that I can query all 1800 emails at once without FAIED status.因此,请帮助我找出问题所在,以便我可以一次查询所有 1800 封电子邮件而无需 FAIED 状态。

Here is my query code:这是我的查询代码:

def create_mail_all_data_export(service, matter_id,start_date,end_date,name):
    df = pd.read_csv("data_users_2.csv")
    email_list = list(df["email"])
    email_str = ",".join(email_list)
    #print(email_str)
    """
    全社員のメールエクスポートを作成
    Args:
        service : v1 vaultでbuildされたサービス
        matter_id : vault案件id
        start_date : 検索開始日時
        end_date : 検索修了日時
        name : ファイル名接頭語
    """

    hangout_query_options = {"includeRooms": True}
    hangout_query = {
        'corpus': 'HANGOUTS_CHAT',
        'dataScope': 'ALL_DATA',
        'searchMethod': 'ACCOUNT',
        'accountInfo': {
            "emails": [email_list[1000:1050]]
            # "emails": [
            #     "ga4399hy@g.tdi.co.jp",
            #     "ga6351ob@g.tdi.co.jp"
            #     #email_list
            # ]
        },
        'timeZone':"Japan",
        "startTime":start_date,
        "endTime":end_date,
        'hangoutsChatOptions': hangout_query_options,
    }
    hangout_export_options = {
      'exportFormat': 'MBOX'
      }
    wanted_export = {
        'name': name,
        'query': hangout_query,
        'exportOptions': {
            'hangoutsChatOptions': hangout_export_options
            }
        }
    return service.matters().exports().create(
    matterId=matter_id, body=wanted_export).execute()

Most likely you running into quota limit issues您很可能遇到配额限制问题

Check your quota and compare them with your usage.检查您的配额并将其与您的使用情况进行比较。

For this为了这

在此处输入图像描述


  • And your quota:还有你的配额:

在此处输入图像描述


  • If you expand the different categories, you can also see your current quota per minute:如果您展开不同的类别,您还可以看到您当前的每分钟配额:

在此处输入图像描述

However, if you are exceeding the per minute quota, the best solution would be to modify your code in such a way that it runs slower.但是,如果您超过了每分钟的配额,最好的解决方案是修改您的代码,使其运行速度变慢。 A good way to do so would be to use Exponential Backoff .这样做的一个好方法是使用Exponential Backoff

Note: The per minute quotas actually can be exceeded for a short amount of time, but once they are exceeded they can take up to 24 hours to be established.注意:每分钟配额实际上可以在短时间内超出,但一旦超出,最长可能需要 24 小时才能建立。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用 Python API 创建文件后,如何立即从 Google Vault 导出下载文件? - How to download files from Google Vault export immediately after creating it with Python API? 有没有办法从 Google Vault Export 下载导出的数据? - Is there any way to download exported data from a Google Vault Export? 特定用户的Google Drive导出(Google保险柜) - Google Drive Export (Google Vault) for Specific User Google Vault Api 的速率限制是多少? - What is the rate limit on Google Vault Api? Google Bigquery API:如何将结果查询添加到Table? - Google Bigquery API: How to add result query to Table? google.appengine.api.taskqueue有效负载参数可以作为查询结果吗? - Can google.appengine.api.taskqueue payload argument be query result? 有没有办法将sqlite查询结果导出到Python中的csv中 - Is there a way to export sqlite query result into a csv in Python 为什么QPX查询结果与Google Flights中的查询结果不同? - Why does a QPX query result differ from that in Google Flights? Google place API(地理编码)的搜索结果不正确 - Inaccurate search result from Google place API (Geocoding) 如何处理从谷歌语音到文本 API 的结果 - How to work with result from google speech to text API
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM