Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

failed to push some refs #100

Open
petRUShka opened this issue Jul 3, 2021 · 9 comments
Open

failed to push some refs #100

petRUShka opened this issue Jul 3, 2021 · 9 comments

Comments

@petRUShka
Copy link

I'm trying to push existing repository to fresh Dropbox repository via git-remote-dropbox.
When I try to do it I catch an error:

Pushing to dropbox:///me/reps/repository.git
debug: writing: /me/reps/repository.git/objects/a1/6cdddb802b28e9b7f52b01222117a09f1d89a7
...
debug: writing: /me/reps/repository.git/objects/2b/30cfc121e27ab54eee75b2a7dbdb6244b402f5
Traceback (most recent call last):
  File "/home/user/.local/bin/git-remote-dropbox", line 8, in <module>
    sys.exit(main())
  File "/home/user/.local/lib/python3.9/site-packages/git_remote_dropbox/cli/helper.py", line 23, in main
    helper.run()
  File "/home/user/.local/lib/python3.9/site-packages/git_remote_dropbox/helper.py", line 108, in run
    self._do_push(line)
  File "/home/user/.local/lib/python3.9/site-packages/git_remote_dropbox/helper.py", line 152, in _do_push
    self._push(src, dst)
  File "/home/user/.local/lib/python3.9/site-packages/git_remote_dropbox/helper.py", line 215, in _push
    for done, _ in enumerate(res, 1):
  File "/usr/lib/python3.9/multiprocessing/pool.py", line 870, in next
    raise value
  File "/usr/lib/python3.9/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
  File "/home/user/.local/lib/python3.9/site-packages/git_remote_dropbox/util.py", line 103, in __call__
    return method(self._obj, *args)
  File "/home/user/.local/lib/python3.9/site-packages/git_remote_dropbox/helper.py", line 287, in _put_object
    self._connection().files_upload(data, path, mode, mute=True)
  File "/home/user/.local/lib/python3.9/site-packages/dropbox/base.py", line 2861, in files_upload
    r = self.request(
  File "/home/user/.local/lib/python3.9/site-packages/dropbox/dropbox_client.py", line 346, in request
    raise ApiError(res.request_id,
dropbox.exceptions.ApiError: ApiError('dddddddddddddddddddddddddddddddd', UploadError('path', UploadWriteFailed(reason=WriteError('conflict', WriteConflictError('file_ancestor', None)), upload_session_id='AAAAAAAAAAAAAAAAAAAAAA')))
error: failed to push some refs to 'dropbox:///me/reps/repository.git'

There isn't anything in the folder

─➤  ls ~/Dropbox/me/reps/repository.git                                                                                        130 ↵
ls: cannot access '/home/user/Dropbox/me/reps/repository.git': No such file or directory

I've configured remote as follows:

[remote "origin"]
	url = dropbox:///me/reps/repository.git
	fetch = +refs/heads/*:refs/remotes/origin/*

P.S.

─➤  pip list | grep dropbox
dropbox                       11.13.1
git-remote-dropbox            1.1.4
@anishathalye
Copy link
Owner

Hmm, I have not seen that kind of error before. The docs say that the file_ancestor error means that "There’s a file at an ancestor path, so we couldn’t create the required parent folders.". Is any of me, me/reps, or me/reps/repository.git a file?

Also, by the way, I recommend using selective sync and disabling sync for the directory where you are placing repos, e.g. /me/reps.

@petRUShka
Copy link
Author

Is any of me, me/reps, or me/reps/repository.git a file?

No, ~/Dropbox/me, ~/Dropbox/me/reps are folders and ~/Dropbox/me/repository.git is absent.

What can I do to help identify the problem?

Also, by the way, I recommend using selective sync and disabling sync for the directory where you are placing repos, e.g. /me/reps.

Thanks! Bit this recommendation isn't related to the issue?

@anishathalye
Copy link
Owner

Yeah, the recommendation is probably not related.

I'm not entirely sure what is causing this. Do you get the same error if you try pushing again? Does it seem to be deterministic (i.e. gives an error when pushing the same file), or does it fail at different points?

If you delete the directory in Dropbox (or alternatively, change the remote to point somewhere else, e.g. dropbox:///test) and push, does it still fail in the same way?

What platform are you on? (OS / Python version)

Do you have large files in this repo (say, > 20 MB)?

@petRUShka
Copy link
Author

petRUShka commented Jul 7, 2021

I've made several experiments. First conclusion: It depends on arbitrary factor.

Push to test have worked perfectly fine:

─➤  git push                                                                                         1 ↵
Writing objects: 100% (5026/5026), done.
To dropbox:///test
 * [new branch]      master -> master

Pushing to me/reps/repository have worked fine. And only pushing to me/reps/repository.git have yold and error:

Writing objects:  37% (1900/5026)
error: exception while writing objects (run with -v for details)

Then I've deleted repository folder from Dropbox and then push it again and everything works fine!

P.S. Repository consists of quite many files (excluding .git config):

ls -alR | wc -l
892

The biggest file has size of 261K and total size of dir is 4.8M.

@anishathalye
Copy link
Owner

Okay, so everything is working now? Hard to tell how it got into that state that caused the file_ancestor write conflict. Given that we haven't seen this reported with git-remote-dropbox before, it's possible that it was due to something else.

Yes, the repository consists of many files. git-remote-dropbox keeps all objects loose (supporting packfiles while having client-side concurrency control seemed tricky; it should be possible, but it's not currently implemented). So individual objects are zlib-compressed but there's no delta compression, so repositories take up a decent amount of space.

@petRUShka
Copy link
Author

It seems that ok, but definitely not stable :(

Thanks for your comments!

@anishathalye
Copy link
Owner

Do you still have a copy of the folder on Dropbox that was being problematic?

@petRUShka
Copy link
Author

I've tested git push several times in different (and sometimes same) location inside Dropbox folder.

It occasionally fails. It can be ok for location and next time not ok for the same location

@anishathalye
Copy link
Owner

git-remote-dropbox doesn't have great logging (and I'm not even sure what log output would be useful beyond the Dropbox API error). It would be helpful for debugging if I could repro this on my machine. I wonder if it has anything to do with the repository contents? Does the same issue happen if you push other repos? (E.g. clone a random github repo, like git-remote-dropbox, and then push it to Dropbox). Or is it just with your particular repo?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants