Bug 6147 - legacy action fails with "OSError: [Errno 17] File exists"
: legacy action fails with "OSError: [Errno 17] File exists"
Status: CAUSEKNOWN
Product: pkg
actions
: in105 (eb06c0fabb9a)
: ANY/Generic OpenSolaris
: P4 normal (vote)
: ---
Assigned To: pkg/actions watcher
: pkg/actions watcher
:
:
:
:
:
  Show dependency treegraph
 
Reported: 2009-01-18 14:44 UTC by Michael
Modified: 2009-10-14 16:09 UTC (History)
2 users (show)

See Also:


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description Michael 2009-01-18 14:44:53 UTC
root@trantor tmp $ uname -a
SunOS trantor 5.11 snv_105 i86pc i386 i86pc Solaris
root@trantor tmp $ pkg install -v sunstudioexpress
Creating Plan \ Vor der Evaluierung:   
UNEVALUATED:
+pkg:/sunstudioexpress@0.2008.11,5.11-0.86:20081113T205836Z

Nach der Evaluierung:
None -> pkg:/sunstudioexpress@0.2008.11,5.11-0.86:20081113T205836Z
None -> pkg:/SUNWj6dmo@0.5.11,5.11-0.105:20090108T202924Z
None -> pkg:/SUNWj6cfg@0.5.11,5.11-0.105:20090108T202915Z
None -> pkg:/SUNWhea@0.5.11,5.11-0.105:20090108T205626Z
None -> pkg:/SUNWarc@0.5.11,5.11-0.105:20090108T200606Z
None -> pkg:/SUNWj6man@0.5.11,5.11-0.105:20090108T202940Z
None -> pkg:/SUNWj6dev@0.5.11,5.11-0.105:20090108T202915Z
None -> pkg:/SUNWj6dvx@0.5.11,5.11-0.105:20090108T202854Z
None -> pkg:/SUNWj6rtx@0.5.11,5.11-0.105:20090108T205649Z
None -> pkg:/SUNWj6dmx@0.5.11,5.11-0.105:20090108T202853Z
Actuators:
      restart_fmri: svc:/application/font/fc-cache:default
None
DOWNLOAD                                    PKGS       FILES     XFER (MB)
Completed                                  10/10   8846/8846 241.71/241.71 

PHASE                                        ACTIONS
Install Phase                            14756/14760 Action install failed for
'SUNWfixes' (pkg:/SUNWj6dev):
  OSError: [Errno 17] File exists
Die Startumgebung snv-105 konnte nicht aktualisiert werden. Vor dem
fehlgeschlagenen Versuch wurde ein Schnappschuss erstellt und hier geladen:
/tmp/tmprHR-ja. Verwenden Sie 'beadm unmount snv-106' und 'beadm activate
snv-106', wenn Sie diese SU booten möchten.
pkg: Während der Installation ist ein unerwarteter Fehler aufgetreten: [Errno
17] File exists
Traceback (most recent call last):
  File "/usr/bin/pkg", line 2235, in ?
    __ret = main_func()
  File "/usr/bin/pkg", line 2184, in main_func
    return install(mydir, pargs)
  File "/usr/bin/pkg", line 733, in install
    api_inst.execute_plan()
  File "/usr/lib/python2.4/vendor-packages/pkg/client/api.py", line 482, in
execute_plan
    self.img.imageplan.execute()
  File "/usr/lib/python2.4/vendor-packages/pkg/client/imageplan.py", line 691,
in execute
    p.execute_install(src, dest)
  File "/usr/lib/python2.4/vendor-packages/pkg/client/pkgplan.py", line 278, in
execute_install
    dest.install(self, src)
  File "/usr/lib/python2.4/vendor-packages/pkg/actions/legacy.py", line 96, in
install
    os.link(pkginfo, linkfile)
OSError: [Errno 17] File exists


pkg: Dies ist ein interner Fehler. Bitte informieren Sie die Entwickler,
indem Sie den Fehler unter http://defect.opensolaris.org protokollieren. Geben
Sie
die oben stehenden Traceback-Daten und diese Meldung an. Die pkg(5)-Version ist
'eb06c0fabb9a'.
Comment 1 Danek Duvall 2009-01-18 15:46:42 UTC
I'm not sure how you got into this situation, but you should be able to get out
of it reasonably easily.  In /var/sadm/pkg/SUNWfixes, there should be a series
of files named "pkginfo", "pkginfo.2", "pkginfo.3", etc.  They should be
consecutively numbered, up until the link count of the files (they're all
hardlinked to each other).  So if you run "ls -l /var/sadm/pkg/SUNWfixes" and
the second column is filled with "6", then the last file should be "pkginfo.6".
 If that's not the case, make it so (and make sure there are no holes in the
numbering) and try again.  Let us know what the contents of that directory
prior to any correction, though.

Did you have an uninstall fail at some point since your last upgrade?  Maybe an
upgrade failed?
Comment 2 Michael 2009-01-19 01:05:51 UTC
root@trantor SUNWfixes $ /bin/ls -al /var/sadm/pkg/SUNWfixes
total 100
drwxr-xr-x   2 root     root          22 Jan 14 09:31 .
dr-xr-xr-x 915 root     sys          915 Jan 18 22:53 ..
-rw-r--r--   1 root     root         105 Nov 20 01:12 pkginfo
-rw-r--r--   1 root     root         105 Nov 20 01:12 pkginfo.10
-rw-r--r--   1 root     root         105 Nov 20 01:12 pkginfo.11
-rw-r--r--   1 root     root         105 Nov 20 01:12 pkginfo.12
-rw-r--r--   1 root     root         105 Nov 20 01:12 pkginfo.13
-rw-r--r--   1 root     root         105 Nov 20 01:12 pkginfo.14
-rw-r--r--   1 root     root         105 Nov 20 01:12 pkginfo.15
-rw-r--r--   1 root     root         105 Nov 20 01:12 pkginfo.16
-rw-r--r--   1 root     root         105 Nov 20 01:12 pkginfo.17
-rw-r--r--   1 root     root         105 Nov 20 01:12 pkginfo.18
-rw-r--r--   1 root     root         105 Nov 20 01:12 pkginfo.19
-rw-r--r--   1 root     root         105 Nov 20 01:12 pkginfo.2
-rw-r--r--   1 root     root         105 Nov 20 01:12 pkginfo.20
-rw-r--r--   1 root     root         105 Nov 20 01:12 pkginfo.3
-rw-r--r--   1 root     root         105 Nov 20 01:12 pkginfo.4
-rw-r--r--   1 root     root         105 Nov 20 01:12 pkginfo.5
-rw-r--r--   1 root     root         105 Nov 20 01:12 pkginfo.6
-rw-r--r--   1 root     root         105 Nov 20 01:12 pkginfo.7
-rw-r--r--   1 root     root         105 Nov 20 01:12 pkginfo.8
-rw-r--r--   1 root     root         105 Nov 20 01:12 pkginfo.9

After fixing:
root@trantor SUNWfixes $ /bin/ls -al /var/sadm/pkg/SUNWfixes
total 100
drwxr-xr-x   2 root     root          22 Jan 19 09:43 .
dr-xr-xr-x 915 root     sys          915 Jan 18 22:53 ..
-rw-r--r--  20 root     root         105 Nov 20 01:12 pkginfo
-rw-r--r--  20 root     root         105 Nov 20 01:12 pkginfo.10
-rw-r--r--  20 root     root         105 Nov 20 01:12 pkginfo.11
-rw-r--r--  20 root     root         105 Nov 20 01:12 pkginfo.12
-rw-r--r--  20 root     root         105 Nov 20 01:12 pkginfo.13
-rw-r--r--  20 root     root         105 Nov 20 01:12 pkginfo.14
-rw-r--r--  20 root     root         105 Nov 20 01:12 pkginfo.15
-rw-r--r--  20 root     root         105 Nov 20 01:12 pkginfo.16
-rw-r--r--  20 root     root         105 Nov 20 01:12 pkginfo.17
-rw-r--r--  20 root     root         105 Nov 20 01:12 pkginfo.18
-rw-r--r--  20 root     root         105 Nov 20 01:12 pkginfo.19
-rw-r--r--  20 root     root         105 Nov 20 01:12 pkginfo.2
-rw-r--r--  20 root     root         105 Nov 20 01:12 pkginfo.20
-rw-r--r--  20 root     root         105 Nov 20 01:12 pkginfo.3
-rw-r--r--  20 root     root         105 Nov 20 01:12 pkginfo.4
-rw-r--r--  20 root     root         105 Nov 20 01:12 pkginfo.5
-rw-r--r--  20 root     root         105 Nov 20 01:12 pkginfo.6
-rw-r--r--  20 root     root         105 Nov 20 01:12 pkginfo.7
-rw-r--r--  20 root     root         105 Nov 20 01:12 pkginfo.8
-rw-r--r--  20 root     root         105 Nov 20 01:12 pkginfo.9

root@trantor tmp $ pkg install -v sunstudioexpress

It works :-)

The installation from blastwave failed. I have found a workaround for this. And
I have made an update from the ineratial installation to Build 105.

thanks for your help.
Comment 3 Danek Duvall 2009-01-19 07:58:28 UTC
We may have gotten you around the issue, but we need to do something better
than emit a stack trace when this happens.  I wish we knew how your system got
into this situation, though.  I don't suppose you used rsync (without -H) or
some other file transfer program to move/copy /var/sadm/pkg around, did you? 
I'm not sure how else the links would have been broken, and there's no way that
the pkg code would have done this independently.
Comment 4 Michael 2009-01-19 08:58:55 UTC
I create a own filesystem for /var and then I moved the content from the old
/var to the new /var

# zfs create rpool/ROOT/opensolaris-1/var
# zfs set mountpoint=/tmp_var rpool/ROOT/opensolaris-1/var
# beadm mount opensolaris-1
# mv /a/var/* /tmp_var
# rm -rf /a/var
# beadm unmount opensolaris-1
# zfs set canmount=noauto create rpool/ROOT/opensolaris-1/var
# zfs set mountpoint=/var rpool/ROOT/opensolaris-1/var
# reboot

I think this are my steps to create a own filesystem for /var
Comment 5 Danek Duvall 2009-01-19 09:36:03 UTC
Please leave the bug open; like I said, just because we've worked around it for
you doesn't mean it's fixed.

Thanks for showing us the steps you took -- the mv command wouldn't have
preserved hard links, and so that's why you ran into this problem.  cpio would
have done that right, or rsync with the -H option.

Note also that /var as a separate filesystem isn't supported on OpenSolaris. 
While we need to do more work to separate user data from system data, there's
still plenty of system data under /var that won't get snapshotted or rolled
back as appropriate during packaging operations, so you may not be able to
recover from failure.
Comment 6 johansen 2009-10-14 16:09:25 UTC
*** Bug 7855 has been marked as a duplicate of this bug. ***