apache / drill

Apache Drill is a distributed MPP query layer for self describing data
https://drill.apache.org/
Apache License 2.0
1.95k stars 979 forks source link

Can't configure Mongo UL with query parameter #2942

Closed mathieuruellan closed 2 months ago

mathieuruellan commented 2 months ago

Before submitting a bug report, please verify that you are using the most current version of Drill.

Describe the bug I'm configuring the mongo connector with an url containing query parameters. The JSON is rejected because "invalid"

To Reproduce Steps to reproduce the behavior:

  1. Go to Drill UI/Storage/Mongo/Update

  2. edit the json and enter a valid mongo url with query parameter for instance: "connection": mongodb+srv://admin:XXXXXX@localhost:4117/myDB?readPreference=secondaryPreferred",

  3. See error Please retry: Invalid JSON: Failure when decoding plugin JSON

image

mathieuruellan commented 2 months ago

(the screenshot has a typo with a missing quote), but the issue is still valid

cgivre commented 2 months ago

@mathieuruellan I think the batchSize is not a valid parameter. Try removing that and see if it works. The problem that you're having is that you've added some parameter that doesn't exist in the Mongo config.

mathieuruellan commented 2 months ago

@cgivre thank you for your answer. It changes nothing, and i can't make it work with batchsize.

image

The same without query parameters is ok:

image

cgivre commented 2 months ago

@mathieuruellan Sorry.. I haven't worked with Drill and Mongo in some time. Let's try a few things:

  1. Execute the command !verbose in Drill's command line and see what kind of errors we're getting.
  2. It looks like the issue is in the connection string and that Drill or Mongo isn't liking one of the arguments. Can you try adding the arguments one by one to see if it is a specific argument that Drill isn't liking or whether Drill isn't liking the options at all. Ideally, what I'm hoping we can get is a stack trace in the CLI that is more helpful than the crappy error message in the user interface.
mathieuruellan commented 2 months ago

Actually, it was a specific parameter "authMechanism=DEFAULT" not supported because the driver and its mongo url parser is old. Problem solved.