SOLVED Unable to open file for writing. Read-only file system

abishur

Dabbler
Joined
Jun 28, 2022
Messages
26
I am trying to learn how to use apps and have installed Mosquitto-MQTT. Instead of using PVC I used hostpath(simple) and set the directory to a known location (/mnt/vmStorage/apps/mosquitto). But when I try to create a password file using the command
Code:
mosquitto_passwd -c /mosquitto/config/password.txt [username]

I get the error message "Unable to open file [file_name] for writing. Read-only file system. Okay I thought I just need to make sure my files have the right ownership. It looks like apps use the group "apps" so I did a chgrp apps to vmStorage, apps, and the mosquitto directory, but it's still saying the file system is read-only.
What am I missing here?
 

abishur

Dabbler
Joined
Jun 28, 2022
Messages
26
*sigh* I found the issue. If you look under the "Security and Permissions" settings and click on "Show Advanced Security Settings" you will find an option that is enabled by default which says "ReadOnly Root Filesystem" by unchecking this box I was able to perform the very first step of setting up mosquitto, create a username with a password. Hope this helps anyone new to containers like me having this issue.
 

abishur

Dabbler
Joined
Jun 28, 2022
Messages
26
I found a further issue and the issue was me. If I had been doing thing RIGHT I wouldn't have needed to edit anything on the root filesystem. By using the hostpath directory I previously configured I could have added all the required files. I was confused because I thought the path was /mosquitto/config/, but it was actually /mosquitto/configinc/. I was able to find it in the end by creating a file (find.me) on truenas in the config directory and then searching for that file in the container. It would be nice if there was more documentation on where config directories were located in the container, but ultimately I was trying to use it incorrectly and that was causing issues for me.
 

rezapci

Cadet
Joined
Nov 27, 2022
Messages
2
I found a further issue and the issue was me. If I had been doing thing RIGHT I wouldn't have needed to edit anything on the root filesystem. By using the hostpath directory I previously configured I could have added all the required files. I was confused because I thought the path was /mosquitto/config/, but it was actually /mosquitto/configinc/. I was able to find it in the end by creating a file (find.me) on truenas in the config directory and then searching for that file in the container. It would be nice if there was more documentation on where config directories were located in the container, but ultimately I was trying to use it incorrectly and that was causing issues for me.
hey i am struggling in the same satiation keep popping up Error: Unable to open file /mosquitto/configinc/password.txt for writing. Permission denied.
 
Top