confluentinc / ksql

The database purpose-built for stream processing applications.
https://ksqldb.io
Other
122 stars 1.04k forks source link

restart KSQL service ERROR #1957

Closed sangli00 closed 6 years ago

sangli00 commented 6 years ago

I know why in this error. create topic ' topic_iprobe_blacklist' is illegal. Why restart check this? before I create this table is error.

How to fix this problem?

20140 [2018-09-27 14:53:06,795] INFO Creating topic ' topic_iprobe_blacklist' (io.confluent.ksql.util.KafkaTopicClient:95)
20141 [2018-09-27 14:53:06,797] ERROR Failed to handle: Command{statement='create table tran_blacklist_hour_1001 with(kafka_topic=' topic_iprobe_blacklist',value_format='json') as select user_ip , data_resou      rce_url from ksql_hourtimes_check_1001;', overwriteProperties={}} (io.confluent.ksql.rest.server.computation.StatementExecutor:210)
20142 io.confluent.ksql.exception.KafkaResponseGetFailedException: Failed to guarantee existence of topic  topic_iprobe_blacklist
20143     at io.confluent.ksql.util.KafkaTopicClientImpl.createTopic(KafkaTopicClientImpl.java:109)
20144     at io.confluent.ksql.planner.plan.KsqlStructuredDataOutputNode.createSinkTopic(KsqlStructuredDataOutputNode.java:223)
20145     at io.confluent.ksql.planner.plan.KsqlStructuredDataOutputNode.buildStream(KsqlStructuredDataOutputNode.java:136)
20146     at io.confluent.ksql.physical.PhysicalPlanBuilder.buildPhysicalPlan(PhysicalPlanBuilder.java:106)
20147     at io.confluent.ksql.QueryEngine.buildQueryPhysicalPlan(QueryEngine.java:199)
20148     at io.confluent.ksql.QueryEngine.buildPhysicalPlans(QueryEngine.java:165)
20149     at io.confluent.ksql.KsqlEngine.planQueries(KsqlEngine.java:228)
20150     at io.confluent.ksql.KsqlEngine.buildMultipleQueries(KsqlEngine.java:211)
20151     at io.confluent.ksql.rest.server.computation.StatementExecutor.startQuery(StatementExecutor.java:372)
20152     at io.confluent.ksql.rest.server.computation.StatementExecutor.handleCreateAsSelect(StatementExecutor.java:317)
20153     at io.confluent.ksql.rest.server.computation.StatementExecutor.executeStatement(StatementExecutor.java:234)
20154     at io.confluent.ksql.rest.server.computation.StatementExecutor.handleStatementWithTerminatedQueries(StatementExecutor.java:206)
20155     at io.confluent.ksql.rest.server.computation.StatementExecutor.lambda$handleRestoration$0(StatementExecutor.java:86)
20156     at io.confluent.ksql.rest.server.computation.RestoreCommands.lambda$forEach$3(RestoreCommands.java:77)
20157     at java.util.LinkedHashMap.forEach(LinkedHashMap.java:684)
20158     at io.confluent.ksql.rest.server.computation.RestoreCommands.forEach(RestoreCommands.java:64)
20159     at io.confluent.ksql.rest.server.computation.StatementExecutor.handleRestoration(StatementExecutor.java:82)
20160     at io.confluent.ksql.rest.server.computation.CommandRunner.processPriorCommands(CommandRunner.java:99)
20161     at io.confluent.ksql.rest.server.KsqlRestApplication.buildApplication(KsqlRestApplication.java:345)
20162     at io.confluent.ksql.rest.server.KsqlServerMain.createExecutable(KsqlServerMain.java:83)
20163     at io.confluent.ksql.rest.server.KsqlServerMain.main(KsqlServerMain.java:45)
20164 Caused by: org.apache.kafka.common.errors.InvalidTopicException: Topic name " topic_iprobe_blacklist" is illegal, it contains a character other than ASCII alphanumerics, '.', '_' and '-'
20165 [2018-09-27 14:53:06,798] INFO Executing prior statement: 'Command{statement='drop stream blacklist;', overwriteProperties={}}' (io.confluent.ksql.rest.server.computation.StatementExecutor:84)
20166 [2018-09-27 14:53:06,798] INFO Executing prior statement: 'Command{statement='create table tran_blacklist_hour_1001 with(kafka_topic=' topic_iprobe_blacklist',value_format='json') as select user_ip , d      ata_resource_url from ksql_hourtimes_check_1001;', overwriteProperties={}}' (io.confluent.ksql.rest.server.computation.StatementExecutor:84)
20167 [2018-09-27 14:53:06,798] INFO KsqlConfig values:
20168     ksql.extension.dir = ext
20169     ksql.output.topic.name.prefix =
20170     ksql.persistent.prefix = query_
20171     ksql.schema.registry.url = http://localhost:8081
20172     ksql.service.id = default_
20173     ksql.sink.partitions = 4
20174     ksql.sink.replicas = 1
20175     ksql.sink.window.change.log.additional.retention = 1000000
20176     ksql.statestore.suffix = _ksql_statestore
20177     ksql.transient.prefix = transient_
20178     ksql.udf.collect.metrics = false
20179     ksql.udf.enable.security.manager = true
20180     ksql.udfs.enabled = true
20181     ssl.cipher.suites = null
20182     ssl.enabled.protocols = [TLSv1.2, TLSv1.1, TLSv1]
20183     ssl.endpoint.identification.algorithm = https
20184     ssl.key.password = null
20185     ssl.keymanager.algorithm = SunX509
20186     ssl.keystore.location = null
20187     ssl.keystore.password = null
20188     ssl.keystore.type = JKS
20189     ssl.protocol = TLS
20190     ssl.provider = null
20191     ssl.secure.random.implementation = null
20192     ssl.trustmanager.algorithm = PKIX
20193     ssl.truststore.location = null
20194     ssl.truststore.password = null
20195     ssl.truststore.type = JKS
20196  (io.confluent.ksql.util.KsqlConfig:279)
miguno commented 6 years ago

The relevant error message is:

Caused by: org.apache.kafka.common.errors.InvalidTopicException: Topic name " topic_iprobeblacklist" is illegal, it contains a character other than ASCII alphanumerics, '.', '' and '-' 20165

The problem is that you defined the topic name with a leading whitespace character:

" topic_iprobe_blacklist"

It should have been:

"topic_iprobe_blacklist"