Huge error unable to determine config issue

every minute or so i get this huge blast of the same error 15 times, i went through my config i dont see where i have set a MQTT topic with a wildcard but im also not sure that is what the error is telling me. any help would be appreciated

Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/core.py”, line 1445, in async_call
processed_data = handler.schema(service_data)
File “/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py”, line 272, in call
return self._compiled(, data)
File “/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py”, line 594, in validate_dict
return base_validate(path, iteritems(data), out)
File “/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py”, line 432, in validate_mapping
raise er.MultipleInvalid(errors)
voluptuous.error.MultipleInvalid: Wildcards can not be used in topic names for dictionary value @ data[‘topic’]

You have either + or # in one of your topics.

1 Like

The only symbols i see in my configuration.yaml in regards to topics is / and _
is there somewhere else that data could be stored?

Do you use packages?

Not that i can see, i dont have an include or entry in my config

Are you using MQTT discovery somehow (e.g. Zigbee2MQTT)?
The error could lie on the configuration that is created on MQTT and “discovered” by HA

Been a while LOL, I’m recircling to this issue.
the error has changed but essentially its the same if I am reading it right.

2022-01-12 09:14:17 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved

Traceback (most recent call last):

File "/usr/src/homeassistant/homeassistant/components/mqtt_statestream/__init__.py", line 80, in _state_publisher

await mqtt.async_publish(hass, mybase + key, encoded_val, 1, True)

File "/usr/src/homeassistant/homeassistant/components/mqtt/__init__.py", line 302, in async_publish

await hass.data[DATA_MQTT].async_publish(topic, str(payload), qos, retain)

File "/usr/src/homeassistant/homeassistant/components/mqtt/__init__.py", line 730, in async_publish

