Property [region] is marked with contradictory annotations + Apache Beam 2.23

Viewed 435

I am upgrading beam sdks from 2.14 to 2.23. While doing this, I came across error Missing required values: region at org.apache.beam.runners.dataflow.DataflowRunner.fromOptions So, I added region as command line arg --region=us-central1 and also added getter setter method in my Pipeline Options class as

@Description("VM region") 
@Default.String("us-central1")
public String getRegion();
public void setRegion(String value);

With this, now I am getting error as java.lang.IllegalArgumentException: Property [region] is marked with contradictory annotations

Any help will be appreciated.

1 Answers

I had the same issue and I just added --region=us-central1 to the CLI without adding the getter and setter. It worked!

mvn  compile exec:java -Dexec.mainClass=org.omar.$CLASS_NAME -Dexec.cleanupDaemonThreads=false -Dexec.args=" --project=$PROJECT_ID --stagingLocation=gs://$BUCKET_NAME/staging --tempLocation=gs://$BUCKET_NAME/temp --templateLocation=gs://$BUCKET_NAME/templates/$TEMPLATE_NAME.json --runner=DataflowRunner --region=us-central1"
Related