【问题标题】:Google Calendar API: com.google.api.client.googleapis.json.GoogleJsonResponseException: 404 Not FoundGoogle 日历 API:com.google.api.client.googleapis.json.GoogleJsonResponseException:404 未找到
【发布时间】:2020-05-05 20:33:01
【问题描述】:

我正在使用 rabbitmq 和 Calendar API 将事件推送到日历,在创建要推送到日历的新事件时出现以下错误。日志如下:

18:22:10.210 [pool-1-thread-3] INFO  c.q.c.rabbitmq.RabbitMQEventConsumer - Received message of type class com.qpercom.model.CreateOrUpdateEventMessage on event (185, omis19demo)
18:22:10.718 [pool-1-thread-3] INFO  com.zaxxer.hikari.HikariDataSource - googleApiDb - Starting...
18:22:10.956 [pool-1-thread-3] INFO  com.zaxxer.hikari.HikariDataSource - googleApiDb - Start completed.
18:22:12.293 [pool-1-thread-3] INFO  c.q.c.google.GoogleCalendarPusher - Creating event in Google Calendar
18:22:12.389 [pool-1-thread-3] INFO  c.q.c.google.GoogleCalendarPusher - Instantiating Google Calendar Service...
18:22:13.628 [pool-1-thread-3] ERROR c.q.c.rabbitmq.RabbitMQEventConsumer - Failed pushing event. The message has been re-queued. Trace of exception: com.google.api.client.googleapis.json.GoogleJsonResponseException: 404 Not Found
{
  "code" : 404,
  "errors" : [ {
    "domain" : "global",
    "message" : "Not Found",
    "reason" : "notFound"
  } ],
  "message" : "Not Found"
}
18:22:13.630 [pool-1-thread-3] ERROR c.r.c.impl.ForgivingExceptionHandler - Consumer com.qpercom.consumer.rabbitmq.RabbitMQEventConsumer$$anon$1@2c239f25 (amq.ctag-DEd0iKxMhKd8bqZ9tvET7w) method handleDelivery for channel AMQChannel(amqp://zdMBDgTdd9fMMJft@3.249.159.145:5672/,1) threw an exception for channel AMQChannel(amqp://zdMBDgTdd9fMMJft@3.249.159.145:5672/,1)
com.google.api.client.googleapis.json.GoogleJsonResponseException: 404 Not Found
{
  "code" : 404,
  "errors" : [ {
    "domain" : "global",
    "message" : "Not Found",
    "reason" : "notFound"
  } ],
  "message" : "Not Found"
}
    at com.google.api.client.googleapis.json.GoogleJsonResponseException.from(GoogleJsonResponseException.java:150)
    at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:113)
    at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:40)
    at com.google.api.client.googleapis.services.AbstractGoogleClientRequest$1.interceptResponse(AbstractGoogleClientRequest.java:444)
    at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1108)
    at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:542)
    at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:475)
    at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:592)
    at com.qpercom.calendar.google.GoogleCalendarPusher.doCreate(GoogleCalendarPusher.scala:61)
    at com.qpercom.calendar.google.GoogleCalendarPusher.doCreate(GoogleCalendarPusher.scala:25)
    at com.qpercom.calendar.AbstractAPICalendarPusher.pushCreateOrUpdate(AbstractAPICalendarPusher.scala:74)
    at com.qpercom.App$$anonfun$main$1.apply(App.scala:26)
    at com.qpercom.App$$anonfun$main$1.apply(App.scala:22)
    at com.qpercom.consumer.rabbitmq.RabbitMQEventConsumer$$anon$1.handleDelivery(RabbitMQEventConsumer.scala:49)
    at com.rabbitmq.client.impl.ConsumerDispatcher$5.run(ConsumerDispatcher.java:149)
    at com.rabbitmq.client.impl.ConsumerWorkService$WorkPoolRunnable.run(ConsumerWorkService.java:100)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

任何解决方案将不胜感激。提前致谢

【问题讨论】:

  • 嗨!您能否分享您的脚本示例(没有敏感数据),以便我们更好地了解问题所在?此外,考虑到提供的少量信息和错误类型,请确保您可以访问该日历并且您正在推送的日历事件存在或创建正确,check this 以获取有关此错误的更多信息。您还可以通过exponential backoff 进行故障排除:D
  • 嘿,感谢您的意见,我已修复它,我错过了通过模拟用户,这样一个愚蠢的。
  • 嗨!在这种情况下,您能否留下该信息作为此问题的答案,以便有相同问题的人可以轻松找到此信息(也许他们还会检查他们的模拟部分以确保它没问题)。

标签: rabbitmq google-calendar-api google-api-js-client google-json-api


【解决方案1】:

ServiceaccountCredentials 对象添加了.createDelegated(String User)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-08-09
    • 1970-01-01
    • 1970-01-01
    • 2018-07-04
    相关资源
    最近更新 更多