eclipse-paho / eclipse-paho/paho.mqtt.python

publish return code always 0, even if failure with access denied in restricted topic

Open
#715 7 comments 0 reactions 0 assignees View on GitHub
Status: Available Status: In Progress Type: Bug
Dominant language
Python
Stars
2.4k
Forks
742
Avg merge
12d 48m
Merged PRs (30d)
1

Description

I would like to detect if a publish message has been sent or rejected by the broker when restricting access with ACL.

expected: return code 135 if access denied

as-is: return code is always 0 - even if the message is not published by the broker because of ACL denial.

I am using mqtt v5 and qos1,

```
properties=Properties(PacketTypes.PUBLISH)
properties.MessageExpiryInterval=5 # retain messages for x seconds
ret = self.__mqtt_client.publish(restricted_data, payload, retain=1, qos=1, properties=properties)
ret.wait_for_publish()
print(ret.is_published()) # always True
print (f" RET={ret.rc}") # always 0
```

Tested with nodejs mqtt library, and saw an authorization error - so the broker works as expected.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.