rackerlabs / lambda-uploader

Helps package and upload Python lambda functions to AWS
Apache License 2.0
270 stars 56 forks source link

Access is Denied #139

Closed brianherman closed 7 years ago

brianherman commented 7 years ago

When building a package with visual studio code the package builds correctly but when it tries to remove the .lambda_uploader_temp directory it fails.


Traceback (most recent call last):
  File "c:\python27\lib\site-packages\lambda_uploader\shell.py", line 182, in main
    _execute(args)
  File "c:\python27\lib\site-packages\lambda_uploader\shell.py", line 80, in _execute
    pkg.clean_workspace()
  File "c:\python27\lib\site-packages\lambda_uploader\package.py", line 82, in clean_workspace
    shutil.rmtree(self._temp_workspace)
  File "c:\python27\lib\shutil.py", line 247, in rmtree
    rmtree(fullname, ignore_errors, onerror)
  File "c:\python27\lib\shutil.py", line 247, in rmtree
    rmtree(fullname, ignore_errors, onerror)
  File "c:\python27\lib\shutil.py", line 247, in rmtree
    rmtree(fullname, ignore_errors, onerror)
  File "c:\python27\lib\shutil.py", line 247, in rmtree
    rmtree(fullname, ignore_errors, onerror)
  File "c:\python27\lib\shutil.py", line 252, in rmtree
    onerror(os.remove, fullname, sys.exc_info())
  File "c:\python27\lib\shutil.py", line 250, in rmtree
    os.remove(fullname)
WindowsError: [Error 5] Access is denied: 'C:\\Users\\brian\\Desktop\\ebay\\.lambda_uploader_temp \\lambda_package\\.git\\objects\\0a\\764a4de3a890dbe2a3336c648f7f6d1892c132'
jarosser06 commented 7 years ago

This does not appear to be a bug in lambda-uploader, sounds like the file permissions on that particular git object are not allowing the lambda-uploader to delete it. Did you check the file permissions on that to see if your active user is able to delete that file?

I would suggest adding .git to the lambda config ignore so it doesn't get packaged as part of your lambda artifact. https://github.com/rackerlabs/lambda-uploader/blob/master/example/lambda.json#L10

brianherman commented 7 years ago

@jarosser06 yeah I'll add that thanks