[Bug 74699] Re: update-schemas: Error writing file "/var/lib/gconf/defaults/%gconf-tree.xml.new": File exists
Sam Hathaway
ubuntu.com at munkynet.org
Thu Dec 7 19:37:54 UTC 2006
More experimentation:
I again copied my /var/lib/gconf directory from my other (non-broken)
Edgy box, and am doing some experiments with that.
One test is to unregister and then register a single schema. I did this
with evince-thumbnailer-djvu.schemas:
# With virgin gconf dir from spider, unregister single schema:
root at bunny:~# gconf-schemas --unregister evince-thumbnailer-djvu.schemas
# So far so good, now register that schema again:
root at bunny:~# gconf-schemas --register evince-thumbnailer-djvu.schemas
Failed to write "/var/lib/gconf/defaults/%gconf-tree.xml": Error writing file "/var/lib/gconf/defaults/%gconf-tree.xml.new": File exists
Error syncing config data: Failed to write some configuration data to
disk
At this point, %gconf-tree.xml.new DOES exist, and consists of the first
30,839 lines of %gconf-tree.xml.
The last identical line is:
<dir name="image at vnd.djvu">
In %gconf-tree.xml, this is immediately followed by:
</dir>
but in %gconf-tree.xml.new, we get this:
<entry name="command" mtime="1165517165" type="schema" stype="string" owner="evince">
<local_schema locale="C" short_desc="">
<default type="string">
<stringvalue>evince-thumbnailer -s %s %u %o</stringvalue>
</default>
<longdesc>
And that's the end of the file. There isn't even a closing newline.
Digging deeper, I found out the exact command that gconf-schemas was
running, and executed it manually:
# With virgin gconf dir from spider, uninstall single schema:
root at bunny:~# HOME=/tmp/gconf--3PMME GCONF_CONFIG_SOURCE=xml:readwrite:/var/lib/gconf/defaults gconftool-2 --makefile-uninstall-rule /usr/share/gconf/schemas/evince-thumbnailer-djvu.schemas
Resolved address "xml:readwrite:/var/lib/gconf/defaults" to a writable configuration source at position 0
Attached schema `/schemas/desktop/gnome/thumbnailers/image at vnd.djvu/enable' to key `/desktop/gnome/thumbnailers/image at vnd.djvu/enable'
Uninstalled schema `/schemas/desktop/gnome/thumbnailers/image at vnd.djvu/enable' from locale `C'
Attached schema `/schemas/desktop/gnome/thumbnailers/image at vnd.djvu/command' to key `/desktop/gnome/thumbnailers/image at vnd.djvu/command'
Uninstalled schema `/schemas/desktop/gnome/thumbnailers/image at vnd.djvu/command' from locale `C'
# So far so good, now install that schema again:
root at bunny:~# HOME=/tmp/gconf--3PMME GCONF_CONFIG_SOURCE=xml:readwrite:/var/lib/gconf/defaults gconftool-2 --makefile-install-rule /usr/share/gconf/schemas/evince-thumbnailer-djvu.schemas
Resolved address "xml:readwrite:/var/lib/gconf/defaults" to a writable configuration source at position 0
Attached schema `/schemas/desktop/gnome/thumbnailers/image at vnd.djvu/enable' to key `/desktop/gnome/thumbnailers/image at vnd.djvu/enable'
Installed schema `/schemas/desktop/gnome/thumbnailers/image at vnd.djvu/enable' for locale `C'
Attached schema `/schemas/desktop/gnome/thumbnailers/image at vnd.djvu/command' to key `/desktop/gnome/thumbnailers/image at vnd.djvu/command'
Installed schema `/schemas/desktop/gnome/thumbnailers/image at vnd.djvu/command' for locale `C'
Failed to write "/var/lib/gconf/defaults/%gconf-tree.xml": Error writing file "/var/lib/gconf/defaults/%gconf-tree.xml.new": Inappropriate ioctl for device
Error syncing config data: Failed to write some configuration data to
disk
This does exactly the same thing to the contents of
/var/lib/gconf/defaults, but interestingly, the error message is
different! When running gconf-schemas, the error was "File exists", but
when running gconftool-2 directly, the error is "Inappropriate ioctl for
device".
So I redo the above test under strace (starting from the virgin gconf
directory of course):
# With virgin gconf dir from spider, uninstall single schema:
root at bunny:~# HOME=/tmp/gconf--3PMME GCONF_CONFIG_SOURCE=xml:readwrite:/var/lib/gconf/defaults gconftool-2 --makefile-uninstall-rule /usr/share/gconf/schemas/evince-thumbnailer-djvu.schemas
Resolved address "xml:readwrite:/var/lib/gconf/defaults" to a writable configuration source at position 0
Attached schema `/schemas/desktop/gnome/thumbnailers/image at vnd.djvu/enable' to key `/desktop/gnome/thumbnailers/image at vnd.djvu/enable'
Uninstalled schema `/schemas/desktop/gnome/thumbnailers/image at vnd.djvu/enable' from locale `C'
Attached schema `/schemas/desktop/gnome/thumbnailers/image at vnd.djvu/command' to key `/desktop/gnome/thumbnailers/image at vnd.djvu/command'
Uninstalled schema `/schemas/desktop/gnome/thumbnailers/image at vnd.djvu/command' from locale `C'
# So far so good, now install that schema again:
root at bunny:~# HOME=/tmp/gconf--3PMME GCONF_CONFIG_SOURCE=xml:readwrite:/var/lib/gconf/defaults strace -o strace.out -e write=3 -e abbrev=none gconftool-2 --makefile-install-rule /usr/share/gconf/schemas/evince-thumbnailer-djvu.schemas
strace.out: Success
strace.out: Success
Resolved address "xml:readwrite:/var/lib/gconf/defaults" to a writable configuration source at position 0
Attached schema `/schemas/desktop/gnome/thumbnailers/image at vnd.djvu/enable' to key `/desktop/gnome/thumbnailers/image at vnd.djvu/enable'
Installed schema `/schemas/desktop/gnome/thumbnailers/image at vnd.djvu/enable' for locale `C'
Attached schema `/schemas/desktop/gnome/thumbnailers/image at vnd.djvu/command' to key `/desktop/gnome/thumbnailers/image at vnd.djvu/command'
Installed schema `/schemas/desktop/gnome/thumbnailers/image at vnd.djvu/command' for locale `C'
Failed to write "/var/lib/gconf/defaults/%gconf-tree.xml": Error writing file "/var/lib/gconf/defaults/%gconf-tree.xml.new": Inappropriate ioctl for device
Error syncing config data: Failed to write some configuration data to
disk
And here's some of strace.out, with line numbers:
Here's where %gconf-tree.xml.new gets opened and mmapped:
1082 open("/var/lib/gconf/defaults/%gconf-tree.xml.new", O_WRONLY|O_CREAT, 0644) = 3
1083 fcntl64(3, F_GETFL) = 0x1 (flags O_WRONLY)
1084 fstat64(3, {st_dev=makedev(254, 0), st_ino=11763894, st_mode=S_IFREG|0644, st_nlink=1, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=0, st_size=0, st_atime=2006/12/07-14:16:25, st_mtime=2006/12/07-14:16:25, st_ctime=2006/12/07-14:16:25}) = 0
1085 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7a2d000
1086 _llseek(3, 0, [0], SEEK_CUR) = 0
1087 ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbfd88ee8) = -1 ENOTTY (Inappropriate ioctl for device)
Oh look! There's an "Inappropriate ioctl for device" error. Oh well, it doesn't seem to care.
Now we start writing the file:
1088 write(3, "<?xml version=\"1.0\"?>\n", 22) = 22
1089 | 00000 3c 3f 78 6d 6c 20 76 65 72 73 69 6f 6e 3d 22 31 <?xml ve rsion="1 |
1090 | 00010 2e 30 22 3f 3e 0a .0"?>. |
1091 write(3, "<gconf>\n", 8) = 8
1092 | 00000 3c 67 63 6f 6e 66 3e 0a <gconf>. |
This goes on for about a million lines, until we get to the last couple
of lines it writes:
211188 write(3, " "..., 75) = 75
211189 | 00000 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |
211190 | 00010 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |
211191 | 00020 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |
211192 | 00030 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |
211193 | 00040 3c 2f 64 65 66 61 75 6c 74 3e 0a </defaul t>. |
211194 write(3, " "..., 74) = 74
211195 | 00000 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |
211196 | 00010 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |
211197 | 00020 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |
211198 | 00030 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |
211199 | 00040 3c 6c 6f 6e 67 64 65 73 63 3e <longdes c> |
211200 close(3) = 0
211201 munmap(0xb7a2d000, 4096) = 0
What I don't get is why the file gets closed here -- there's no apparent
error.
211202 ioctl(2, SNDCTL_TMR_TIMEBASE or TCGETS, {c_iflags=0x6d02, c_oflags=0x5, c_cflags=0x4bf, c_lflags=0x8a3b, c_line=0, c_cc="\x03\x1c\x7f\x15\x04\x00\x01\xff\x11\x13\x1a\xff\x12\x0f\x17\x16\xff\x00\x00"}) = 0
211203 ioctl(2, SNDCTL_TMR_TIMEBASE or TCGETS, {c_iflags=0x6d02, c_oflags=0x5, c_cflags=0x4bf, c_lflags=0x8a3b, c_line=0, c_cc="\x03\x1c\x7f\x15\x04\x00\x01\xff\x11\x13\x1a\xff\x12\x0f\x17\x16\xff\x00\x00"}) = 0
211204 ioctl(2, TIOCGPTN, [16778261]) = -1 EINVAL (Invalid argument)
Then there are some more ioctls. One of them fails, but not not with
"Inappropriate ioctl for device".
211205 fstat64(2, {st_dev=makedev(0, 11), st_ino=4, st_mode=S_IFCHR|0620, st_nlink=1, st_uid=1000, st_gid=5, st_blksize=1024, st_blocks=0, st_rdev=makedev(136, 2), st_atime=2006/12/07-14:16:25, st_mtime=2006/12/07-14:16:25, st_ctime=2006/12/07-11:39:13}) = 0
211206 write(2, "Failed to write \"/var/lib/gconf/"..., 157) = 157
211207 gettimeofday({1165518988, 566470}, NULL) = 0
211208 gettimeofday({1165518988, 566712}, NULL) = 0
211209 write(2, "Error syncing config data: Faile"..., 75) = 75
211210 gettimeofday({1165518988, 567353}, NULL) = 0
And then it goes on getting the time of day for a couple dozen lines,
until:
211237 gettimeofday({1165518988, 569897}, NULL) = 0
211238 munmap(0xb79e2000, 53248) = 0
211239 exit_group(1) = ?
And that's the end!
I've attached the full strace output.
** Attachment added: "strace output from gconftool-2 --make-install-rule"
http://librarian.launchpad.net/5320572/strace.out
--
update-schemas: Error writing file "/var/lib/gconf/defaults/%gconf-tree.xml.new": File exists
https://launchpad.net/bugs/74699
More information about the desktop-bugs
mailing list