Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Google Drive]Add flow/route/step id to flow log #308

Closed
Hooghof opened this issue Nov 7, 2024 · 4 comments · Fixed by assimbly/custom-components#126
Closed

[Google Drive]Add flow/route/step id to flow log #308

Hooghof opened this issue Nov 7, 2024 · 4 comments · Fixed by assimbly/custom-components#126
Assignees
Milestone

Comments

@Hooghof
Copy link

Hooghof commented Nov 7, 2024

The Inbound Google Drive route of a flow gives the error below in the backend, but it is not possible to identify this flow as well in the flow manager as in the backend.

To solve the problem:

  1. It should be fine if the frontend shows failed exchanges
  2. It should be fine if the backend shows a flow ID
2024-11-07T10:26:31.604Z  INFO 1 --- [gateway] [00e000000_timer] o.a.runtime.667d07fbcc90b4000e000000     : Exchange[
]
2024-11-07T10:26:32.175Z ERROR 1 --- [gateway] [ googledrive://] o.a.googledrive.GoogleDriveConsumer      : GoogleJsonResponseException occurred. Connect to Google Drive directory failed:

com.google.api.client.googleapis.json.GoogleJsonResponseException: 401 Unauthorized
GET https://www.googleapis.com/drive/v3/files?q='1yKUGTe_TW38Westyebaw3h9W-g48h-rN'%20in%20parents%20and%20mimeType%20%3D%20'application/vnd.google-apps.folder'%20and%20trashed%20%3D%20false%20and%20name%20%3D%20'.dovetail'
{
  "code": 401,
  "errors": [
    {
      "domain": "global",
      "location": "Authorization",
      "locationType": "header",
      "message": "Invalid Credentials",
      "reason": "authError"
    }
  ],
  "message": "Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.",
  "status": "UNAUTHENTICATED"
}
	at com.google.api.client.googleapis.json.GoogleJsonResponseException.from(GoogleJsonResponseException.java:146)
	at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:118)
	at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:37)
	at com.google.api.client.googleapis.services.AbstractGoogleClientRequest$3.interceptResponse(AbstractGoogleClientRequest.java:479)
	at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1111)
	at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:565)
	at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:506)
	at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:616)
	at org.assimbly.googledrive.GoogleDriveConsumer.findMoveToDirectory(GoogleDriveConsumer.java:191)
	at org.assimbly.googledrive.GoogleDriveConsumer.findOrCreateMoveToDirectory(GoogleDriveConsumer.java:178)
	at org.assimbly.googledrive.GoogleDriveConsumer.poll(GoogleDriveConsumer.java:63)
	at org.apache.camel.support.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:205)
	at org.apache.camel.support.ScheduledPollConsumer.run(ScheduledPollConsumer.java:119)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
	at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:358)
	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
	at java.base/java.lang.Thread.run(Thread.java:1583)
@Hooghof Hooghof added this to the 5.0.1 milestone Nov 7, 2024
@brunovg brunovg self-assigned this Nov 11, 2024
@skin27
Copy link
Member

skin27 commented Nov 13, 2024

There are two ways to solve this:

  1. Adjust code of the component to include the flowid
  2. Catch the error within the route and print the flowid/stepid (based on the routeid)

Option two is for example done within the HTTP component (for example on certain errors) and would be preferred.

@brunovg
Copy link
Collaborator

brunovg commented Nov 14, 2024

The 2nd option was also my first choice/attempt, but GoogleDriveConsumer extends from ScheduledPollConsumer, and the throwing errors are being consumed internally, and adding a onException on route level, doesn't catch the error.

So, I implemented the 1st option.

PR's:
https://github.com/dovetailworld/front-end/pull/4902
assimbly/custom-components#126

@brunovg
Copy link
Collaborator

brunovg commented Nov 15, 2024

Also add an entry on the Flow Manager Logs.

@brunovg
Copy link
Collaborator

brunovg commented Nov 15, 2024

That log line is already being displayed on the Flow Manager logs of that flow:

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment