aws / aws-elastic-beanstalk-cli

The EB CLI is a command line interface for Elastic Beanstalk that provides interactive commands that simplify creating, updating and monitoring environments from a local repository.
Apache License 2.0
162 stars 79 forks source link

ERROR: TypeError - expected str, bytes or os.PathLike object, not NoneType #43

Closed himanshusaini-fa closed 3 years ago

himanshusaini-fa commented 4 years ago

System Info

OS: Windows 10 Shell: cmd

Description

ERROR: TypeError - expected str, bytes or os.PathLike object, not NoneType I get this error while following this guide from aws , when I use "eb deploy".

If I'm supposed to raise it somewhere else please Point to it.

Here are my verbose logs

eb deploy --verbose
INFO: Deploying code to node-express-env in region us-east-1
INFO: Getting version label from git with git-describe
INFO: Pushing local code to codecommit with git-push
INFO: Traceback (most recent call last):
  File "c:\users\himanshu\.ebcli-virtual-env\lib\site-packages\ebcli\core\ebrun.py", line 62, in run_app
    app.run()
  File "c:\users\himanshu\.ebcli-virtual-env\lib\site-packages\cement\core\foundation.py", line 797, in run
    return_val = self.controller._dispatch()
  File "c:\users\himanshu\.ebcli-virtual-env\lib\site-packages\cement\core\controller.py", line 472, in _dispatch
    return func()
  File "c:\users\himanshu\.ebcli-virtual-env\lib\site-packages\cement\core\controller.py", line 478, in _dispatch
    return func()
  File "c:\users\himanshu\.ebcli-virtual-env\lib\site-packages\ebcli\core\abstractcontroller.py", line 92, in default
    self.do_command()
  File "c:\users\himanshu\.ebcli-virtual-env\lib\site-packages\ebcli\controllers\deploy.py", line 79, in do_command
    deployops.deploy(self.app_name, self.env_name, self.version, self.label,
  File "c:\users\himanshu\.ebcli-virtual-env\lib\site-packages\ebcli\operations\deployops.py", line 48, in deploy
    app_version_label = commonops.create_codecommit_app_version(
  File "c:\users\himanshu\.ebcli-virtual-env\lib\site-packages\ebcli\operations\commonops.py", line 583, in create_codecommit_app_version
    source_control.push_codecommit_code()
  File "c:\users\himanshu\.ebcli-virtual-env\lib\site-packages\ebcli\objects\sourcecontrol.py", line 324, in push_codecommit_code
    stdout, stderr, exitcode = self._run_cmd(
  File "c:\users\himanshu\.ebcli-virtual-env\lib\site-packages\ebcli\objects\sourcecontrol.py", line 519, in _run_cmd
    stdout, stderr, exitcode = exec_cmd(cmd)
  File "c:\users\himanshu\.ebcli-virtual-env\lib\site-packages\cement\utils\shell.py", line 40, in exec_cmd
    proc = Popen(cmd_args, *args, **kw)
  File "c:\python38\lib\subprocess.py", line 854, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "c:\python38\lib\subprocess.py", line 1247, in _execute_child
    args = list2cmdline(args)
  File "c:\python38\lib\subprocess.py", line 549, in list2cmdline
    for arg in map(os.fsdecode, seq):
  File "c:\python38\lib\os.py", line 818, in fsdecode
    filename = fspath(filename)  # Does type-checking of `filename`.
TypeError: expected str, bytes or os.PathLike object, not NoneType

INFO: TypeError - expected str, bytes or os.PathLike object, not NoneType
waissbluth commented 4 years ago

Hello @imanshusaini-fa, did you figure out this issue? I am facing the same problem.

himanshusaini-fa commented 4 years ago

Nope. Stopped trying after a few days.

waissbluth commented 4 years ago

I got it to work by downgrading to awsebcli==3.18.1 (one version ago)

tgreco commented 3 years ago

Having the same issue.

varfolomejev commented 3 years ago

the same problem. I'm using deploy guide

manishie commented 3 years ago

Any update here? Same problem, and I wasn't able to install any previous versions of the cli successfully.

Palakpatel67 commented 3 years ago

@himanshusaini-fa thanks for reporting this issue. Could you tell which Python version are you using?

himanshusaini-fa commented 3 years ago

@himanshusaini-fa thanks for reporting this issue. Could you tell which Python version are you using?

Hi @Palakpatel67. it's in the verbose. Python 3.8.

Palakpatel67 commented 3 years ago

@himanshusaini-fa I was finally able to reproduce the issue. Issue here is CLI look for current repository name based on the current branch name ( git config --get branch.master.remote) while deploying application via codecommit and if remote branch is not set in .git/config file, it returns "none" which results in TypeError . this values are set in .git/config while initializing an application with codecommit.

In case if branch details are not set, you can add your remote branch configurations in .git/config,

[branch "master"]
    remote = codecommit-origin
    merge = refs/heads/master

Note: in this example codecommit branch name is master

let us know if you have any questions. thanks!

Palakpatel67 commented 3 years ago

Closing this issue as there has been no update for an extended period of time.

dadooda commented 3 years ago

The only thing which worked for me was downgrading to 3.18.1 (current version installed using the CLI setup scripts):

$ cd ~/.ebcli-virtual-env
$ bin/pip install awsebcli==3.18.1
$ eb --version
EB CLI 3.18.1 (Python 3.7.2)
nvquangth commented 3 years ago

@Palakpatel67 thank you so much, it worked for me.

equivalent commented 3 years ago

same issue when eb init with code commit. The way I've fixed it is I've deleted the .elasticbanstalk folder and done eb init again without the code commit :roll_eyes:

liquiddandruff commented 3 years ago

Amazingly this bug is still not fixed. The stack trace I get after --verbose is the same in the OP.

$ eb --version
EB CLI 3.19.4 (Python 3.8.2)
waissbluth commented 3 years ago

Can someone reopen this? It is still going on

refacrot commented 3 years ago

Faced the same issue with

$ eb --version
EB CLI 3.20.2 (Python 3.9.7)

@dadooda's solution works like a charm.

galiperkin commented 3 years ago

@himanshusaini-fa I was finally able to reproduce the issue. Issue here is CLI look for current repository name based on the current branch name ( git config --get branch.master.remote) while deploying application via codecommit and if remote branch is not set in .git/config file, it returns "none" which results in TypeError . this values are set in .git/config while initializing an application with codecommit.

In case if branch details are not set, you can add your remote branch configurations in .git/config,

[branch "master"]
  remote = codecommit-origin
  merge = refs/heads/master

Note: in this example codecommit branch name is master

let us know if you have any questions. thanks!

Based on this comment, I added these lines to config and switched to the master branch. After that, eb create worked well. Thank you edit : converted sentence to one line

Jahnvi203 commented 1 year ago

Im still getting the same issue even after adding to .git/config. Can someone help with this?

Lezgig commented 2 months ago

Im still getting the same issue even after adding to .git/config. Can someone help with this?

same, Palakpatel67's suggestion worked just fine for me but I still find this solution a bit hacky