Author Topic: "Could not save config file..." Error  (Read 22712 times)

Offline spflanze

  • Almost regular
  • **
  • Posts: 134
"Could not save config file..." Error
« on: September 16, 2017, 08:35:23 pm »
Whenever I close CodeBlocks 16.01 I get two error message windows. Their messages are:
Quote
Unable to open personal dictionary file
Could not save config file...

Not remembered between invocations of CodeBlocks 16.01 are:
1) Recent projects and files
2) The base directory for the wx global directory

What do I need to do to enable CodeBlocks to save the config file?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: "Could not save config file..." Error
« Reply #1 on: September 16, 2017, 11:34:42 pm »
State your OS as a start. Another option is to start codeblocks from a console and pass --debug-log -v options to see extended information.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline spflanze

  • Almost regular
  • **
  • Posts: 134
Re: "Could not save config file..." Error
« Reply #2 on: September 17, 2017, 12:56:46 am »
The OS is Windows 7 Professional SP1

This problem is solved. The problem was I was using CbLauncher.exe to invoke CodeBlocks. Now I use codeblocks.exe and when this is used instead the errors no longer appear when closing it, the recent files and projects are remembered, and so is the wx global variable.


Offline crobar

  • Multiple posting newcomer
  • *
  • Posts: 15
Re: "Could not save config file..." Error
« Reply #3 on: October 02, 2018, 11:18:58 am »
I'm seeing the same issue on 17.12 on Ubuntu 16.04. I followed the instructions in the post above to produce debug output, see the session below.

I can't actually remember now for sure, but I think I compiled codeblocks from source. To get the error I changed the brace completion to false and exited codeblocks.

Code
$ codeblocks --debug-log -v > codeblock_log.txt 2>&1
$ cat codeblock_log.txt
10:12:59: Debug: Failed to connect to session manager: SESSION_MANAGER environment variable not defined
10:13:00: Debug: WindowPosition[200 150 300 400]
10:13:00: Debug: Adding duplicate image handler for 'XPM file'
10:13:00: Debug: WindowPosition[200 150 300 400]
10:13:00: Debug: CodeSnippetsWindowLoadingFile:/home/rcrozier/.config/codeblocks/codesnippets.xml
10:13:00: Debug: Personality is[]
10:13:01: Debug: wxColour::Set - couldn't set to colour string 'CB_BODY_BGCOLOUR'
10:13:01: Debug: wxColour::Set - couldn't set to colour string 'CB_LINK_COLOUR'
10:13:01: Debug: wxColour::Set - couldn't set to colour string 'CB_LINK_COLOUR'
10:13:01: Debug: wxColour::Set - couldn't set to colour string 'CB_LINK_COLOUR'
10:13:01: Debug: wxColour::Set - couldn't set to colour string 'CB_LINK_COLOUR'
10:13:01: Debug: wxColour::Set - couldn't set to colour string 'CB_LINK_COLOUR'
10:13:01: Debug: wxColour::Set - couldn't set to colour string 'CB_LINK_COLOUR'
10:13:01: Debug: wxColour::Set - couldn't set to colour string 'CB_TEXT_COLOUR'
10:13:01: Debug: wxColour::Set - couldn't set to colour string 'CB_LINK_COLOUR'
10:13:01: Debug: wxKeyBinder::DetachAll - detaching from all my [0] targets
10:13:01: Debug: wxKeyBinder::DetachAll - detaching from all my [0] targets
10:13:01: Debug: wxKeyBinder::Attach - attaching to [SCIwindow] 0x2d11420

