Windows: Cannot commit - ERROR: No such file: 'rm1cycapo9ouaxx8wrq9.pack'

Asked by Mikko Ohtamaa

Looks like commit tries to open some file and it fails without giving exact reason.

-v does not give further info.

C:\Symbian\9.2\S60_3rd_FP1\pys60com\pys60community\src>bzr commit
bzr: ERROR: No such file: 'smq31ng0zp674j1yb75i.pack': [Errno 2] No such file or directory

C:\Symbian\9.2\S60_3rd_FP1\pys60com\pys60community\src>bzr commit
bzr: ERROR: No such file: 'wwhsa11c7l9d7ekmecrt.pack': [Errno 2] No such file or directory

C:\Symbian\9.2\S60_3rd_FP1\pys60com\pys60community\src>bzr commit
bzr: ERROR: No such file: 'gmi5j2zqh1eav4u7ev28.pack': [Errno 2] No such file or directory

C:\Symbian\9.2\S60_3rd_FP1\pys60com\pys60community\src>bzr commit
bzr: ERROR: No such file: 'rm1cycapo9ouaxx8wrq9.pack': [Errno 2] No such file or directory

Question information

Language:
English Edit question
Status:
Solved
For:
Bazaar Edit question
Assignee:
No assignee Edit question
Solved by:
Mikko Ohtamaa
Solved:
Last query:
Last reply:
Revision history for this message
Mikko Ohtamaa (mikko-red-innovation) said :
#1

Ok, fixed it.

.bzr\repository was missing upload directory

T:\pys60com\pys60community\.bzr\repository>mkdir upload

Revision history for this message
John A Meinel (jameinel) said :
#2

Do you know how that directory would have been deleted? Certainly it is a required directory, though we could try to make it more obvious what is failing.

Revision history for this message
Mikko Ohtamaa (mikko-red-innovation) said :
#3

I have no faintest idea :( I did only few commits before it failed.

I traced my way through Bazaar to grab WTF the error message meant. Failing code is below. One could add more helpful error around os.open.

 def _put_non_atomic_helper(self, relpath, writer,
                               mode=None,
                               create_parent_dir=False,
                               dir_mode=None):
        """Common functionality information for the put_*_non_atomic.

        This tracks all the create_parent_dir stuff.

        :param relpath: the path we are putting to.
        :param writer: A function that takes an os level file descriptor
            and writes whatever data it needs to write there.
        :param mode: The final file mode.
        :param create_parent_dir: Should we be creating the parent directory
            if it doesn't exist?
        """
        abspath = self._abspath(relpath)
        if mode is None:
            # os.open() will automatically use the umask
            local_mode = 0666
        else:
            local_mode = mode

        try:
            print "Abspath:" + str(abspath)
            fd = os.open(abspath, _put_non_atomic_flags, local_mode)

Revision history for this message
John A Meinel (jameinel) said :
#4

Well, we would also be logging a nice traceback into ~/.bzr.log which would have pointed you here pretty quickly.

I don't think we can do better at this level, since all we really know is that we were asked to open a file, but we couldn't. If you could paste the traceback in ~/.bzr.log it would help to understand the call flow.

I'm guessing it is happening when we try to open a NewPack to do the commit, with the line:

# open an output stream for the data added to the pack.
self.write_stream = self.upload_transport.open_write_stream(
    self.random_name, mode=self._file_mode)

Which starts with creating an empty file:
  self.put_bytes_non_atomic(relpath, "", mode=mode)

And then returns a file handle. (It goes through put_bytes_non_atomic just to get the permissions right on the file, I'm guessing it could be done a little bit better)

Probably in the NewPack code we could catch a NoSuchFile and raise some sort of exception about failing to create a new pack file. Determining why starts to get into a lot of probing, which is a bit ugly. It could be a permission problem, or a missing directory, etc.

It should be rare to have a missing upload directory because we create it at 'init' time, and never delete it ourselves. If it is going missing, that may indicate some other problem. (Someone deleting directories, etc) it is often an empty dir, if that might point you to why it might be getting removed.

Revision history for this message
Marco Di Bartolomeo (dukez) said :
#5

>Mikko Ohtamaa said on 2008-05-28:
>
>Ok, fixed it.
>
>.bzr\repository was missing upload directory
>
>T:\pys60com\pys60community\.bzr\repository>mkdir upload

You saved me! Thank you so much.
That folder was missing in my project also. I think it was Winzip's fault in my case: I got a rar archive with the original (bzr) project folder compressed; then I tried to uncompress it with Winzip and it pruned many (all?) of the empty folder which were in the archive. I was also missing the following empty folders:

.bzr\branch-lock
.bzr\branch\lock
.bzr\checkout\lock
.bzr\repository\lock

Re-creating them made the magic. It could be a matter of configuration, however Winrar did a better job with uncompressing. Be aware of Winzip!