# "Topic cannot be found" error when creating SQL Processor

**URL:** <https://ask.lenses.io/t/topic-cannot-be-found-error-when-creating-sql-processor/293>\
**Category:** Lenses\
**Created:** [September 17, 2024, 11:53am UTC](https://ask.lenses.io/t/topic-cannot-be-found-error-when-creating-sql-processor/293 "2024-09-17T11:53:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![stefanbot](https://avatars.discourse-cdn.com/v4/letter/s/34f0e0/32.png) [@stefanbot](https://ask.lenses.io/u/stefanbot)\
**Post date:** [September 17, 2024, 11:53am UTC](https://ask.lenses.io/t/topic-cannot-be-found-error-when-creating-sql-processor/293/1 "2024-09-17T11:53:14Z")

</div>

Trying to create a SQL Processor

SET defaults.topic.autocreate=true;  
– When automatically creating topic(s) set non-default values

```auto

INSERT INTO orders_failed
SELECT STREAM * FROM airline-payments
WHERE paymentStatus = "Failed";

INSERT INTO orders_ok
SELECT STREAM * FROM airline-payments
WHERE paymentStatus != "Failed"

```

Getting the error that `"SQL is invalid"` and the topic cannot be found:

```auto
The topic airline-payments can't be found in Kafka.
Please make sure that:
  - airline-payments is a valid topic
  - airline-payments has a registered Lenses Schema or Schema Registry schema (if AVRO)
  - the current user has permissions to access this topic.

```

 ![image](https://europe1.discourse-cdn.com/flex017/uploads/lenses1/original/1X/92ac1f49edaf77d03e58c33903903d4d484d2d75.png)

Yet this topic does exist, it has JSON serialization and I can browse the events in the Explore page.

What’s the issue?

---

<div class="post-metadata">

**Author:** ![Marios](https://dub1.discourse-cdn.com/flex017/user_avatar/ask.lenses.io/marios/32/8_2.png) [@Marios](https://ask.lenses.io/u/Marios)\
**Post date:** [September 17, 2024, 12:07pm UTC](https://ask.lenses.io/t/topic-cannot-be-found-error-when-creating-sql-processor/293/2 "2024-09-17T12:07:43Z")

</div>

Hello there!

One scenario where this happens is when your records do not have a key but you have set a key type for the topic.

As an example, the topic in my screenshot does not have records with keys, there are only values.

 ![Screenshot_20240917_150532](https://europe1.discourse-cdn.com/flex017/uploads/lenses1/original/1X/8fdd9ace0aad047145a74804aeff5413f55927f1.png)

If the key type for this topic was set to anything but BYTES, then I would get the same error as you when trying to use it in SQL Processors.

So the solution is to go to the topic page, hit _Actions →Change Types_ and set the key type to BYTES.

Best,  
Marios
