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

[Migrated] zappa package production fails when using --no_venv #850

Open
jneves opened this issue Feb 20, 2021 · 3 comments
Open

[Migrated] zappa package production fails when using --no_venv #850

jneves opened this issue Feb 20, 2021 · 3 comments
Labels
needs-review Needs attention from a maintainer

Comments

@jneves
Copy link
Contributor

jneves commented Feb 20, 2021

Originally from: Miserlou/Zappa#2097 by woodrad

Context

Running zappa package production --no_venv throws TypeError: expected str, bytes or os.PathLike object, not NoneType. This error happens only when running outside of a virtual environment. zappa package production works as expected.

While I believe running zappa outside of a virtual environment using --no_venv is supported (per #835), I understand why this would be a low-priority issue.

Expected Behavior

zappa builds an application package.

Actual Behavior

zappa throws the following error:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/zappa/cli.py", line 2778, in handle
    sys.exit(cli.handle())
  File "/usr/local/lib/python3.8/site-packages/zappa/cli.py", line 512, in handle
    self.dispatch_command(self.command, stage)
  File "/usr/local/lib/python3.8/site-packages/zappa/cli.py", line 551, in dispatch_command
    self.package(self.vargs['output'])
  File "/usr/local/lib/python3.8/site-packages/zappa/cli.py", line 642, in package
    self.create_package(output)
  File "/usr/local/lib/python3.8/site-packages/zappa/cli.py", line 2257, in create_package
    self.zip_path = self.zappa.create_lambda_zip(
  File "/usr/local/lib/python3.8/site-packages/zappa/core.py", line 533, in create_lambda_zip
    split_venv = splitpath(venv)
  File "/usr/local/lib/python3.8/site-packages/zappa/core.py", line 527, in splitpath
    (path, tail) = os.path.split(path)
  File "/usr/local/lib/python3.8/posixpath.py", line 103, in split
    p = os.fspath(p)
TypeError: expected str, bytes or os.PathLike object, not NoneType

Possible Fix

If running zappa package outside of a virtual environment is not supported, then the resolution to this issue would be removing support for zappa package --no_venv or reverting #1891.

Another option is adding a conditional check to splitpath() to see whether we are running in a virtual environment before running splitpath(venv).

What appetite do the project maintainers have for supporting zappa use outside of virtual environments?

Your Environment

  • Zappa version used: 0.51.0
  • Operating System and Python version: Python 3.8 on Alpine Linux 3.11 (3.8-alpine3.11 Docker image)
  • The output of pip freeze:
argcomplete==1.11.1
boto3==1.13.6
botocore==1.16.6
certifi==2020.4.5.1
cfn-flip==1.2.3
chardet==3.0.4
click==7.1.2
docutils==0.15.2
durationpy==0.5
future==0.18.2
hjson==3.0.1
idna==2.9
jmespath==0.9.5
kappa==0.6.0
pip-tools==5.1.2
placebo==0.9.0
python-dateutil==2.6.1
python-slugify==4.0.0
PyYAML==5.3.1
requests==2.23.0
s3transfer==0.3.3
six==1.14.0
text-unidecode==1.3
toml==0.10.0
tqdm==4.46.0
troposphere==2.6.1
urllib3==1.25.9
Werkzeug==0.16.1
wsgi-request-logger==0.4.6
zappa==0.51.0
  • Your zappa_settings.json: the error can be reproduced no matter what's in zappa_settings.json
@j6k4m8
Copy link

j6k4m8 commented Dec 7, 2021

This seems to be true of all commands: zappa update dev --no_venv also fails with the same error on my (brand-new ubuntu VM) build.

Copy link

github-actions bot commented Apr 3, 2024

Hi there! Unfortunately, this Issue has not seen any activity for at least 90 days. If the Issue is still relevant to the latest version of Zappa, please comment within the next 10 days if you wish to keep it open. Otherwise, it will be automatically closed.

@github-actions github-actions bot added the no-activity [Bot] Closing soon if no new activity label Apr 3, 2024
@j6k4m8
Copy link

j6k4m8 commented Apr 3, 2024

I can confirm that this is still an issue.

@github-actions github-actions bot added needs-review Needs attention from a maintainer and removed no-activity [Bot] Closing soon if no new activity labels Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-review Needs attention from a maintainer
Projects
None yet
Development

No branches or pull requests

2 participants