-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The Mosquitto Broker Service on local computer started and then stopped ,Some services stop automatically if there are not in use by other services or programs #439
Comments
The only thing I can think is that there is a problem in your config file that is causing the broker to stop. What if you try to start the broker manually from the command line using the same config file? |
that's same problem for me...!!! Friend's Give the Solution..... |
I had this problem. It was because it couldn't open the log file. |
Do you still had this issue ? Had you tried removing the log file as @ericGTT suggested ? |
|
why mosquitto server is Automatically stop?? |
I have the same issue. When I just run mosquitto.exe from the command prompt it works OK. When I start the service same issue as described above. I checked my settings file, and nothing is enabled for logging. I could not see any log files created, so there was nothing to delete. For me creating the Windows service (mosquitto.exe install) only worked when I ran Command Prompt as administrator. |
Folks encountering this issue: The problem is with the path to the file(s) set in the config file when running as a service. Apparently mosquitto is pretty picky about parsing the path. I tried a number of quoting and escaping formats to get around the spaces in "Program Files" but in the end I had to move my password file (assume the same would be true with a log file) to the root. Hope this helps and if anyone does find an acceptable way to reference files in the default install directory, please reply back. |
Same problem with me. I restarted PC, then it solved |
Thanks for the tip of what to look for. I managed to reference the password file as follows: |
where is this log file located? |
Look in the config file and see where it's saved to. |
Using full paths, limiting folder name character count worked for me:
Log file was also an issue, even when trying to open it afterwards. Reason being that the service account in which the broker is running is the owner of the log file, thus preventing even an Admin account from opening it. |
Glad I found this thread. For anyone else, having the full path on any files referenced in the mosquitto.conf worked for me, even if the files were in the same directory. Now does anyone have a fix for the log issue? I can not find a way to open this log file. What good is a log file if you can't view it? |
You have to provide the appropriate permissions to the logon for the service. If the service is running under the local system account, then add LOCAL SERVICE to the permissions for the installation folder. Alternatively, change the service logon to another account and make sure permissions are set accordingly for the folder. |
For me, the reason is, had extra double quotes in password file define. |
This solution worked for me. As someone who works with PowerShell, I am used to double quoting Program Files to avoid the issue caused by having space in between Program and Files. In my config file, I changed my path from Worked for me. Thanks @ErixWong ! |
Worked for me! thanks! |
My problem was it couldn't open the password file no matter where i put it. Not even when it was in root. I fixed the problem by giving System full control of the file rather than just my user. |
Thanks. I was facing the exact same problem. No matter where i put the passwd file, i couldn't get the service running. It of course worked when I ran via CLI, but the service just would not run. changed permissions to allow "SYSTEM" full control, and bam, now it's running. Thanks |
it work for password file not only mosquitto folder :) |
Check if Notepad sometimes adds a .txt extension when you edit the mosquitto.conf file. You can see this only after setting File Manager to show file extensions. If you see .txt remove it and leave only .conf It's a simple mistake, but that's exactly how Windows 11 reacted as you described, by automatically closing Mosquitto and displaying an error message. Best regards. |
I was able to fix this issue by just adding the 'passwordfile' directly at C:\passwordfile and then I added these 2 lines to the mosquitto.conf: allow_anonymous false If I change the location of the file it will not work... |
hi all.
I have installed mosquitto in my PC (windows 10) and it was working well.
then i changed mosquitto.conf file to activate username/password authentication. then I wanted to restart the mosquitto service on the PC. but it gives me the following error:
"The Mosquitto Broker Service on local computer started and then stopped ,Some services stop automatically if there are not in use by other services or programs"
Now, my mosquitto can not be started again and I have to re-install it whenever I receive this error message.
please help me...
The text was updated successfully, but these errors were encountered: