Google Earth can't write to settings dir

Asked by Julian Klein on 2011-02-11

I've installed Google Earth version 6.0.1.2032 (beta) from the Google homepage on my Ubuntu 10.4. system.

On program startup it displays a message, that it can't write to the actual location of the file in the Cache or in "My Places" and that the values now would be set as following: "My Places-Path ~/.googleearth" "Cache-Path: ~/.googleearth/Cache".
These direcories exist and are read/write for the standard user.

On program exit it doesn't remember any of the settings made in the layers section (displaying of borders, streets, etc.). All this is gone on next program startup. Changes made to My Places are saved and remembered the next startup. The Cache seems to work properly (image data is avaliable in offline use). How can I save the layer settings for permanent use?

When I install the Google Earth package from the Ubuntu Repository (version 5.2), I get a more or less similar behaviour. The only thing here is, that additionally no changes to My Places are saved.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu googleearth-package Edit question
Assignee:
No assignee Edit question
Solved by:
Julian Klein
Solved:
2011-03-13
Last query:
2011-03-13
Last reply:
2011-03-06

try:

mkdir ~/.googleearth; mkdir ~/.googleearth/Cache

Then rerun, if you get any errors about folders existing etc, please post the error.

Thanks

Julian Klein (margin-auto) said : #2

~/.googleearth and ~/.googleearth/Cache *do* exist and are readable and writeable for the standard user. So they can't be created with mkdir.
I've already tried to delete ~/.googleearth and to let it be re-created on program startup. Additionally I tried various attempts with chmod. All without success.

The error message on program startup stays the same as described in the first post, or here in german original:

"Google Earth konnte nicht in den aktuellen Speicherort der Datei im Cache oder in "Meine Orte" schreiben. Die Werte werden wie folgt festgelegt:
"Meine Orte"-Pfad: "/home/user/.googleearth"
Cache-Pfad: "/home/user/.googleearth/Cache""

Is your username on the Ubuntu system actually "user"? (If not, this suggests a bug in Google Earth, as well as a possible workaround.)

Julian Klein (margin-auto) said : #4

No, my username isn't "user" in reality. I just replaced this in posting the error message here. The paths in the original error message are correct and indicate my actual home directory.

Let's check all the permissions on all the files and directories in your user-specific Google Earth data directory tree:

ls -ld ~/.googleearth; ls -lR ~/.googleearth

Also, does Google Earth work properly when run by a different user on the same machine?

Julian Klein (margin-auto) said : #6

Google Earth works well started as well as root, as as newly created temp user. No error message, and all changes to the layers are remembered.
I already tried to delete ~/.googleearth and to let it be re-created on next program startup but without success.

myuser@myuser-laptop:~$ ls -ld ~/.googleearth; ls -lR ~/.googleearth
drwx------ 5 myuser myuser 4096 2011-02-12 20:07 /home/myuser/.googleearth
/home/myuser/.googleearth:
insgesamt 4092
drwx------ 4 myuser myuser 4096 2011-02-06 16:28 Cache
drwx------ 2 myuser myuser 4096 2011-02-11 13:22 crashlogs
lrwxrwxrwx 1 myuser myuser 10 2011-02-12 20:07 instance-running-lock -> /proc/5747
-rw-r--r-- 1 myuser myuser 25729 2011-02-06 16:34 myplaces.backup-6-2-2011.kml
-rw-r--r-- 1 myuser myuser 855986 2011-02-12 20:09 myplaces.backup.kml
-rw-r--r-- 1 myuser myuser 855969 2011-02-12 20:10 myplaces.kml
-rw-r--r-- 1 myuser myuser 855969 2011-02-12 20:09 myplaces.kml.tmp
-rw-r--r-- 1 myuser myuser 1524058 2011-02-06 16:37 reseau.gif
drwx------ 15 myuser myuser 4096 2011-02-12 20:08 Temp

/home/myuser/.googleearth/Cache:
insgesamt 131452
-rw------- 1 myuser myuser 134252032 2011-02-12 20:10 dbCache.dat
-rw------- 1 myuser myuser 181350 2011-02-12 20:10 dbCache.dat.index
-rw-r--r-- 1 myuser myuser 125287 2011-02-12 20:10 dbroot_cache
drwxr-xr-x 2 myuser myuser 12288 2011-02-11 17:47 icons
drwxr-xr-x 2 myuser myuser 4096 2011-02-06 16:28 models

