It does not allow to update table through data ingestion from the command line

Greetings, we are starting with the implementation of druid in the company.

So far all the operations that we do from the console work ok, but we have not been able to automate the tasks through the command line.
I want to update the data of a table from the command line.

For this, we are executing the following statement:

bin/post-index-task --file quickstart/tutorial/Navegacion_Categorias.json --url http://localhost:8081

and the answer is

Beginning indexing data for Navegacion_Categorias
Traceback (most recent call last):
File “/var/apache/druid/apache-druid-0.22.1/bin/post-index-task-main”, line 174, in
main()
File “/var/apache/druid/apache-druid-0.22.1/bin/post-index-task-main”, line 158, in main
task_id = json.loads(post_task(args, task_contents, submit_timeout_at))[“task”]
File “/var/apache/druid/apache-druid-0.22.1/bin/post-index-task-main”, line 58, in post_task
raise_friendly_error(e)
File “/var/apache/druid/apache-druid-0.22.1/bin/post-index-task-main”, line 109, in raise_friendly_error
raise Exception(“HTTP Error {0}: {1}, check overlord log for more details.\n{2}”.format(e.code, e.reason, text))
Exception: HTTP Error 401: Unauthorized, check overlord log for more details.
{“error”:“Unauthorized request”,“errorMessage”:null,“errorClass”:null,“host”:“ip-10-32-50-45.ec2.internal”}

Initially I thought it was the port and tried 8081, 8082, 8083, 8888 but the result is the same

From the console the process works perfectly and performs the update task

The version I use is 0.22.1

thanks for your help

Hi @tiactualicese,

Welcome to the Druid Forum.

Is this a test on the local deployment? How did you start the cluster?
Could you share a screenshoot of your “Services” view from the console?

Normally an ingestion job request can be submitted to the Router service or directly to the Overlord service. What ports are they on?

Let us know how else we can help to get you started with Druid.

I was able to find the solution.

Run the task with the curl command. Then run it adding to the parameters the username and password to access druid

curl -u name_user:password_user -X ‘POST’ -H ‘Content-Type:application/json’ -d @quickstart/tutorial/prueba.json http://3.227.225.42:8081/druid/indexer/v1/task

{“task”:“index_parallel_WooCommerce_Ventas_bcjlhkgc_2022-07-29T23:28:59.734Z”}

2 Likes

Hi @Sergio_Ferragut

I attach the services view from the console

Thanks

Thanks for the screenshot. Your issue was clearly authentication, but I’ll just point out that:

  • Since an ingestion is an overlord request, you can (as you did) send it to the overlord at port 8081.

or

  • You could also use the router at port 8888 and the router will forward the request to the appropriate service.
1 Like