Error in post-index-task script while data ingestion

I am trying to ingest data in Druid via command line using script “post-index-task” but it is giving syntax error in script.

File “/home/ubuntu/apache-druid-0.16.0-incubating/bin/post-index-task-main”, line 35
except Exception, e:
^
SyntaxError: invalid syntax

In other machine I tried with Druid installation and it is working fine, no syntax error is coming. Why is this error coming in one machine and not in another?

Are you trying with the exact same ingestion on both the machines?
Seems you have got an invalid JSON file in another machine where it’s failing or some syntax error.

Thanks and regards,

Vaibhav

Yes, I am trying with same json spec.
It is saying syntax error in “post-index-task-main”.

So you mean to say :

You have installed druid 0.16 on two different machines one machine works fine another has a consistent issue while you run ingestion.

If this is the case :

Could you provide below :

  1. Ingestion specs file from nonworking and working machine.

  2. ingestion Command you are using.

  3. post-index-task-main from both machines.

Just rename all the files with Working/Nonworking prefixes.

Thanks,

Vaibhav

I am using following command “sh post-index-task --file cmh_jason_spec.json --url http://:8081
I have uploaded the files.

cmh_jason_spec.json (1.1 KB)

post-index-task-main_non-working (7.77 KB)

post-index-task-main_non-working (7.77 KB)

Hey Hemant,

Can you try running following command

sh post-index-task --file cmh_jason_spec.json --url http://:8888

Thank you,

Niraj Dedhia

Hi Niraj,

I tried it but same error. I don’t think its related to port number. I also checked if something is not installed properly on system but so far did not find anything causing problem.

Ok, I was able to solve the syntax error. It was due to because “pip” package was not installed on system, “pip3” was installed. After installing “pip” syntax error gone. Now I am getting another error while running same command:
Beginning indexing data for center_metrics_history
Waiting up to 119s for indexing service [:8081] to become available. [Got: <urlopen error unknown url type:
> ]
Waiting up to 114s for indexing service
[:8081] to become available. [Got: <urlopen error unknown url type: > ]
Waiting up to 109s for indexing service
[:8081] to become available. [Got: <urlopen error unknown url type: > ]

Hi Hemanth,
Generally ingestion tasks are submitted to overlord which runs on 8090 port.

8081 is where coordinator runs.

Can you submit your ingestion job to 8090 port?

Thanks,

–siva

Can you also check your python version please?