/home/myuser/.googleearth/Cache/icons:
insgesamt 432
-rw-r--r-- 1 myuser myuser 241 2011-02-12 20:08 kh.google.com_icons_1025_l.png
-rw-r--r-- 1 myuser myuser 689 2011-02-12 20:07 kh.google.com_icons_1050_l.png
-rw-r--r-- 1 myuser myuser 1272 2011-02-12 20:07 kh.google.com_icons_3d_buildings_new_l.png
-rw-r--r-- 1 myuser myuser 226 2011-02-12 20:08 kh.google.com_icons_773_l.png
-rw-r--r-- 1 myuser myuser 654 2011-02-12 20:07 kh.google.com_icons_blue_star_l.png
-rw-r--r-- 1 myuser myuser 432 2011-02-12 20:08 kh.google.com_icons_bus_blue_lhp_l.png
-rw-r--r-- 1 myuser myuser 463 2011-02-12 20:07 kh.google.com_icons_census_new_l.png
-rw-r--r-- 1 myuser myuser 1404 2011-02-12 20:08 kh.google.com_icons_city_capital_star.png
-rw-r--r-- 1 myuser myuser 393 2011-02-12 20:08 kh.google.com_icons_city_major.png
-rw-r--r-- 1 myuser myuser 3474 2011-02-12 20:08 kh.google.com_icons_de-sbahn_tiny.png
-rw-r--r-- 1 myuser myuser 589 2011-02-12 20:08 kh.google.com_icons_dg_coverage_l.png
-rw-r--r-- 1 myuser myuser 464 2011-02-12 20:08 kh.google.com_icons_ferry_blue_lhp_l.png
-rw-r--r-- 1 myuser myuser 432 2011-02-12 20:07 kh.google.com_icons_flag64_l.png
-rw-r--r-- 1 myuser myuser 440 2011-02-12 20:08 kh.google.com_icons_funicular_blue_lhp_l.png
-rw-r--r-- 1 myuser myuser 139 2011-02-12 20:07 kh.google.com_icons_generic_poi_l.png
-rw-r--r-- 1 myuser myuser 844 2011-02-12 20:08 kh.google.com_icons_geoeye32_l.png
-rw-r--r-- 1 myuser myuser 405 2011-02-12 20:08 kh.google.com_icons_geographic_features64_l.png
-rw-r--r-- 1 myuser myuser 887 2011-02-12 20:07 kh.google.com_icons_lil_earth_l.png
-rw-r--r-- 1 myuser myuser 496 2011-02-12 20:08 kh.google.com_icons_logo-spot2_l.png
-rw-r--r-- 1 myuser myuser 383 2011-02-12 20:08 kh.google.com_icons_metro_blue_lhp_l.png
-rw-r--r-- 1 myuser myuser 405 2011-02-12 20:08 kh.google.com_icons_mountains64_l.png
-rw-r--r-- 1 myuser myuser 902 2011-02-12 20:07 kh.google.com_icons_ocean_l.png
-rw-r--r-- 1 myuser myuser 204 2011-02-12 20:07 kh.google.com_icons_panoramio_photo_square_l.png
-rw-r--r-- 1 myuser myuser 369 2011-02-12 20:09 kh.google.com_icons_panoramio_photo_square.png
-rw-r--r-- 1 myuser myuser 415 2011-02-12 20:08 kh.google.com_icons_parks64_l.png
-rw-r--r-- 1 myuser myuser 390 2011-02-12 20:08 kh.google.com_icons_plane_blue_lhp_l.png
-rw-r--r-- 1 myuser myuser 159 2011-02-12 20:08 kh.google.com_icons_poly-closed-lilac_l.png
-rw-r--r-- 1 myuser myuser 190 2011-02-12 20:08 kh.google.com_icons_poly-closed-ltyellow_l.png
-rw-r--r-- 1 myuser myuser 163 2011-02-12 20:08 kh.google.com_icons_poly-closed-mintgrn_l.png
-rw-r--r-- 1 myuser myuser 461 2011-02-12 20:08 kh.google.com_icons_rail_blue_lhp_l.png
-rw-r--r-- 1 myuser myuser 3389 2011-02-12 20:08 kh.google.com_icons_rail_blue_tiny.png
-rw-r--r-- 1 myuser myuser 239 2011-02-12 20:07 kh.google.com_icons_roads_legend_l.png
-rw-r--r-- 1 myuser myuser 419 2011-02-12 20:08 kh.google.com_icons_tram_blue_lhp_l.png
-rw-r--r-- 1 myuser myuser 154 2011-02-12 20:08 kh.google.com_icons_water64_l.png
-rw-r--r-- 1 myuser myuser 606 2011-02-12 20:08 kh.google.com_icons_waters64_l.png
-rw-r--r-- 1 myuser myuser 509 2011-02-12 20:08 kh.google.com_icons_wiki_white_l.png

