0

I'm using rabbitmq and Calendar API to push events to the calendar, I'm getting the following error while creating a new event to push to the calendar. The log is below:

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)

Any solution will be appreciated. Thanks in Advance

samuel vishal
  • 135
  • 1
  • 6
  • Hi ! Could you please share a sample of your script (*with no sensitive data*) so that we can understand better where the issue is? Also, taking into account the little information provided and the type of error make sure you have access to that calendar and that the calendar events you are pushing exist or are created properly, [check this](https://developers.google.com/calendar/v3/errors#404_not_found) for more information regarding this error. You can also troubleshoot doing an [exponential backoff](https://developers.google.com/drive/api/v3/handle-errors#exponential-backoff) :D – Mateo Randwolf May 06 '20 at 07:47
  • Hey thanks for your input, I fixed it, i missed to pass the impersonate user, such a silly one. – samuel vishal May 06 '20 at 13:57
  • Hi ! In that case could you please leave that information as an answer to this question so that people with the same issue can find easily this (and maybe they will check also their impersonation part to make sure it is ok). – Mateo Randwolf May 08 '20 at 07:05

1 Answers1

0

Added .createDelegated(String User) to the ServiceaccountCredentials object.

Mateo Randwolf
  • 2,823
  • 1
  • 6
  • 17
samuel vishal
  • 135
  • 1
  • 6