Closed Bug 926415 Opened 8 years ago Closed 8 years ago

generate_diff.py fails with WindowsError: [Error 5] Access is denied: '<...>\\tmp5zdeg2\\mozbase\\.git\\objects\\pack\\pack-324f0d07f164557fdfa152cb92ee3d6e028c178b.idx'

Categories

(Testing :: Mozbase, defect)

x86_64
Windows 8
defect
Not set
major

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: emorley, Assigned: emorley)

References

Details

Attachments

(1 file)

[/c/src-gecko/inbound/testing/mozbase]$ python generate_diff.py mozcrash=0.9 -o ~/mozcrash-mc-bump.diff
Cloning into 'mozbase'...
remote: Counting objects: 5462, done.
remote: Compressing objects: 100% (3436/3436), done.
remote: Total 5462 (delta 2310), reused 5088 (delta 1982)
Receiving objects: 100% (5462/5462), 1.96 MiB | 1.75 MiB/s, done.
Resolving deltas: 100% (2310/2310), done.
Note: checking out 'mozcrash-0.9'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b new_branch_name

HEAD is now at 7961549... Bug 926408 - Bump mozcrash to v0.9
Switched to branch 'master'
Note: checking out 'mozcrash-0.9'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b new_branch_name

HEAD is now at 7961549... Bug 926408 - Bump mozcrash to v0.9
reverting testing\mozbase\mozcrash\mozcrash\mozcrash.py
reverting testing\mozbase\mozcrash\setup.py
reverting testing\mozbase\packages.txt
Traceback (most recent call last):
  File "generate_diff.py", line 388, in <module>
    main()
  File "generate_diff.py", line 383, in main
    shutil.rmtree(tempdir)
  File "c:\Python27\lib\shutil.py", line 247, in rmtree
    rmtree(fullname, ignore_errors, onerror)
  File "c:\Python27\lib\shutil.py", line 247, in rmtree
    rmtree(fullname, ignore_errors, onerror)
  File "c:\Python27\lib\shutil.py", line 247, in rmtree
    rmtree(fullname, ignore_errors, onerror)
  File "c:\Python27\lib\shutil.py", line 247, in rmtree
    rmtree(fullname, ignore_errors, onerror)
  File "c:\Python27\lib\shutil.py", line 252, in rmtree
    onerror(os.remove, fullname, sys.exc_info())
  File "c:\Python27\lib\shutil.py", line 250, in rmtree
    os.remove(fullname)
WindowsError: [Error 5] Access is denied: 'c:\\users\\ed\\appdata\\local\\temp\\tmp5zdeg2\\mozbase\\.git\\objects\\pack\\pack-324f0d07f164557fdfa152cb92ee3d6e028c178b.idx'
Any ideas?
Flags: needinfo?(jhammel)
Note, this is just during cleanup, so the diff was generated fine.
(And presuming this is more nonsense 'Windows hangs onto crap for longer than it should, so we either sleep or just catch and bail)
I'm not sure if we have a general strategy for this yet; you could try mozfile.rmtree, which, in theory, should work around this (but in practice may very well not).  Or catch+bail could be fine here:  iirc, it is only tempfiles.
Flags: needinfo?(jhammel)
Depends on: 928911
A sleep didn't work & don't have time to test using mozfile at the moment, so filed bug 928911 and just catching for now. (At least with this, we get the diff path printed to stdout and don't get the impression the diff generation failed).
Attachment #819708 - Flags: review?(jhammel)
Assignee: nobody → emorley
Status: NEW → ASSIGNED
Example:
{
[/c/src-gecko/inbound/testing/mozbase]$ python generate_diff.py --develop mozcrash --no-check
Cloning into 'mozbase'...
remote: Counting objects: 5470, done.
remote: Compressing objects: 100% (3444/3444), done.
remote: Total 5470 (delta 2316), reused 5090 (delta 1982)R
Receiving objects: 100% (5470/5470), 1.96 MiB | 1.68 MiB/s, done.
Resolving deltas: 100% (2316/2316), done.
Already on 'master'
Already on 'master'
Already on 'master'
Error removing temporary directory (c:\users\ed\appdata\local\temp\tmp4nwaoz) - please remove manually (bug 928911).
Diff at c:\src-gecko\inbound\testing\mozbase\9d51640476df916a489342e3fefd482896addbdb.diff
}
Comment on attachment 819708 [details] [diff] [review]
Catch exception and carry on

Review of attachment 819708 [details] [diff] [review]:
-----------------------------------------------------------------

Probably not the best x-platform thing to do:

>>> try:
...   dict()['foo']
... except WindowsError:
...   pass
... 
Traceback (most recent call last):
  File "<stdin>", line 3, in <module>
NameError: name 'WindowsError' is not defined

I'd be fine catching on Exception if that works for you.
Attachment #819708 - Flags: review?(jhammel) → review-
generate_diff.py no longer exists after bug 949600.
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.