Bug #6658
closedarv-copy dumps a stack track when `git` has an error
Description
When git encounters a Permission denied error, I get the following output from arv-copy:
- arv-copy --verbose --src qr1hi --dst 7lnae --project-uuid 7lnae-j7d0g-9r429yt0rcrdl8x --dst-git-repo jr17/qr1hi qr1hi-p5p6p-8584ylktoumirn0
2015-07-17 12:49:55 arvados.arv-copy3839 DEBUG: src_git_url: git@git.qr1hi.arvadosapi.com:arvados.git
2015-07-17 12:49:55 arvados.arv-copy3839 DEBUG: dst_git_push_url: None
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
Traceback (most recent call last):
File "/usr/local/bin/arv-copy", line 4, in <module>
main()
File "/usr/local/lib/python2.7/dist-packages/arvados/commands/arv_copy.py", line 128, in main
src_arv, dst_arv, args)
File "/usr/local/lib/python2.7/dist-packages/arvados/commands/arv_copy.py", line 272, in copy_pipeline_template
copy_git_repos(pt, src, dst, args.dst_git_repo, args)
File "/usr/local/lib/python2.7/dist-packages/arvados/commands/arv_copy.py", line 371, in copy_git_repos
migrate_jobspec(component, src, dst, dst_repo, args)
File "/usr/local/lib/python2.7/dist-packages/arvados/commands/arv_copy.py", line 344, in migrate_jobspec
copy_git_repo(repo, src, dst, dst_repo, script_version, args)
File "/usr/local/lib/python2.7/dist-packages/arvados/commands/arv_copy.py", line 617, in copy_git_repo
cwd=os.path.dirname(local_repo_dir[src_git_repo]))
File "/usr/local/lib/python2.7/dist-packages/arvados/util.py", line 48, in run_command
raise errors.CommandFailedError(
NameError: global name 'errors' is not defined
The stack trace appears to be because the `import errors` line is missing from `/usr/local/lib/python2.7/dist-packages/arvados/util.py`
Updated by Brett Smith almost 9 years ago
- Category set to SDKs
I just pushed a fix for the name error in arvados.util. However, this just means that you'll now see a stack trace for the CommandFailedError that arvados.util.run_command is trying to run. It will be more informative, giving you the full git command that failed and its exit status, but you'll still get a back trace. Can you explain a little more what behavior you'd ideally like to see?
Updated by Joshua Randall almost 9 years ago
I guess I would expect something more succinct like:
"Command exited with error %d: `%s`\n%s\n" % (command_exit_code, command_line, command_output)
I'm not sure what the exit code and command line are in this example, but it might be something like:
Command exited with error 1: `git fetch a9e3d22d`
Permission denied (publickey).
fatal: The remote end hung up unexpectedly