msg_info = await self.hass.async_add_executor_job(

File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run

result = self.fn(*self.args, **self.kwargs)

File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 1233, in publish

raise ValueError('Publish topic cannot contain wildcards.')

ValueError: Publish topic cannot contain wildcards.

I have MQTT Explorer installed when I search for # I get this
image
I don’t see any wildcards in topic names, is that what I’m looking for?

You wont see it on the broker because Home Assistant errored out rather than publishing to the broker. Also even if it did publish it would just publish a message to multiple matching topics.

Perhaps increase your logging level to debug and see if there is any further information available. Don’t leave the logging level at debug for too long as it is very chatty.

So its not complaining about a device in MQTT and trying to add it to HA its a device in HA and its attempting to publish it to MQTT but erroring out?

With this error it could be either.

raise ValueError('Publish topic cannot contain wildcards.')

Try the debug logging level to get more info.

Also what error is before and after the one you posted above.

For clarity, note that wildcard in the MQTT context is “#”, and I see already quite a bunch in your content…

Yeah but that’s in the messages not the topics.

Sure, but if ithe OP is, e.g., trying to use the cpu name or its “code” in a topic…

There are just one after another

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/mqtt_statestream/__init__.py", line 80, in _state_publisher
await mqtt.async_publish(hass, mybase + key, encoded_val, 1, True)
File "/usr/src/homeassistant/homeassistant/components/mqtt/__init__.py", line 302, in async_publish
await hass.data[DATA_MQTT].async_publish(topic, str(payload), qos, retain)
File "/usr/src/homeassistant/homeassistant/components/mqtt/__init__.py", line 730, in async_publish
msg_info = await self.hass.async_add_executor_job(
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 1233, in publish
raise ValueError('Publish topic cannot contain wildcards.')
ValueError: Publish topic cannot contain wildcards.
2022-01-13 17:54:37 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/mqtt_statestream/__init__.py", line 80, in _state_publisher
await mqtt.async_publish(hass, mybase + key, encoded_val, 1, True)
File "/usr/src/homeassistant/homeassistant/components/mqtt/__init__.py", line 302, in async_publish
await hass.data[DATA_MQTT].async_publish(topic, str(payload), qos, retain)
File "/usr/src/homeassistant/homeassistant/components/mqtt/__init__.py", line 730, in async_publish
msg_info = await self.hass.async_add_executor_job(
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 1233, in publish
raise ValueError('Publish topic cannot contain wildcards.')
ValueError: Publish topic cannot contain wildcards.
2022-01-13 17:54:37 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/mqtt_statestream/__init__.py", line 80, in _state_publisher
await mqtt.async_publish(hass, mybase + key, encoded_val, 1, True)
File "/usr/src/homeassistant/homeassistant/components/mqtt/__init__.py", line 302, in async_publish
await hass.data[DATA_MQTT].async_publish(topic, str(payload), qos, retain)
File "/usr/src/homeassistant/homeassistant/components/mqtt/__init__.py", line 730, in async_publish
msg_info = await self.hass.async_add_executor_job(
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 1233, in publish
raise ValueError('Publish topic cannot contain wildcards.')
ValueError: Publish topic cannot contain wildcards.
2022-01-13 17:54:37 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/mqtt_statestream/__init__.py", line 80, in _state_publisher
await mqtt.async_publish(hass, mybase + key, encoded_val, 1, True)
File "/usr/src/homeassistant/homeassistant/components/mqtt/__init__.py", line 302, in async_publish
await hass.data[DATA_MQTT].async_publish(topic, str(payload), qos, retain)
File "/usr/src/homeassistant/homeassistant/components/mqtt/__init__.py", line 730, in async_publish
msg_info = await self.hass.async_add_executor_job(
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 1233, in publish
raise ValueError('Publish topic cannot contain wildcards.')
ValueError: Publish topic cannot contain wildcards.
2022-01-13 17:54:37 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/mqtt_statestream/__init__.py", line 80, in _state_publisher
await mqtt.async_publish(hass, mybase + key, encoded_val, 1, True)
File "/usr/src/homeassistant/homeassistant/components/mqtt/__init__.py", line 302, in async_publish
await hass.data[DATA_MQTT].async_publish(topic, str(payload), qos, retain)
File "/usr/src/homeassistant/homeassistant/components/mqtt/__init__.py", line 730, in async_publish
msg_info = await self.hass.async_add_executor_job(
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 1233, in publish
raise ValueError('Publish topic cannot contain wildcards.')
ValueError: Publish topic cannot contain wildcards.
2022-01-13 17:54:37 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/mqtt_statestream/__init__.py", line 80, in _state_publisher
await mqtt.async_publish(hass, mybase + key, encoded_val, 1, True)
File "/usr/src/homeassistant/homeassistant/components/mqtt/__init__.py", line 302, in async_publish
await hass.data[DATA_MQTT].async_publish(topic, str(payload), qos, retain)
File "/usr/src/homeassistant/homeassistant/components/mqtt/__init__.py", line 730, in async_publish
msg_info = await self.hass.async_add_executor_job(
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 1233, in publish
raise ValueError('Publish topic cannot contain wildcards.')
ValueError: Publish topic cannot contain wildcards.
2022-01-13 17:54:37 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/mqtt_statestream/__init__.py", line 80, in _state_publisher
await mqtt.async_publish(hass, mybase + key, encoded_val, 1, True)
File "/usr/src/homeassistant/homeassistant/components/mqtt/__init__.py", line 302, in async_publish
await hass.data[DATA_MQTT].async_publish(topic, str(payload), qos, retain)
File "/usr/src/homeassistant/homeassistant/components/mqtt/__init__.py", line 730, in async_publish
msg_info = await self.hass.async_add_executor_job(
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 1233, in publish
raise ValueError('Publish topic cannot contain wildcards.')
ValueError: Publish topic cannot contain wildcards.
2022-01-13 17:54:37 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/mqtt_statestream/__init__.py", line 80, in _state_publisher
await mqtt.async_publish(hass, mybase + key, encoded_val, 1, True)
File "/usr/src/homeassistant/homeassistant/components/mqtt/__init__.py", line 302, in async_publish
await hass.data[DATA_MQTT].async_publish(topic, str(payload), qos, retain)
File "/usr/src/homeassistant/homeassistant/components/mqtt/__init__.py", line 730, in async_publish
msg_info = await self.hass.async_add_executor_job(
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 1233, in publish
raise ValueError('Publish topic cannot contain wildcards.')
ValueError: Publish topic cannot contain wildcards.
2022-01-13 17:54:37 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/mqtt_statestream/__init__.py", line 80, in _state_publisher
await mqtt.async_publish(hass, mybase + key, encoded_val, 1, True)
File "/usr/src/homeassistant/homeassistant/components/mqtt/__init__.py", line 302, in async_publish
await hass.data[DATA_MQTT].async_publish(topic, str(payload), qos, retain)
File "/usr/src/homeassistant/homeassistant/components/mqtt/__init__.py", line 730, in async_publish
msg_info = await self.hass.async_add_executor_job(
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 1233, in publish
raise ValueError('Publish topic cannot contain wildcards.')
ValueError: Publish topic cannot contain wildcards.
2022-01-13 17:54:37 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/mqtt_statestream/__init__.py", line 80, in _state_publisher
await mqtt.async_publish(hass, mybase + key, encoded_val, 1, True)
File "/usr/src/homeassistant/homeassistant/components/mqtt/__init__.py", line 302, in async_publish
await hass.data[DATA_MQTT].async_publish(topic, str(payload), qos, retain)
File "/usr/src/homeassistant/homeassistant/components/mqtt/__init__.py", line 730, in async_publish
msg_info = await self.hass.async_add_executor_job(
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 1233, in publish
raise ValueError('Publish topic cannot contain wildcards.')
ValueError: Publish topic cannot contain wildcards.

Isnt it complaining about a topic having a wild card? arent these messages?

(Im fairly new to the MQTT protocol so im genuinly asking)
image

Sure, but as we don’t know your configuration.yaml it could be that you’re using the message of a topic as the topic for another switch / sensor etc. Which then throws an error.
As you would be referring to the value of a topic instead of hard-coding it, you wouldn’t find any #'s in your configuration.yaml

Oh man :frowning: that is going to be a pain comparing MQTT sensors to their mapped topics in MQTT explorer LOL but it looks like that is my next steps.

I just noticed something, its referencing the state stream component, doesn’t that mean its a device or entity that is already in HA that its trying to publish a topic entry for in MQTT?
Not trying to create a device or entity from a MQTT topic?

Am I thinking right?

did you ever solve this, something like this is stopping y HA to update