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

dvp build sometimes crashes in git repositories on Windows when there are unstaged changes #273

Open
mothslaw opened this issue Nov 25, 2020 · 0 comments

Comments

@mothslaw
Copy link
Contributor

** Expected Behavior**
dvp build should either work or at least print out a comprehensible error message.

** Actual Behavior**
dvp build crashes and prints out Internal error, please contact Delphix.

Steps To Reproduce the Problem
I was not able to reproduce this problem, but I did witness Jatinder reproduce it multiple times on his Windows machine. On his setup the steps are simple:

  1. Have your plugin code in a git repository
  2. Make some non-trivial change to a Python file and save it.
  3. Immediately run a dvp build.

Screenshots
If applicable, add screenshots to help explain your problem.

Version
Seen in dvp 2.1.0

Additional Context
When running in extra verbose mode dvp build -vvv, we get the following items of interest:

Importing plugin module : plugin_runner
A directory exists at 'C:\\Users\\oracle\\Desktop\\git_ora_win\\Oracle_On_Windows\\build\\src'. Attempting to delete.
Failed to delete 'C:\\Users\\oracle\\Desktop\\git_ora_win\\Oracle_On_Windows\\build\\src': .
Traceback (most recent call last):
  File "c:\py27venv\lib\site-packages\dlpx\virtualization\_internal\file_util.py", line 34, in delete_paths
    shutil.rmtree(path)
  File "C:\Python27\lib\shutil.py", line 270, in rmtree
    rmtree(fullname, ignore_errors, onerror)
  File "C:\Python27\lib\shutil.py", line 270, in rmtree
    rmtree(fullname, ignore_errors, onerror)
  File "C:\Python27\lib\shutil.py", line 275, in rmtree
    onerror(os.remove, fullname, sys.exc_info())
  File "C:\Python27\lib\shutil.py", line 273, in rmtree
    os.remove(fullname)
WindowsError: [Error 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\oracle\\Desktop\\git_ora_win\\Oracle_On_Windows\\build\\src\\google\\protobuf\\service.pyc'
Copying C:\Users\oracle\Desktop\git_ora_win\Oracle_On_Windows\src to C:\Users\oracle\Desktop\git_ora_win\Oracle_On_Windows\build\src
[Error 183] Cannot create a file when that file already exists: 'C:\\Users\\oracle\\Desktop\\git_ora_win\\Oracle_On_Windows\\build\\src'
Internal error, please contact Delphix.

So, it looks like dvp (or some process that dvp kicks off) wants to delete the build/src directory. However, something else has an open file handle to something inside that directory. This makes the delete fail. However, dvp does not error out at this point. Instead it presses on and tries to do a mkdir on build/src which already exists. This causes an exception which dvp is not expecting, and it crashes.

We do not yet know who holds that open file handle or why. We did notice that Jatinder's git was not setup to ignore the contents of the build directory.

It may well be that the correct behavior of dvp is to error out here. But, at the very least it should say something like "Build directory is in use by another process." or something like that, rather than just "Internal error".

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

No branches or pull requests

1 participant