You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by Brett Rann <br...@zendesk.com.INVALID> on 2018/01/01 00:51:27 UTC

Re: Partition reassignment data file is empty

That's happening because your JSON is malformed. Losing the last comma will
fix it.

On Sun, Dec 31, 2017 at 3:43 PM, allen chan <al...@gmail.com>
wrote:

> Hello
>
> Kafka Version: 0.11.0.1
>
> I am trying to increase replication factor for a topic and i am getting the
> below error. Can anyone help explain what the error means? The json is not
> empty
>
> $ cat increase-replication-factor.json
> {"version":1,
>   "partitions":[
>      {"topic":"metrics","partition":0,"replicas":[1,2]},
>      {"topic":"metrics","partition":1,"replicas":[2,3]},
> ]}
>
> $ sudo /opt/kafka/kafka_2.12-0.11.0.1/bin/kafka-reassign-partitions.sh
> --zookeeper server1:2181 --reassignment-json-file
> increase-replication-factor.json --execute
> Partitions reassignment failed due to Partition reassignment data file is
> empty
> kafka.common.AdminCommandFailedException: Partition reassignment data file
> is empty
> at
> kafka.admin.ReassignPartitionsCommand$.parseAndValidate(
> ReassignPartitionsCommand.scala:188)
> at
> kafka.admin.ReassignPartitionsCommand$.executeAssignment(
> ReassignPartitionsCommand.scala:158)
> at
> kafka.admin.ReassignPartitionsCommand$.executeAssignment(
> ReassignPartitionsCommand.scala:154)
> at
> kafka.admin.ReassignPartitionsCommand$.main(ReassignPartitionsCommand.
> scala:51)
> at
> kafka.admin.ReassignPartitionsCommand.main(ReassignPartitionsCommand.
> scala)
>
> Thanks
> --
> Allen Michael Chan
>



-- 

Brett Rann

Senior DevOps Engineer


Zendesk International Ltd

395 Collins Street, Melbourne VIC 3000 Australia

Mobile: +61 (0) 418 826 017

Re: Partition reassignment data file is empty

Posted by Ted Yu <yu...@gmail.com>.
I logged KAFKA-6413 for improving error message
w.r.t. ReassignPartitionsCommand#parsePartitionReassignmentData()

FYI

On Sun, Dec 31, 2017 at 10:24 PM, allen chan <al...@gmail.com>
wrote:

> Absolutely user error. Works after i removed the erroneous comma. Wish the
> error message was more obvious.
> Thanks Brett and Ted!
>
> On Sun, Dec 31, 2017 at 6:29 PM, Ted Yu <yu...@gmail.com> wrote:
>
> > I verified that Brett said thru this code:
> >
> >     val (partitionsToBeReassigned, replicaAssignment) =
> > ReassignPartitionsCommand.parsePartitionReassignmentData(
> >
> >         "{\"version\":1,\"partitions\":[{\"topic\":\"metrics\",\"
> > partition\"
> > :0,\"replicas\":[1,2]},{\"topic\":\"metrics\",\"
> partition\":1,\"replicas\"
> > :[2,3]},]}");
> >
> >
> > partitionsToBeReassigned was empty.
> >
> > I think parsePartitionReassignmentData() should be improved to give
> better
> > error information.
> >
> >
> > FYI
> >
> > On Sun, Dec 31, 2017 at 4:51 PM, Brett Rann <br...@zendesk.com.invalid>
> > wrote:
> >
> > > That's happening because your JSON is malformed. Losing the last comma
> > will
> > > fix it.
> > >
> > > On Sun, Dec 31, 2017 at 3:43 PM, allen chan <
> > allen.michael.chan@gmail.com>
> > > wrote:
> > >
> > > > Hello
> > > >
> > > > Kafka Version: 0.11.0.1
> > > >
> > > > I am trying to increase replication factor for a topic and i am
> getting
> > > the
> > > > below error. Can anyone help explain what the error means? The json
> is
> > > not
> > > > empty
> > > >
> > > > $ cat increase-replication-factor.json
> > > > {"version":1,
> > > >   "partitions":[
> > > >      {"topic":"metrics","partition":0,"replicas":[1,2]},
> > > >      {"topic":"metrics","partition":1,"replicas":[2,3]},
> > > > ]}
> > > >
> > > > $ sudo /opt/kafka/kafka_2.12-0.11.0.1/bin/kafka-reassign-
> partitions.sh
> > > > --zookeeper server1:2181 --reassignment-json-file
> > > > increase-replication-factor.json --execute
> > > > Partitions reassignment failed due to Partition reassignment data
> file
> > is
> > > > empty
> > > > kafka.common.AdminCommandFailedException: Partition reassignment
> data
> > > file
> > > > is empty
> > > > at
> > > > kafka.admin.ReassignPartitionsCommand$.parseAndValidate(
> > > > ReassignPartitionsCommand.scala:188)
> > > > at
> > > > kafka.admin.ReassignPartitionsCommand$.executeAssignment(
> > > > ReassignPartitionsCommand.scala:158)
> > > > at
> > > > kafka.admin.ReassignPartitionsCommand$.executeAssignment(
> > > > ReassignPartitionsCommand.scala:154)
> > > > at
> > > > kafka.admin.ReassignPartitionsCommand$.main(
> ReassignPartitionsCommand.
> > > > scala:51)
> > > > at
> > > > kafka.admin.ReassignPartitionsCommand.main(
> ReassignPartitionsCommand.
> > > > scala)
> > > >
> > > > Thanks
> > > > --
> > > > Allen Michael Chan
> > > >
> > >
> > >
> > >
> > > --
> > >
> > > Brett Rann
> > >
> > > Senior DevOps Engineer
> > >
> > >
> > > Zendesk International Ltd
> > >
> > > 395 Collins Street, Melbourne VIC 3000 Australia
> > >
> > > Mobile: +61 (0) 418 826 017
> > >
> >
>
>
>
> --
> Allen Michael Chan
>

Re: Partition reassignment data file is empty

Posted by allen chan <al...@gmail.com>.
Absolutely user error. Works after i removed the erroneous comma. Wish the
error message was more obvious.
Thanks Brett and Ted!

On Sun, Dec 31, 2017 at 6:29 PM, Ted Yu <yu...@gmail.com> wrote:

> I verified that Brett said thru this code:
>
>     val (partitionsToBeReassigned, replicaAssignment) =
> ReassignPartitionsCommand.parsePartitionReassignmentData(
>
>         "{\"version\":1,\"partitions\":[{\"topic\":\"metrics\",\"
> partition\"
> :0,\"replicas\":[1,2]},{\"topic\":\"metrics\",\"partition\":1,\"replicas\"
> :[2,3]},]}");
>
>
> partitionsToBeReassigned was empty.
>
> I think parsePartitionReassignmentData() should be improved to give better
> error information.
>
>
> FYI
>
> On Sun, Dec 31, 2017 at 4:51 PM, Brett Rann <br...@zendesk.com.invalid>
> wrote:
>
> > That's happening because your JSON is malformed. Losing the last comma
> will
> > fix it.
> >
> > On Sun, Dec 31, 2017 at 3:43 PM, allen chan <
> allen.michael.chan@gmail.com>
> > wrote:
> >
> > > Hello
> > >
> > > Kafka Version: 0.11.0.1
> > >
> > > I am trying to increase replication factor for a topic and i am getting
> > the
> > > below error. Can anyone help explain what the error means? The json is
> > not
> > > empty
> > >
> > > $ cat increase-replication-factor.json
> > > {"version":1,
> > >   "partitions":[
> > >      {"topic":"metrics","partition":0,"replicas":[1,2]},
> > >      {"topic":"metrics","partition":1,"replicas":[2,3]},
> > > ]}
> > >
> > > $ sudo /opt/kafka/kafka_2.12-0.11.0.1/bin/kafka-reassign-partitions.sh
> > > --zookeeper server1:2181 --reassignment-json-file
> > > increase-replication-factor.json --execute
> > > Partitions reassignment failed due to Partition reassignment data file
> is
> > > empty
> > > kafka.common.AdminCommandFailedException: Partition reassignment data
> > file
> > > is empty
> > > at
> > > kafka.admin.ReassignPartitionsCommand$.parseAndValidate(
> > > ReassignPartitionsCommand.scala:188)
> > > at
> > > kafka.admin.ReassignPartitionsCommand$.executeAssignment(
> > > ReassignPartitionsCommand.scala:158)
> > > at
> > > kafka.admin.ReassignPartitionsCommand$.executeAssignment(
> > > ReassignPartitionsCommand.scala:154)
> > > at
> > > kafka.admin.ReassignPartitionsCommand$.main(ReassignPartitionsCommand.
> > > scala:51)
> > > at
> > > kafka.admin.ReassignPartitionsCommand.main(ReassignPartitionsCommand.
> > > scala)
> > >
> > > Thanks
> > > --
> > > Allen Michael Chan
> > >
> >
> >
> >
> > --
> >
> > Brett Rann
> >
> > Senior DevOps Engineer
> >
> >
> > Zendesk International Ltd
> >
> > 395 Collins Street, Melbourne VIC 3000 Australia
> >
> > Mobile: +61 (0) 418 826 017
> >
>



-- 
Allen Michael Chan

Re: Partition reassignment data file is empty

Posted by Ted Yu <yu...@gmail.com>.
I verified that Brett said thru this code:

    val (partitionsToBeReassigned, replicaAssignment) =
ReassignPartitionsCommand.parsePartitionReassignmentData(

        "{\"version\":1,\"partitions\":[{\"topic\":\"metrics\",\"partition\"
:0,\"replicas\":[1,2]},{\"topic\":\"metrics\",\"partition\":1,\"replicas\"
:[2,3]},]}");


partitionsToBeReassigned was empty.

I think parsePartitionReassignmentData() should be improved to give better
error information.


FYI

On Sun, Dec 31, 2017 at 4:51 PM, Brett Rann <br...@zendesk.com.invalid>
wrote:

> That's happening because your JSON is malformed. Losing the last comma will
> fix it.
>
> On Sun, Dec 31, 2017 at 3:43 PM, allen chan <al...@gmail.com>
> wrote:
>
> > Hello
> >
> > Kafka Version: 0.11.0.1
> >
> > I am trying to increase replication factor for a topic and i am getting
> the
> > below error. Can anyone help explain what the error means? The json is
> not
> > empty
> >
> > $ cat increase-replication-factor.json
> > {"version":1,
> >   "partitions":[
> >      {"topic":"metrics","partition":0,"replicas":[1,2]},
> >      {"topic":"metrics","partition":1,"replicas":[2,3]},
> > ]}
> >
> > $ sudo /opt/kafka/kafka_2.12-0.11.0.1/bin/kafka-reassign-partitions.sh
> > --zookeeper server1:2181 --reassignment-json-file
> > increase-replication-factor.json --execute
> > Partitions reassignment failed due to Partition reassignment data file is
> > empty
> > kafka.common.AdminCommandFailedException: Partition reassignment data
> file
> > is empty
> > at
> > kafka.admin.ReassignPartitionsCommand$.parseAndValidate(
> > ReassignPartitionsCommand.scala:188)
> > at
> > kafka.admin.ReassignPartitionsCommand$.executeAssignment(
> > ReassignPartitionsCommand.scala:158)
> > at
> > kafka.admin.ReassignPartitionsCommand$.executeAssignment(
> > ReassignPartitionsCommand.scala:154)
> > at
> > kafka.admin.ReassignPartitionsCommand$.main(ReassignPartitionsCommand.
> > scala:51)
> > at
> > kafka.admin.ReassignPartitionsCommand.main(ReassignPartitionsCommand.
> > scala)
> >
> > Thanks
> > --
> > Allen Michael Chan
> >
>
>
>
> --
>
> Brett Rann
>
> Senior DevOps Engineer
>
>
> Zendesk International Ltd
>
> 395 Collins Street, Melbourne VIC 3000 Australia
>
> Mobile: +61 (0) 418 826 017
>