• header.categories
    • header.recent
    • header.tags
    • header.popular
    • register
    • login

    Client does not have read permissions

    scheduled pinned locked moved General Discussion
    11 posts 2 posters 1.5k views 1 watching
    loading-more-posts
    • oldest-to-newest
    • newest-to-oldest
    • most-votes
    reply
    • reply-as-topic
    guest-login-reply
    deleted-message
    • S offline
      saturn
      global:last-edited-by,

      Hello.
      I have created the role "mqtt" as at attached screenshot.
      User "house" is the member or the "mqtt" role.
      I have created the gateway "House" with settings as at attached screenshot.
      When I try to enable this gateway, I get the following in the log:

      2018-05-24 15:23:41,517 ERROR [nioEventLoopGroup-3-12] [io.moquette.spi.impl.ProtocolProcessor:851] Client does not have read permissions on the topic CId=house-mqtt-client_44gNx, username=house, messageId=1, topic=house-out/#
      

      What's my mistake?
      1_1527168004512_gateway.png 0_1527168004511_role.png

      jkandasaJ one-reply-to-this-post last-reply-time reply quote 0
      • jkandasaJ offline
        jkandasa @saturn
        global:last-edited-by,

        @saturn on the role you should add /# as follows,

        • Topics publish: house-in/#, house-out/#
        • Topics subscribe: house-in/#, house-out/#
        one-reply-to-this-post last-reply-time reply quote 0
        • S offline
          saturn
          global:last-edited-by,

          Thank you.
          It's working now.
          Is it posible to use mask or regexp for topics in the role?

          jkandasaJ one-reply-to-this-post last-reply-time reply quote 0
          • jkandasaJ offline
            jkandasa @saturn
            global:last-edited-by,

            @saturn

            Is it possible to use mask or regexp for topics in the role?

            I hope it should,

            You can see the actual code here.

            // _topic: defined in role
            // topic: recived from client
             _topic = _topic.replaceAll("\\+", "\\\\w+").replaceAll("#", "\\.*");
             if (topic.matches(_topic)) {
                 return true;
             }
            

            This code replaces,

            • + to \w+ (Example: house-out/+/+/+ becomes as house-out/\w+/\w+/\w+)
            • # to .* (Example: house-out/# becomes as house-out/.*)

            And finally matches the received topic from the client(matches as a regular expression).

            So your regular expression on the role might work. (if it does not have + and # symbol)

            one-reply-to-this-post last-reply-time reply quote 0
            • S offline
              saturn
              global:last-edited-by,

              I have got error again:

              2018-05-30 00:14:40,149 ERROR [nioEventLoopGroup-8-10] [io.moquette.spi.impl.ProtocolProcessor:851] Client does not have read permissions on the topic CId=house-1, username=house, messageId=2, topic=house-in/+/+/+/+/+
              

              My options not help:
              Topics publish

              house-in, house-in/#, house-in/+/+/+/+/+, house-in/\w+/\w+/\w+/\w+/\w+, house-out/+/+/+/+/+, house-out/\w+/\w+/\w+/\w+/\w+
              

              Topics subscribe

              house-out, house-out/#, house-out/+/+/+/+/+, house-out/\w+/\w+/\w+/\w+/\w+, house-in/+/+/+/+/+, house-in/\w+/\w+/\w+/\w+/\w+
              

              What I do wrong again?

              jkandasaJ one-reply-to-this-post last-reply-time reply quote 0
              • jkandasaJ offline
                jkandasa @saturn
                global:last-edited-by, jkandasa

                @saturn Use + or # only.

                use only house-in/#, house-out/# will cover everything.

                Can you elaborate how you want to control topic? I can give some examples.

                one-reply-to-this-post last-reply-time reply quote 0
                • S offline
                  saturn
                  global:last-edited-by,

                  When I use only "house-in/#, house-out/#" in "Topics publish" and "Topics subscribe" I get the same error:

                  ERROR [nioEventLoopGroup-8-10] [io.moquette.spi.impl.ProtocolProcessor:851] Client does not have read permissions on the topic CId=house-1, username=house, messageId=2, topic=house-in/+/+/+/+/+
                  

                  I want to control MySensors network by sending data to the "house-in" and get statistic and status information from "house-out".

                  one-reply-to-this-post last-reply-time reply quote 0
                  • S offline
                    saturn
                    global:last-edited-by, saturn

                    May be I misunderstand you.
                    I think you mean that, I should use

                    +
                    

                    instead of

                    \w+
                    

                    and

                    #
                    

                    instead of

                    .*
                    

                    in role's settings.
                    But my problems with read permissions was resolved only when I add

                    house-out/.*, house-in/.*
                    

                    to the role's settings.
                    Thank you for your help.

                    jkandasaJ one-reply-to-this-post last-reply-time reply quote 0
                    • jkandasaJ offline
                      jkandasa @saturn
                      global:last-edited-by,

                      @saturn

                      This one does not work for you?

                      house-out/#, house-in/#
                      
                      S one-reply-to-this-post last-reply-time reply quote 0
                      • S offline
                        saturn @jkandasa
                        global:last-edited-by,

                        @jkandasa
                        With

                        house-out/#, house-in/#
                        

                        I get

                        Client does not have read permissions on the topic CId=house-1, username=house, messageId=2, topic=house-in/+/+/+/+/+```
                        jkandasaJ one-reply-to-this-post last-reply-time reply quote 0
                        • jkandasaJ offline
                          jkandasa @saturn
                          global:last-edited-by,

                          @saturn

                          house-out/#, house-in/#
                          

                          You should add this to both subscribe and publish topics. Can you show your MQTT client code?

                          one-reply-to-this-post last-reply-time reply quote 0
                          • first-post
                            last-post

                          0

                          online

                          644

                          users

                          532

                          topics

                          3.4k

                          posts
                          Copyright © 2015-2025 MyController.org | Contributors | Localization