(codeblocks:10309): Gtk-CRITICAL **: IA__gtk_tree_model_iter_nth_child: assertion 'n >= 0' failed
10:13:08: Debug: wxKeyConfigPanel::UpdateButtons
10:13:08: Debug: wxKeyConfigPanel::OnProfileSelected
10:13:08: Debug: wxKeyConfigPanel::OnTreeCommandSelected
10:13:08: Debug: wxKeyConfigPanel::UpdateButtons
10:13:08: Debug: wxKeyConfigPanel::UpdateDesc
10:13:08: Debug: wxKeyConfigPanel::UpdateButtons
10:13:08: Debug: wxColour::Set - couldn't set to colour string 'wxSYS_COLOUR_INFOBK'
10:13:08: Debug: wxColour::Set - couldn't set to colour string 'wxSYS_COLOUR_INFOTEXT'
10:13:08: Debug: wxColour::Set - couldn't set to colour string 'wxSYS_COLOUR_HIGHLIGHT'
10:13:12: Debug: wxKeyConfigPanel::ApplyChanges
10:13:12: Debug: wxKeyBinder::DetachAll - detaching from all my [1] targets
10:13:12: Debug: wxKeyBinder::DetachAll - detaching from all my [0] targets
10:13:12: Debug: wxKeyBinder::DetachAll - detaching from all my [0] targets
10:13:12: Debug: wxKeyBinder::Attach - attaching to [SCIwindow] 0x2d11420
10:13:12: Debug: wxKeyBinder::Attach - attaching to [SCIwindow] 0x3fdd780
10:13:12: Debug: wxKeyBinder::Attach - attaching to [SCIwindow] 0x3ffbe90
10:13:13: Debug: wxKeyBinder::DetachAll - detaching from all my [0] targets
10:13:13: Debug: wxKeyBinder::DetachAll - detaching from all my [0] targets
10:13:17: Debug: SavingWindowPosition[200 150 300 400]
10:13:18: Debug: wxKeyBinder::DetachAll - detaching from all my [3] targets
10:13:18: Debug: wxKeyBinder::DetachAll - detaching from all my [0] targets
10:13:22: Debug: 3 threads were not terminated by the application.
Starting Code::Blocks Release 17.12  rev 11256 Aug  3 2018, 13:55:49 - wx3.0.2 (Linux, unicode) - 64 bit

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: "Could not save config file..." Error
« Reply #4 on: October 02, 2018, 12:42:33 pm »
What are the permissions of the ~/.config/codeblocks folder?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline crobar

  • Multiple posting newcomer
  • *
  • Posts: 15
Re: "Could not save config file..." Error
« Reply #5 on: October 02, 2018, 12:54:18 pm »
Code
$ ls -l ~/.config/
total 84
drwxr-xr-x 2 rcrozier rcrozier 4096 Oct  2 10:21 codeblocks

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: "Could not save config file..." Error
« Reply #6 on: October 02, 2018, 01:15:30 pm »
I cannot verify they are correct only you can do it. Also you need to check the permissions of the files in this folder.

It is a common problem on ubuntu some of these files to be owned by root.
I don't know how this happens, but I'll be very glad if someone could tell me.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: "Could not save config file..." Error
« Reply #7 on: October 02, 2018, 01:30:09 pm »
On my system the codeblocks-folder (and all included folders have 755-permissions) and the files have 664.
User and group is the same as the user of the home-folder.
The .config-folder itself has 720.

Offline crobar

  • Multiple posting newcomer
  • *
  • Posts: 15
Re: "Could not save config file..." Error
« Reply #8 on: October 02, 2018, 01:39:20 pm »
I am user rcrozier. in the actual codeblocks folder

Code
$ ls -l ~/.config/codeblocks/
total 132
-rw-rw-r-- 1 rcrozier rcrozier   128 Oct  2 10:13 BrowseTracker.ini
-rw-rw-r-- 1 rcrozier rcrozier 38435 Oct  2 10:21 cbKeyBinder10.ini
-rw-rw-r-- 1 rcrozier rcrozier 38154 Oct  2 10:13 cbKeyBinder10.ini.bak
-rw-rw-r-- 1 rcrozier rcrozier   239 Oct  2 10:13 codesnippets.ini
-rw-r--r-- 1 root     root     40596 Aug 17 12:42 default.conf
-rw-rw-r-- 1 rcrozier rcrozier   231 Oct  2 10:13 DragScroll.ini
-rw-rw-r-- 1 rcrozier rcrozier     0 Oct  2 10:13 en_GB_personaldictionary.dic

so default.conf is owned by root, should this be the case?

Anyway, I changed ownership of default.conf to rcrozer and the problem has gone. My suspicion is that this file is created during installation when using sudo and is therefore owned by root?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: "Could not save config file..." Error
« Reply #9 on: October 02, 2018, 07:09:39 pm »
I'll be surprised if it is.
Is this the first installation on this machine?
Can you repeat the steps (first delete or rename the codeblocks folder)?

Do you have /root/.config/codeblocks?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline sg

  • Single posting newcomer
  • *
  • Posts: 6
Re: "Could not save config file..." Error
« Reply #10 on: August 25, 2019, 09:33:25 pm »
Hi there, I am having the same problem as described in the first post by 'spflanze'--i.e., "Unable to open personal dictionary file"..."Could not save config file"...

I tried his solution--i.e., using codeblocks.exe rather than CbLauncher.exe, but now Code::Blocks can't find the compiler. The file defaukt.conf exists in the following path: Users/[my_user_name]/AppData/Roaming/CodeBlocks
Any assistance is most appreciated. Cheers!

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: "Could not save config file..." Error
« Reply #11 on: August 26, 2019, 08:20:12 am »
Are the settings in Settings -> Compiler -> Your compiler -> Toolchain executables correct?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline sg

  • Single posting newcomer
  • *
  • Posts: 6
