Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: kittyhodl on November 25, 2023, 09:09:37 PM



Title: Settings file could not be written (Mac)
Post by: kittyhodl on November 25, 2023, 09:09:37 PM
When I try to open Bitcoin Core I get the following error:

A fatal error occurred. Check that settings file is writable, or try running with -nosettings.

Details: - Error: Unable to open settings file /Volumes/6TB iMac/settings.json.tmp for writing

I'm using an 2015ish iMac with 1TB SSD and 6TB internal HD. Had Bitcoin Core running OK but wanted to change storage location to the 6TB drive so I could load full node, but I think maybe the fact that the 6TB drive needs a password to open messed things up?

I tried to reinstall Bitcoin Core (including cpu reboot) but no joy. Any advice? I'm not super technical but maybe I can run with -nosettings? I'm assuming that is a Terminal command, but would need some guidance on doing that properly.

Or just advice on how to start again from scratch would be good.

Thanks in advance!


Title: Re: Settings file could not be written (Mac)
Post by: DaveF on November 25, 2023, 10:24:00 PM
Rename your bitcoin.conf file bitcoin.conf.old and see if that helps.
Location of the file: https://github.com/bitcoin/bitcoin/blob/master/doc/bitcoin-conf.md

You can also just try editing the file to change the path back.

-Dave


Title: Re: Settings file could not be written (Mac)
Post by: kittyhodl on November 25, 2023, 10:44:34 PM
Rename your bitcoin.conf file bitcoin.conf.old and see if that helps.
Location of the file: https://github.com/bitcoin/bitcoin/blob/master/doc/bitcoin-conf.md

You can also just try editing the file to change the path back.

-Dave
Thanks, I tried it but no luck. I had actually deleted that whole folder when I tried to reinstall Bitcoin Core, so I moved it back from trash but no joy, same error message.


Title: Re: Settings file could not be written (Mac)
Post by: BitMaxz on November 25, 2023, 11:52:16 PM
Thanks, I tried it but no luck. I had actually deleted that whole folder when I tried to reinstall Bitcoin Core, so I moved it back from trash but no joy, same error message.

It seems that it does not have the privilege to write on settings.json.tmp when trying to open Bitcoin core. You might need to run the Bitcoin core as administrator or it requires ROOT privileges.

Can you try to open Bitcoin core with the sudo command or run it as a root?
Open the terminal and try this command below

Code:
sudo "\file path from hard drive to application. app/Contents/MacOS/application name"

Other ways to run apps in root privilege can be found here (https://www.wikihow.com/Open-Applications-With-Root-Privileges-on-a-Mac).


Title: Re: Settings file could not be written (Mac)
Post by: kittyhodl on November 26, 2023, 01:43:32 AM
Thanks, I tried it but no luck. I had actually deleted that whole folder when I tried to reinstall Bitcoin Core, so I moved it back from trash but no joy, same error message.

It seems that it does not have the privilege to write on settings.json.tmp when trying to open Bitcoin core. You might need to run the Bitcoin core as administrator or it requires ROOT privileges.

Can you try to open Bitcoin core with the sudo command or run it as a root?
Open the terminal and try this command below

Code:
sudo "\file path from hard drive to application. app/Contents/MacOS/application name"

Other ways to run apps in root privilege can be found here (https://www.wikihow.com/Open-Applications-With-Root-Privileges-on-a-Mac).

OK I am able to run it this way thanks! But if I quit and try to start normally it throws same error. How can I fix this? I don't want to download whole thing and then have to do it again for some reason.

BTW I see this message in Terminal:
users-iMac:~ admin$ sudo /Applications/Bitcoin-Qt.app/Contents/MacOS/Bitcoin-Qt
: You need to rebuild the database using -reindex to go back to unpruned mode.  This will redownload the entire blockchain.
Please restart with -reindex or -reindex-chainstate to recover.


Title: Re: Settings file could not be written (Mac)
Post by: Cricktor on November 26, 2023, 07:50:04 AM
Bitcoin Core shouldn't need root priviledges to run properly, even on MacOS. I'd rather check if Bitcoin Core and file permissions are properly setup on OP's system than run an internet connected application with root priviledges. I consider Bitcoin Core pretty secure but anyway it's not supposed to run as root.


Title: Re: Settings file could not be written (Mac)
Post by: DaveF on November 26, 2023, 12:57:17 PM
OP when you moved the files around from the 1TB to the 6TB how did you do it? Just a copy & paste? Some other method?
Is there a timeout on the unlock of the 6TB drive? Could it have re-locked before the files finished copying?

I don't use Macs that much but I have had at very very very rare times permissions get blown when moving files in linux to an encrypted drive. Can't duplicate it and always thought it was just my bizarre setup. This looks similar.

-Dave


Title: Re: Settings file could not be written (Mac)
Post by: LoyceV on November 26, 2023, 03:46:47 PM
Code:
sudo "\file path from hard drive to application. app/Contents/MacOS/application name"
This is, in general, a very bad idea! It messes up basic security, and anything that doesn't require rood privileges shouldn't be running with root privileges.

It's a much better idea to check the permissions at the desired path, and change those to match your needs.


Title: Re: Settings file could not be written (Mac)
Post by: kittyhodl on November 26, 2023, 09:24:25 PM
I think I just want to start over. But reinstalling Core doesn't change the error. Maybe I'll reinstall MacOS, which seems like overkill but I don't see another way to fix this right now.
Thanks for the help.


Title: Re: Settings file could not be written (Mac)
Post by: achow101 on November 27, 2023, 01:18:18 AM
but I think maybe the fact that the 6TB drive needs a password to open messed things up?
Was that drive unlocked and can your user read and write files to it? This seems likely to be the culprit.

The error that you get is specifically related to being unable to write the settings.json file. This would be caused by filesystem permissions errors and just filesystem errors in general.