channel has been removed due to an error

Error Scenario:

channel has been removed due to an error during configuration.

This error message is received in ~/logs/flume.log file when starting a flume agent with missing or wrong configuration with JDBC channel setup.

Root Cause:

DerbySchemaHandler.schemaExists error message is received when a flume agent’s sink is not able to receive the events from this JDBC channel and for some reason agent process stopped and when we try to restart the same agent with JDBC channel, then as the database schema already exists from previous then this error message is received.

This is due to the default parameters of JDBC channel:

Property Name Default Description
create.schema true If true, then creates db schema.
create.index true Create indexes to speed up lookups
create.foreignkey true

As per create.schema = true property, it tries to create the jdbc channel once again with the same schema. That’s why we are receiving error message