Open AndroidDesigner opened 7 years ago
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. Delete your log file and restart or just remove the log file from your config file so it's not logging.
Do you still had this issue ? Had you tried removing the log file as @ericGTT suggested ?
why mosquitto server is Automatically stop?? Active: active (exited) since Tue 2018-04-03 04:59:29 UTC; 7h ago Thanks!!...
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.
- I'm facing a similar issue ... removing the log file and then restarting, didn't work for me.
- My guess is; it's related to the services. 3a. I can't start the service. 3b. Thought of increasing the log size from event viewer ... but how? if there isn't a file.
- What is surprising is.... a month back the exact same settings(No Changes) were working perfectly.
- Have attached a few screen shots for reference.
Same problem with me. I restarted PC, then it solved
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.
Thanks for the tip of what to look for. I managed to reference the password file as follows: "password_file C:\Progra~1\mosquitto\passwd" No quotes in the configuration file. Hope that helps someone out.
I had this problem. It was because it couldn't open the log file. Delete your log file and restart or just remove the log file from your config file so it's not logging.
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_dest file C:\Progra~1\mosquitto\mosquitto.log
password_file C:\Progra~1\mosquitto\user_security
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. Wrong: password_file "C:\Program Files\mosquitto\passwd.txt" Right: password_file C:\Program Files\mosquitto\passwd.txt
For me, the reason is, had extra double quotes in password file define. Wrong: password_file "C:\Program Files\mosquitto\passwd.txt" Right: password_file C:\Program Files\mosquitto\passwd.txt
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 C:\ "Program Files"\mosquitto\passwd.txt to C:\Program Files\mosquitto\passwd.txt
Worked for me. Thanks @ErixWong !
Worked for me! thanks! Next ver of Mosquitto should be improved to adopt MOSQUITTO_DIR env var to solve this problem.
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.
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
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.
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 password_file C:\passwordfile
If I change the location of the file it will not work...
OMFG more than 2 days with this and this worked perect
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...