"IOError: [Errno 13] Permission denied" when Bazaar Explorer has opened a directory

Bug #862335 reported by André Bachmann
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Medium
Unassigned

Bug Description

I'm using Bazaar 2.4.1-1 (with qbzr 0.21.1 and Explorer 1.2.1) on Win7 32 Bit.

I just converted a workspace directory from TI Code Composer Studio v4 (which is based on Eclipse 3.2) while it was closed to a standalone tree (bzr init within this folder) and did add all files (bzr add). After that, I started Bazaar Explorer and committed this as revision 1 with the help of Bazaar Explorer. The next step was starting TI CCS, and after some seconds (perhaps after CCS changed or locked a file), Bazaar Explorer gave me this error:

IOError: [Errno 13] Permission denied

.bzr.log is attached.

264.175 Traceback (most recent call last):
  File "C:/Program Files/Bazaar/plugins\explorer\lib\view_workingtree.py", line 135, in refresh_view
  File "C:/Program Files/Bazaar/plugins\explorer\lib\html_report_view.py", line 56, in refresh_view
  File "C:/Program Files/Bazaar/plugins\explorer\lib\view_workingtree.py", line 152, in report_text
  File "C:/Program Files/Bazaar/plugins\explorer\lib\status_report.py", line 196, in __init__
  File "C:/Program Files/Bazaar/plugins\explorer\lib\status_report.py", line 213, in _collect_data
  File "C:/Program Files/Bazaar/plugins\explorer\lib\status_data.py", line 47, in get_status_info
  File "C:/Program Files/Bazaar/plugins\explorer\lib\status_data.py", line 65, in changes_between_trees
  File "bzrlib\tree.pyo", line 92, in changes_from
  File "bzrlib\decorators.pyo", line 154, in read_locked
  File "bzrlib\tree.pyo", line 1020, in compare
  File "bzrlib\delta.pyo", line 127, in _compare_trees
  File "_dirstate_helpers_pyx.pyx", line 1459, in bzrlib._dirstate_helpers_pyx.ProcessEntryC.__next__ (bzrlib\_dirstate_helpers_pyx.c:12267)
  File "_dirstate_helpers_pyx.pyx", line 1732, in bzrlib._dirstate_helpers_pyx.ProcessEntryC._iter_next (bzrlib\_dirstate_helpers_pyx.c:14981)
  File "_dirstate_helpers_pyx.pyx", line 1831, in bzrlib._dirstate_helpers_pyx.ProcessEntryC._loop_one_block (bzrlib\_dirstate_helpers_pyx.c:15876)
  File "_dirstate_helpers_pyx.pyx", line 1230, in bzrlib._dirstate_helpers_pyx.ProcessEntryC._process_entry (bzrlib\_dirstate_helpers_pyx.c:9167)
  File "bzrlib\workingtree_4.pyo", line 1392, in stat_and_sha1
  File "bzrlib\osutils.pyo", line 673, in size_sha_file
IOError: [Errno 13] Permission denied

Revision history for this message
André Bachmann (andrebachmann-dd) wrote :
Revision history for this message
Martin Pool (mbp) wrote :

could it be that there is actually some file in that directory that you don't have permission to read?

description: updated
tags: added: dirstate win32
Changed in bzr:
status: New → Confirmed
importance: Undecided → Low
importance: Low → Medium
Revision history for this message
André Bachmann (andrebachmann-dd) wrote :

I'm not sure. Maybe TI Code Composer Studio creates a (temporary) file without read permissions. How can I check this?

Revision history for this message
Martin Pool (mbp) wrote : Re: [Bug 862335] Re: "IOError: [Errno 13] Permission denied" when Bazaar Explorer has opened a directory

Three ways you can check
- hunt through the directories in explorer
- just use the Windows Properties change acl box to give yourself r/w
access to everything
- run
   set BZR_PDB=1
   bzr st
then when it crashes it should go in the debugger and then say
   p locals()

Revision history for this message
André Bachmann (andrebachmann-dd) wrote :

This is the output of the last of your options:

C:\work\workspace4>set BZR_PDB=1
C:\work\workspace4>bzr st
bzr: ERROR: [Errno 13] Permission denied
**** entering debugger
> c:\work\workspace4\bzrlib\osutils.pyo(673)size_sha_file()
(Pdb) p locals()
{'s': <sha1 HASH object @ 0237B6C0>, 'BUFSIZE': 131072, 'f': <closed file u'C:/work/workspace4//.metadata/.plugins/org.eclipse.rtsc.xdctools.model/XDCModel.log.lck', mode 'rb' at 0x023FE0D0>, 'size': 0}
(Pdb)

Revision history for this message
Martin Packman (gz) wrote :

This looks like bzr explorer is trying to inspect files your IDE is using to track its internal state, and has locked and held open. Have you added anything to .bzrignore so that these kinds of things are not added or committed? You may just need to do something like `bzr ignore "./.metadata"` before adding files from your workspace for versioning.

Revision history for this message
Martin Pool (mbp) wrote :

Ignoring that file is a good idea; however also bzr should
- not fail entirely if there's an unreadable file
- probably log or print the name of the file
m

Revision history for this message
André Bachmann (andrebachmann-dd) wrote :

I also think that ignoring such files would be the best way, but as you said: bzr shouldn't throw an error and do nothing further. It should rather show a warning about the specific file which causes this problem.

Martin Pool (mbp)
tags: added: easy error-reporting
Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.