Re: "Could not save config file..." Error
« Reply #12 on: August 28, 2019, 05:37:37 am »
Thanks for the quick response. The settings look okay to me, but I could be wrong. I've attached a screen shot. Cheers!

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: "Could not save config file..." Error
« Reply #13 on: August 28, 2019, 09:11:33 am »
Do you have a compiler in this folder? Does it work? What do you mean by "can't find the compiler"?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline sg

  • Single posting newcomer
  • *
  • Posts: 6
Re: "Could not save config file..." Error
« Reply #14 on: August 31, 2019, 12:09:05 am »
Yes, the compiler works. When I launch the CB from CbLauncher.exe, the code compiles and runs correctly. When I say "can't find the compiler", I mean CB doesn't compile the program, as if the compiler is missing (i.e., as if I installed the CB version without the compiler.)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: "Could not save config file..." Error
« Reply #15 on: August 31, 2019, 01:20:47 am »
It is getting confusing. It is working, but it is not working. Please try to be a bit more clear!
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline sg

  • Single posting newcomer
  • *
  • Posts: 6
Re: "Could not save config file..." Error
« Reply #16 on: September 04, 2019, 02:13:55 am »
Sure, I will try to be more clear. Could you please read the first error message in this forum by 'spflanze'? I am getting the same errors he/she had (see below). I am asking how can I remove these error messages.

"Whenever I close CodeBlocks 16.01 I get two error message windows. Their messages are:
Quote

    Unable to open personal dictionary file
    Could not save config file..."


Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: "Could not save config file..." Error
« Reply #17 on: September 04, 2019, 09:06:27 am »
Yes, I've read the topic from the start. I've did it again and it is still confusing what is not working.

I guess there are multiple things broken.
Like:
1. when using cblauncher.exe - you're getting error messages and settings aren't saved
2. when using codeblocks.exe - your compilation fails
Have I understood everything you correctly?

What version are you using? What OS?
What is the content of your AppData*/CodeBlocks folder? Do you have some xml files in a compiler subfolder?

I'm not a user of cblauncher, so I cannot help much, but as a start it might help if you state the exact command you're using.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline sg

  • Single posting newcomer
  • *
  • Posts: 6
Re: "Could not save config file..." Error
« Reply #18 on: September 04, 2019, 04:41:22 pm »
Hi there,

- Windows 10
- CodeBlocks version 17.12

Users/sgare/AppData/Roaming/CodeBlocks folder has the following files (see attachment)--no XML files.

To start CB, I run CbLauncher.exe from the Program Files (x86) > CodeBlocks folder

Thanks!

Offline SaturdayScience

  • Single posting newcomer
  • *
  • Posts: 3
Re: "Could not save config file..." Error
« Reply #19 on: September 13, 2019, 07:15:56 pm »
I'm getting the same error but I think I can provide more context details. I am running CB on Win 10 Home and use CB Launcher.
If I open Watches and dock it then the perspective has changed and on exiting CB Im asked if I want to save the new perspective. The problem arises because the default.conf is located in C:\Program Files (x86)\CodeBlocks\AppData\codeblocks.

If I Launch as Administrator then the config is saved because I have sufficient rights as admin to save in C:\Program Files (x86).

So I wonder if CB has the default location foe AppData in an unusual / inappropriate location. Often AppData on Win is c:\Users\[user account]\AppData.


Offline sodev

  • Regular
  • ***
  • Posts: 497
Re: "Could not save config file..." Error
« Reply #20 on: September 13, 2019, 07:26:21 pm »
I have never used CB Launcher but isn't that the thing you use when you want a portable CodeBlocks? Because then it would make totally sense to not use system directories but the installation directory to store settings.

I always use CodeBlocks.exe and never had any of these issues.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: "Could not save config file..." Error
« Reply #21 on: September 13, 2019, 07:35:55 pm »
@SaturdayScience: Yes, this is not the correct location of the appdata. When not using the cblauncher it is somewhere in your user folder. But probably the launcher messes things up or it has some configuration options. I've never used it so I cannot comment what is going on.

But if sodev is correct then you should copy codeblocks.exe and all the other stuff in a writable folder and use it from there.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline SaturdayScience

  • Single posting newcomer
  • *
  • Posts: 3
Re: "Could not save config file..." Error
« Reply #22 on: September 14, 2019, 08:16:43 am »
Hi sodev and oBFusCATed
the explanation makes sense. Being new to C::B and Win 10 providing both 'buttons' from a standard installation I wrongly assumed launch behaved in similar fashion to e. LibreOffice general button.
As you correctly suggested simply using C::B button works flawlessly.
Thank you for your kind assistance.