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

deleting any File binary attached to a child Entity results uncommitted/unstaged changes #140

Closed
pkikawa opened this issue Apr 12, 2019 · 26 comments
Assignees
Milestone

Comments

@pkikawa
Copy link
Collaborator

pkikawa commented Apr 12, 2019

deleting a binary from any role results in a failure message in the gitstatus update:

admin binary delete traceback.txt

running git fetch;git status:

admin binary delete git fetch status.txt

binary is deleted but it leaves unstaged changes, and uncommitted changes

@pkikawa pkikawa added the bug label Apr 12, 2019
@pkikawa pkikawa changed the title deleting admin binary results in gitstatus failure message deleting ~~admin~~ any binary results in gitstatus failure message Apr 12, 2019
@gjost
Copy link
Member

gjost commented Apr 18, 2019

I can't replicate this in my current dev environment. I strongly suspect this is dealt with in the 141-entity-children branch. Please try ddrlocal-develop_2.8.3a.

@pkikawa
Copy link
Collaborator Author

pkikawa commented May 1, 2019

2.8.3b DEV

Still getting failure messages on binary deletion.

Could not delete file <a href="/ui/file/ddr-testing-40219-1-2-mezzanine-684e15e967/">ddr-testing-40219-1-2-mezzanine-684e15e967.tif</a> from <a href="/ui/entity/ddr-testing-40219-1-2/">ddr-testing-40219-1-2</a>.

(ddrlocal) ddr@DDREditor:/media/qnfs/kinkura/gold/ddr-testing-40219$ git fetch;git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

        deleted:    files/ddr-testing-40219-1/files/ddr-testing-40219-1-2/files/ddr-testing-40219-1-2-mezzanine-684e15e967-a.jpg
        deleted:    files/ddr-testing-40219-1/files/ddr-testing-40219-1-2/files/ddr-testing-40219-1-2-mezzanine-684e15e967.json
        deleted:    files/ddr-testing-40219-1/files/ddr-testing-40219-1-2/files/ddr-testing-40219-1-2-mezzanine-684e15e967.tif

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        modified:   files/ddr-testing-40219-1/files/ddr-testing-40219-1-2/changelog
        modified:   files/ddr-testing-40219-1/files/ddr-testing-40219-1-2/control
        modified:   files/ddr-testing-40219-1/files/ddr-testing-40219-1-2/entity.json

@pkikawa
Copy link
Collaborator Author

pkikawa commented May 1, 2019

forgot to mention that the binary is deleted, just with the failure message and unstaged commits

@GeoffFroh GeoffFroh changed the title deleting ~~admin~~ any binary results in gitstatus failure message deleting any File binary results in gitstatus failure message May 2, 2019
@gjost
Copy link
Member

gjost commented May 3, 2019

Should be fixed as of ddr-local commit 5fd7a55.

@gjost gjost closed this as completed May 3, 2019
@pkikawa
Copy link
Collaborator Author

pkikawa commented May 13, 2019

behavior still present, though only when deleting child segment binaries.

@pkikawa pkikawa reopened this May 13, 2019
@pkikawa
Copy link
Collaborator Author

pkikawa commented May 13, 2019

tested on 284MA

@pkikawa
Copy link
Collaborator Author

pkikawa commented May 13, 2019

Traceback (most recent call last):

  File "/opt/ddr-local/venv/ddrlocal/lib/python2.7/site-packages/celery/app/trace.py", line 240, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/opt/ddr-local/venv/ddrlocal/lib/python2.7/site-packages/celery/app/trace.py", line 438, in __protected_call__
    return self.run(*args, **kwargs)
  File "/opt/ddr-local/ddrlocal/webui/tasks/files.py", line 289, in delete_file
    git_name, git_mail, agent
  File "/opt/ddr-local/venv/ddrlocal/lib/python2.7/site-packages/ddr_cmdln-0.9.4b0-py2.7.egg/DDR/models/files.py", line 305, in delete
    commit=commit
  File "/opt/ddr-local/venv/ddrlocal/lib/python2.7/site-packages/ddr_cmdln-0.9.4b0-py2.7.egg/DDR/commands.py", line 51, in wrapper
    return f(*args, **kwargs)
  File "/opt/ddr-local/venv/ddrlocal/lib/python2.7/site-packages/ddr_cmdln-0.9.4b0-py2.7.egg/DDR/commands.py", line 41, in wrapper
    return f(*args, **kwargs)
  File "/opt/ddr-local/venv/ddrlocal/lib/python2.7/site-packages/ddr_cmdln-0.9.4b0-py2.7.egg/DDR/commands.py", line 634, in file_destroy
    dvcs.stage(repo, git_files)
  File "/opt/ddr-local/venv/ddrlocal/lib/python2.7/site-packages/ddr_cmdln-0.9.4b0-py2.7.egg/DDR/dvcs.py", line 464, in stage
    repo.git.add([git_files])
  File "/opt/ddr-local/venv/ddrlocal/lib/python2.7/site-packages/git/cmd.py", line 440, in <lambda>
    return lambda *args, **kwargs: self._call_process(name, *args, **kwargs)
  File "/opt/ddr-local/venv/ddrlocal/lib/python2.7/site-packages/git/cmd.py", line 834, in _call_process
    return self.execute(make_call(), **_kwargs)
  File "/opt/ddr-local/venv/ddrlocal/lib/python2.7/site-packages/git/cmd.py", line 627, in execute
    raise GitCommandError(command, status, stderr_value)