/home/myuser/.googleearth/Cache/models:
insgesamt 0

/home/myuser/.googleearth/crashlogs:
insgesamt 24
-rw-r--r-- 1 myuser myuser 1005 2011-02-11 11:55 crashlog-4d5515bd.txt
-rw-r--r-- 1 myuser myuser 1729 2011-02-11 13:22 crashlog-4d5529ea.txt

/home/myuser/.googleearth/Temp:
insgesamt 52
drwxr-xr-x 2 myuser myuser 4096 2011-02-06 16:29 ge10721
drwxr-xr-x 2 myuser myuser 4096 2011-02-06 16:29 ge10753
drwxr-xr-x 2 myuser myuser 4096 2011-02-06 16:34 ge11144
drwxr-xr-x 2 myuser myuser 4096 2011-02-06 16:38 ge11221
drwxr-xr-x 2 myuser myuser 4096 2011-02-06 16:41 ge11366
drwxr-xr-x 2 myuser myuser 4096 2011-02-06 16:42 ge11525
drwxr-xr-x 2 myuser myuser 4096 2011-02-12 17:05 ge2305
drwxr-xr-x 2 myuser myuser 4096 2011-02-11 11:55 ge5560
drwxr-xr-x 2 myuser myuser 4096 2011-02-11 11:57 ge5729
drwxr-xr-x 2 myuser myuser 4096 2011-02-12 20:10 ge5747
drwxr-xr-x 2 myuser myuser 4096 2011-02-11 13:16 ge6254
drwxr-xr-x 2 myuser myuser 4096 2011-02-09 13:55 ge7127
drwxr-xr-x 2 myuser myuser 4096 2011-02-11 17:47 ge9523

/home/myuser/.googleearth/Temp/ge10721:
insgesamt 0

/home/myuser/.googleearth/Temp/ge10753:
insgesamt 0

/home/myuser/.googleearth/Temp/ge11144:
insgesamt 0

/home/myuser/.googleearth/Temp/ge11221:
insgesamt 0

/home/myuser/.googleearth/Temp/ge11366:
insgesamt 0

/home/myuser/.googleearth/Temp/ge11525:
insgesamt 0

/home/myuser/.googleearth/Temp/ge2305:
insgesamt 0

/home/myuser/.googleearth/Temp/ge5560:
insgesamt 0

/home/myuser/.googleearth/Temp/ge5729:
insgesamt 0

/home/myuser/.googleearth/Temp/ge5747:
insgesamt 0

/home/myuser/.googleearth/Temp/ge6254:
insgesamt 0

/home/myuser/.googleearth/Temp/ge7127:
insgesamt 0

/home/myuser/.googleearth/Temp/ge9523:
insgesamt 0

Sorry about the delay.

What happens if you quit Google Earth, run the commands

cd ~/.config/Google
mv GoogleEarthPlus.conf GoogleEarthPlus.conf.old

and then try running Google Earth again? Does that fix the problem?

If not, then run the additional command

ls -ld; ls -lR

and post all the text from the Terminal here.

Julian Klein (margin-auto) said : #8

Renaming of GoogleEarthPlus.conf isn't possible as described, permission denied. When I rename the file with sudo, GE starts up without any error message and all settings and placemarks resetted. At program shutdown, a message is displayed that the changes to My Places can't be saved, the file can't be accessed. No changes to the settings or in My Places are saved for next program startup.

The additional command gves me:

myuser@myuser-laptop:~/.config/Google$ ls -ld; ls -lR
drwxr-xr-x 2 root root 4096 2011-02-26 08:37 .
.:
insgesamt 32
-rw-r--r-- 1 root root 9160 2011-02-13 08:30 GECommonSettings.conf
-rw-r--r-- 1 root root 2408 2011-02-13 08:30 GoogleEarthPlus.conf.old

My last suggestion was based on the idea that GoogleEarthPlus.conf was perhaps corrupted. In hindsight, it seems obvious that the more likely problem is that the file had the wrong ownership/permissions. That supposition is further borne out by your inability to rename it (except by becoming root), and by the renamed file showing that it is owned by root.

So, try changing its user and group owners to your user and group:

cd ~/.config/Google
sudo chown myuser *
chgrp myuser *

(Of course, replace "myuser" with your username.)

If that fixes the problem, then it was probably caused by your running Google Earth as root. You can run Google Earth as root (though it's better to run it as a limited user); however, if you do, it is best to use "gksu", "gksudo", or "sudo -H" instead of plain "sudo". Those ways will make it use configuration files in root's home folder (/root) instead of your own (/home/myuser); therefore, running it with root using one of those commands will not result in root taking ownership of your user-specific configuration files.

Julian Klein (margin-auto) said : #10

Sorry for my delays but I only find time to work on the problem on weekends.

Your suggestion with chown and chgrp didn't work. It still saves no changes to My Places or displayed layers and displays the error message described above.

I didn't understand your explanations about running googleearth as root, sry. Is there a way to run googleearth as root using ~/.googleearth as settings dir? (I'd prefer this to be the files included in my backup of ~/) Is it recommended to run googleearth as root or may this cause some problems or security threats?

"Sorry for my delays but I only find time to work on the problem on weekends."

No problem.

"Your suggestion with chown and chgrp didn't work."

Were the user and group owners of the configuration file(s) successfully changed? After you ran Google Earth again, what did the permissions look like?

"I didn't understand your explanations about running googleearth as root, sry."

See https://help.ubuntu.com/community/RootSudo#Graphical%20sudo.

By the way, on a (properly configured) Ubuntu system, gksu and gksudo act the same way and can be used interchangeably, except that gksu supports a couple of options to explicitly make it use su or sudo as the backend. (If your system were configured otherwise, you would have noticed more far-reaching problems already.) The gksudo command uses sudo as its backend on all systems no matter the configuration--that's the point--so it doesn't need those options.

"Is there a way to run googleearth as root using ~/.googleearth as settings dir?"

Yes, run it the way you've been running it (i.e. with sudo instead of gksu/gksudo, and don't pass the -H option to sudo). But you'll experience the problems documented in the page linked to above. It's possible that the problem you're currently experiencing (which this whole question is about) were brought about by running Google Earth as root while still having it use configuration files in your (non-root) user account's home directory.

"(I'd prefer this to be the files included in my backup of ~/)"

I'm not sure I understand what you mean. Do you just mean that you regularly back up your home directory, so you want the configuration files to be contained in your own home directory? Or are you actually saying that you'd *prefer* that Google Earth use a configuration file *inside* your backup, instead of in your active home directory?

root's home directory is /root. You can back that up too. But it's even better just not to run applications as root unnecessarily. See below.

"Is it recommended to run googleearth as root or may this cause some problems or security threats?"

It's not recommended to run *any* program as root unless you can articulate a specific reason why it needs to be run as root. You should run programs as root to perform system administration tasks (when necessary...some programs, like System > Administration > Users and Groups, don't need to be run as root even to administer the system, because they instead use PolicyKit, which runs in the background as root and allows only authorized users to perform administrative actions).

In particular, however, it is particularly bad to run Internet applications as root, for security reasons. Google Earth is an Internet application. However, this is not as bad as running a web browser or email client as root, since the content you're accessing with Google Earth is largely trusted in the weak sense that it comes from Google and not from just anybody.

As a workaround for the current problem, until we solve it, it would be preferable to run Google Earth as another non-root user, which you have confirmed works. You can run a graphical application as an alternate, non-root user by running

gksu -u <user> <command>

where <user> is replaced with the username of the alternate users, and <command> is replaced with the command you'd run to launch the application as yourself. This way, you don't actually have to log out and back in as a different user (or to switch users) to run Google Earth as the alternate user.

Julian Klein (margin-auto) said : #12

~/.config/Google still belonged to root. I deleted this dir and it was properly rebuilt at next program startup. Now everything works fine! :-) Changes to My Places and layers are properly saved and restored. Thanx for your help.
Maybe this is caused in installing GoogleEarth as root an then immediatly run the program from within the installer ("Installation finished. [X] Run GoogleEarth now") still as root.