Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] - MQTT lack of permission to publish on topic: v1.0/Observations #2095

Open
martincarrere opened this issue Jan 13, 2025 · 1 comment

Comments

@martincarrere
Copy link
Contributor

martincarrere commented Jan 13, 2025

Hi,

Problem:
We are currently unable to create Observations through the MQTT URL in the Helm chart deployment.

Below is the specific error message encountered:
"ERROR io.moquette.broker.PostOffice - MQTT client is not authorized to publish on topic: v1.0/Observations"

I try with to override of auth.mqtt.topicAllowList with ^*$' and ^/[a-zA-Z0-9_-]+\((('[^']+')|([0-9]+))\)/[a-zA-Z0-9_-]+$
but the same error is generated.
Regarding the other kinds (Things, Datastreams, Features of Interest, etc.) are being created successfully without issues in our Frost Server.
We are not using the Frost HTTP API to send MQTT messages. Instead, we are directly targeting the mqttServiceUrl in Kubernetes (where the service type is ClusterIP).

In the development environment, using Docker Compose and the frost (all in one), all objects (Things, Datastreams, Features of Interest, etc.) and observations are being created successfully without issues.

Here is an excerpt of the current log from the MQTT component:

Current extracted log from mqtt component:

:50:51.231 [nioEventLoopGroup-3-1] DEBUG        i.m.i.BrokerInterceptor - Sending MQTT CONNECT message to interceptor. CId=myapp2frost, interceptorId=SensorThings API Server (16979df5-cdf1-484b-98b6-59d2cc19507d)
15:50:51.240 [nioEventLoopGroup-3-1] DEBUG      i.m.b.m.MQTTMessageLogger - C->B PUBLISH <myapp2frost> to topics <v1.0/Observations>
15:50:51.240 [nioEventLoopGroup-3-1] DEBUG      i.m.broker.MQTTConnection - Received MQTT message, type: PUBLISH
15:50:51.244 [nioEventLoopGroup-3-1] DEBUG    i.m.b.SessionEventLoopGroup - Routing cmd [PUB QoS2] for session [myapp2frost] to event processor 7
15:50:51.245 [nioEventLoopGroup-3-1] ERROR  io.moquette.broker.PostOffice - MQTT client is not authorized to publish on topic: v1.0/Observations
15:50:51.246 [nioEventLoopGroup-3-1] DEBUG      i.m.b.m.MQTTMessageLogger - C->B PUBLISH <myapp2frost> to topics <v1.0/Observations>
15:50:51.246 [nioEventLoopGroup-3-1] DEBUG      i.m.broker.MQTTConnection - Received MQTT message, type: PUBLISH
15:50:51.247 [nioEventLoopGroup-3-1] DEBUG    i.m.b.SessionEventLoopGroup - Routing cmd [PUB QoS2] for session [myapp2frost] to event processor 7
15:50:51.247 [nioEventLoopGroup-3-1] DEBUG      i.m.b.m.MQTTMessageLogger - C->B PUBLISH <myapp2frost> to topics <v1.0/Observations>
15:50:51.247 [nioEventLoopGroup-3-1] DEBUG      i.m.broker.MQTTConnection - Received MQTT message, type: PUBLISH
15:50:51.247 [nioEventLoopGroup-3-1] DEBUG    i.m.b.SessionEventLoopGroup - Routing cmd [PUB QoS2] for session [myapp2frost] to event processor 7
15:50:51.248 [nioEventLoopGroup-3-1] DEBUG      i.m.broker.MQTTConnection - readCompleted client CId: myapp2frost
15:50:51.248 [nioEventLoopGroup-3-1] DEBUG    i.m.b.SessionEventLoopGroup - Routing cmd [flushQueues] for session [myapp2frost] to event processor 7

Could you please assist us in resolving this issue or provide any insights into possible misconfigurations?

@hylkevds
Copy link
Member

The message MQTT client is not authorized to publish on topic means your user does not have the create right. Check your user roles.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants