0

I am switching to a new computer with a fresh install of Windows 10 Pro and am having a very strange issue with the EB CLI. I am not able to run 'eb deploy' using Windows Power Shell, I get the following error:

ERROR: OSError - [WinError 145] The directory is not empty: '.elasticbeanstalk\\app_versions'

I and uninstalled/reinstalled Python along with the EB CLI but with the same result.

Note: I am able to run all other EB commands like eb ssh or eb logs with no issues.

An observation I was able to make while watching the '.elasticbeanstalk' folder, I see the 'app_versions' folder being created along with the application zip in that folder. Once the command fails the ZIP file remains in the 'app_versions' folder for about 10 to 15 seconds before it is removed. I checked S3 and the zip file is uploaded...

I have reviewed this other Stack Overflow issue: AWS Elastic Beanstalk deploy not working

I do not have Google/Dropbox or OneDrive running on the directory I am working in. Just to be safe I paused OneDrive but still nothing.

Please, any help would be amazing!

UPDATE:

Ran eb deploy --debug

There is no error until AFTER the upload is completed, confirmed this by checking the S3 bucket and seeing the latest upload.

2019-02-04 14:50:06,522 (INFO) eb : Traceback (most recent call last):
  File "C:\Users\winng\AppData\Roaming\Python\Python37\site-packages\ebcli\core\ebrun.py", line 62, in run_app
    app.run()
  File "C:\Users\winng\AppData\Roaming\Python\Python37\site-packages\cement\core\foundation.py", line 797, in run
    return_val = self.controller._dispatch()
  File "C:\Users\winng\AppData\Roaming\Python\Python37\site-packages\cement\core\controller.py", line 472, in _dispatch
    return func()
  File "C:\Users\winng\AppData\Roaming\Python\Python37\site-packages\cement\core\controller.py", line 478, in _dispatch
    return func()
  File "C:\Users\winng\AppData\Roaming\Python\Python37\site-packages\ebcli\core\abstractcontroller.py", line 94, in default
    self.do_command()
  File "C:\Users\winng\AppData\Roaming\Python\Python37\site-packages\ebcli\controllers\deploy.py", line 78, in do_command
    staged=self.staged, timeout=self.timeout, source=self.source)
  File "C:\Users\winng\AppData\Roaming\Python\Python37\site-packages\ebcli\operations\deployops.py", line 59, in deploy
    build_config=build_config
  File "C:\Users\winng\AppData\Roaming\Python\Python37\site-packages\ebcli\operations\commonops.py", line 538, in create_app_version
    fileoperations.delete_app_versions()
  File "C:\Users\winng\AppData\Roaming\Python\Python37\site-packages\ebcli\core\fileoperations.py", line 432, in delete_app_versions
    delete_directory(app_version_folder)
  File "C:\Users\winng\AppData\Roaming\Python\Python37\site-packages\ebcli\core\fileoperations.py", line 425, in delete_directory
    shutil.rmtree(location)
  File "c:\users\winng\appdata\local\programs\python\python37\lib\shutil.py", line 513, in rmtree
    return _rmtree_unsafe(path, onerror)
  File "c:\users\winng\appdata\local\programs\python\python37\lib\shutil.py", line 401, in _rmtree_unsafe
    onerror(os.rmdir, path, sys.exc_info())
  File "c:\users\winng\appdata\local\programs\python\python37\lib\shutil.py", line 399, in _rmtree_unsafe
    os.rmdir(path)
OSError: [WinError 145] The directory is not empty: '.elasticbeanstalk\\app_versions'

2019-02-04 14:50:06,526 (INFO) eb : OSError - [WinError 145] The directory is not empty: '.elasticbeanstalk\\app_versions'
gregwinn
  • 941
  • 1
  • 9
  • 16
  • I'm curious to know whether `eb deploy --debug` shows additional, valuable information. – progfan Feb 04 '19 at 19:10
  • Thank you @progfan I have updated my question with the error trace. – gregwinn Feb 04 '19 at 20:58
  • 1
    Thanks, there must be one or more read-only files within `.elasticbeanstalk/app_versions`, so the EBCLI is failing to delete them. You should also report this problem on AWS Forums if you can. Until a fix is out, if you can manually edit, "C:\Users\winng\AppData\Roaming\Python\Python37\site-packages\ebcli\core\fileoperations.py" so that the statement is `shutil.rmtree(location ignore_errors=True)`, it should work for you. – progfan Feb 04 '19 at 22:00
  • @progfan I will try the temp fix you have suggested and see how that works... Yes, I great idea - will report this on the AWS Forums, just wanted to avoid duplication... Thank you for your help I will update this once I have tried your fix! – gregwinn Feb 05 '19 at 21:52
  • 1
    Thanks. There is a "," missing between `location` and `ignore_errors` in my above comment. – progfan Feb 06 '19 at 03:16
  • @progfan I edited like 425 of the fileoperations.py file and changed it to read: `shutil.rmtree(location, ignore_errors=True)` and now deployment works! – gregwinn Feb 08 '19 at 23:49
  • Awesome, BTW, awsebcli 3.14.11, which was released today, has the fix, too. – progfan Feb 08 '19 at 23:52

0 Answers0