GitCommandError: 'git add files/ddr-testing-40225-1-1/entity.json files/ddr-testing-40225-1-1/control files/ddr-testing-40225-1/files/ddr-testing-40225-1-1/changelog' returned with exit code 128
stderr: 'fatal: pathspec 'files/ddr-testing-40225-1-1/entity.json' did not match any files'

(The git status of the repo looked similar to the output in #140 (comment))

@gjost
Copy link
Member

gjost commented May 15, 2019

@pkikawa Reading through this again, just curious, why are you doing git fetch before git status? fetch hits the remote repository to see if there are any updates.

@gjost
Copy link
Member

gjost commented May 15, 2019

@pkikawa Regarding your Traceback (most recent call last): comment, it would really help me if you could provide a description of what you're doing that provoked the traceback. If you're doing something at the commandline then the actual command you tried to execute is absolutely necessary.

@pkikawa
Copy link
Collaborator Author

pkikawa commented May 15, 2019

@pkikawa Reading through this again, just curious, why are you doing git fetch before git status? fetch hits the remote repository to see if there are any updates.

ahhh, force of habit i guess.

@pkikawa
Copy link
Collaborator Author

pkikawa commented May 15, 2019

@pkikawa Regarding your Traceback (most recent call last): comment, it would really help me if you could provide a description of what you're doing that provoked the traceback. If you're doing something at the commandline then the actual command you tried to execute is absolutely necessary.

ah sorry, thought i had included that at the top.
(ddrlocal) ddr@DDREditor:/media/qnfs/kinkura/gold/ddr-testing-40226$ ddrimport entity -U philip.kikawa -P REDACTED /media/sf_ddrshared/test\ csv/ddr-testing-40226-objects.csv /media/qnfs/kinkura/gold/ddr-testing-40226 | tee -a /media/sf_ddrshared/test\ csv/ddr-testing-40226ObjImp.log

this is the copy-paste of the command i used to get this error

@gjost
Copy link
Member

gjost commented May 15, 2019

thx, the more context the better

@gjost
Copy link
Member

gjost commented May 15, 2019

New problem though: This issue is supposed to be about problems with deleting binaries, but the command and traceback from the last couple comments are issues when running ddrimport entity which is a totally different operation. We need to keep these issues on-topic, otherwise it's incredibly confusing.

@pkikawa
Copy link
Collaborator Author

pkikawa commented May 15, 2019

New problem though: This issue is supposed to be about problems with deleting binaries, but the command and traceback from the last couple comments are issues when running ddrimport entity which is a totally different operation. We need to keep these issues on-topic, otherwise it's incredibly confusing.

homersimpson.DOH gah yeah my fault, i was thinking of the wrong issue. all that i did to generate this error was clicking on the delete button and checking the yes i am sure i want to delete this file checkbox. the collection was in a clean state beforehand (no tracked changes, no unstaged commits)

@gjost
Copy link
Member

gjost commented May 15, 2019

OK thx will check it out.

@pkikawa
Copy link
Collaborator Author

pkikawa commented May 15, 2019

sorry about that xP

@pkikawa
Copy link
Collaborator Author

pkikawa commented May 15, 2019

version 2.8.4 MAster

@gjost
Copy link
Member

gjost commented May 15, 2019

Unable to duplicate the error when deleting a binary. Used ddrlocal-master_2.8.4.

@pkikawa
Copy link
Collaborator Author

pkikawa commented May 15, 2019

you're unable to replicate this from deleting segment binaries?

@gjost
Copy link
Member

gjost commented May 16, 2019 via email

@pkikawa
Copy link
Collaborator Author

pkikawa commented May 16, 2019

do you want the VM that i've been working with?

@GeoffFroh GeoffFroh changed the title deleting any File binary results in gitstatus failure message deleting any File binary results uncommitted/unstaged changes May 17, 2019
@GeoffFroh GeoffFroh changed the title deleting any File binary results uncommitted/unstaged changes deleting any File binary attached to a child Entity results uncommitted/unstaged changes May 17, 2019
@gjost
Copy link
Member

gjost commented May 17, 2019

NOTE: this happens when deleting segment child binaries.

@gjost gjost added this to the 2.8.5 milestone May 21, 2019
@gjost
Copy link
Member

gjost commented May 22, 2019

Duplicated in the shell:

>>> fid = 'ddr-testing-40204-1-1-mezzanine-3c4f516e3a'
>>> from DDR import config, identifier
>>> o = identifier.Identifier(fid, config.MEDIA_BASE).object()
>>> o.delete('gjost', 'gjost@densho.org', 'cli', commit=0)
Traceback (most recent call last):
  File "<input>", line 1, in <module>
    o.delete('gjost', 'gjost@densho.org', 'cli', commit=0)
...
GitCommandError: 'git add files/ddr-testing-40204-1-1/entity.json files/ddr-testing-40204-1-1/control files/ddr-testing-40204-1/files/ddr-testing-40204-1-1/changelog' returned with exit code 128
stderr: 'fatal: pathspec 'files/ddr-testing-40204-1-1/entity.json' did not match any files'

@gjost
Copy link
Member

gjost commented May 22, 2019

Fixed in ddr-cmdln commit 696e93d for package ddrlocal-develop_2.8.4b.

@pkikawa
Copy link
Collaborator Author

pkikawa commented May 24, 2019

resolved in 284b dev

@pkikawa pkikawa closed this as completed May 24, 2019
@pkikawa
Copy link
Collaborator Author

pkikawa commented May 30, 2019

working in 286MA

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

No branches or pull requests

3 participants