Skip to content

Exception when deleting a reference #299

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

Closed
sc68cal opened this issue Jun 10, 2015 · 7 comments
Closed

Exception when deleting a reference #299

sc68cal opened this issue Jun 10, 2015 · 7 comments

Comments

@sc68cal
Copy link

sc68cal commented Jun 10, 2015

This is from stackforge/gertty

2015-06-10 09:50:33,725 Exception running task <PruneChangeTask 2964>
Traceback (most recent call last):
  File "/Users/scollins/src/stackforge/gertty/gertty/sync.py", line 1306, in _run
    task.run(self)
  File "/Users/scollins/src/stackforge/gertty/gertty/sync.py", line 1225, in run
    repo.deleteRef(change_ref)
  File "/Users/scollins/src/stackforge/gertty/gertty/gitrepo.py", line 272, in deleteRef
    git.Reference.delete(repo, ref)
  File "/Library/Python/2.7/site-packages/git/refs/symbolic.py", line 410, in delete
    os.remove(abs_path)
OSError: [Errno 1] Operation not permitted: '/Users/scollins/src/openstack/neutron/.git/refs/changes/83/171983'

Here's what the git repo looks like in that hive

scollins@Sean-Collins-MBPr15 ~ » find /Users/scollins/src/openstack/neutron/.git/refs/changes/83/                                                                                                       1 ↵
/Users/scollins/src/openstack/neutron/.git/refs/changes/83/
/Users/scollins/src/openstack/neutron/.git/refs/changes/83//171983
/Users/scollins/src/openstack/neutron/.git/refs/changes/83//175383
/Users/scollins/src/openstack/neutron/.git/refs/changes/83//175383/4
/Users/scollins/src/openstack/neutron/.git/refs/changes/83//175383/5
/Users/scollins/src/openstack/neutron/.git/refs/changes/83//184383
/Users/scollins/src/openstack/neutron/.git/refs/changes/83//184383/2
/Users/scollins/src/openstack/neutron/.git/refs/changes/83//188883
/Users/scollins/src/openstack/neutron/.git/refs/changes/83//188883/1
/Users/scollins/src/openstack/neutron/.git/refs/changes/83//188883/2
/Users/scollins/src/openstack/neutron/.git/refs/changes/83//188983
/Users/scollins/src/openstack/neutron/.git/refs/changes/83//188983/1
@Byron Byron added this to the v1.0.2 - Fixes milestone Jun 10, 2015
@Byron
Copy link
Member

Byron commented Jun 10, 2015

To me it seems this is not a problem of GitPython directly, as the user running GitPython doesn't seem to have permissions to remove a file from the filesystem.

You should be able to reproduce this kind of error by running git br -D changes/83/171983 as the user that showed the given exception.

Please let me know what you could find out..

@Byron
Copy link
Member

Byron commented Jun 10, 2015

You can watch the development stream on youtube.

GitPython #9 [issue 299 - errors when deleting a branch]

thumb

@sc68cal
Copy link
Author

sc68cal commented Jun 16, 2015

Traceback (most recent call last):
  File "/Users/scollins/src/stackforge/gertty/gertty/sync.py", line 1306, in _run
    task.run(self)
  File "/Users/scollins/src/stackforge/gertty/gertty/sync.py", line 1225, in run
    repo.deleteRef(change_ref)
  File "/Users/scollins/src/stackforge/gertty/gertty/gitrepo.py", line 272, in deleteRef
    git.Reference.delete(repo, ref)
  File "/Library/Python/2.7/site-packages/git/refs/symbolic.py", line 410, in delete
    os.remove(abs_path)
OSError: [Errno 1] Operation not permitted: '/Users/scollins/src/stackforge/fuel-astute/.git/refs/changes/30/174830'
scollins@SeanColnsMBPr15 ~/src/stackforge/fuel-astute ±master » git branch -D changes/30/174830  1 ↵
error: branch 'changes/30/174830' not found.

@Byron
Copy link
Member

Byron commented Jun 18, 2015

Posting a stack-trace of the attempted deletion of a non-existent branch without any additional statement on how git-python would be involved puzzles me. After all, the question was if the user running the git-python script is actually allowed to delete a branch in terms of the required filesystem permissions.

From what I see, this isn't an issue of git-python, which is why it seems alright to close it.

@Byron Byron closed this as completed Jun 18, 2015
@sc68cal
Copy link
Author

sc68cal commented Jun 18, 2015

Posting a stack-trace of the attempted deletion of a non-existent branch without any additional statement on how git-python would be involved puzzles me

This is coming a stack trace from Gertty, as stated in the first post, which uses git-python!

After all, the question was if the user running the git-python script is actually allowed to delete a branch in terms of the required filesystem permissions.

Yes - the same user running Gertty is the same user that owns that directory and all files under it.

Please, I would appreciate reopening this issue so we can continue to diagnose.

@Byron
Copy link
Member

Byron commented Jun 19, 2015

Unfortunately I don't believe this is an issue of git-python, as it looks like gertty wants to delete a non-existing branch but has no permission to do so. My guess is that gertty is running as a user who has no permission to alter the repository, for some reason.
I have repeated myself many times already, which usually shows there is a dead-end here.

@sc68cal
Copy link
Author

sc68cal commented Jun 30, 2015

My guess is that gertty is running as a user who has no permission to alter the repository, for some reason.

I believe this is incorrect - gertty is running as my user account and is manipulating a git tree that I own.

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

No branches or pull requests

2 participants