question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot run `eb local run` using Python 3.7

See original GitHub issue

Description

Cannot run eb local run using Python 3.7 Amazon Linux 2 environment.

Steps to reproduce

eb init using python 3.7 eb run local

Observed result

2.11.4 running Ruby 2.3 (Puma)', 'PermittedFileTypes': ['zip']}, {'SolutionStackName': '64bit Amazon Linux 2018.03 v2.11.4 running Ruby 2.2 (Puma)', 'PermittedFileTypes': ['zip']}, {'SolutionStackName': '64bit Amazon Linux 2018.03 v2.11.4 running Ruby 2.1 (Puma)', 'PermittedFileTypes': ['zip']}, {'SolutionStackName': '64bit Amazon Linux 2018.03 v2.11.4 running Ruby 2.0 (Puma)', 'PermittedFileTypes': ['zip']}, {'SolutionStackName': '64bit Amazon Linux 2018.03 v3.3.4 running Tomcat 8.5 Java 8', 'PermittedFileTypes': ['war', 'zip']}, {'SolutionStackName': '64bit Amazon Linux 2018.03 v3.3.4 running Tomcat 8 Java 8', 'PermittedFileTypes': ['war', 'zip']}, {'SolutionStackName': '64bit Amazon Linux 2018.03 v3.3.4 running Tomcat 7 Java 7', 'PermittedFileTypes': ['war', 'zip']}, {'SolutionStackName': '64bit Amazon Linux 2018.03 v3.3.4 running Tomcat 7 Java 6', 'PermittedFileTypes': ['war', 'zip']}, {'SolutionStackName': '64bit Windows Server Core 2019 v2.5.2 running IIS 10.0', 'PermittedFileTypes': ['zip']}, {'SolutionStackName': '64bit Windows Server 2019 v2.5.2 running IIS 10.0', 'PermittedFileTypes': ['zip']}, {'SolutionStackName': '64bit Windows Server Core 2016 v2.5.2 running IIS 10.0', 'PermittedFileTypes': ['zip']}, {'SolutionStackName': '64bit Windows Server 2016 v2.5.2 running IIS 10.0', 'PermittedFileTypes': ['zip']}, {'SolutionStackName': '64bit Windows Server Core 2012 R2 v2.5.2 running IIS 8.5', 'PermittedFileTypes': ['zip']}, {'SolutionStackName': '64bit Windows Server 2012 R2 v2.5.2 running IIS 8.5', 'PermittedFileTypes': ['zip']}, {'SolutionStackName': '64bit Windows Server Core 2016 v1.2.0 running IIS 10.0', 'PermittedFileTypes': ['zip']}, {'SolutionStackName': '64bit Windows Server 2016 v1.2.0 running IIS 10.0', 'PermittedFileTypes': ['zip']}, {'SolutionStackName': '64bit Windows Server Core 2012 R2 v1.2.0 running IIS 8.5', 'PermittedFileTypes': ['zip']}, {'SolutionStackName': '64bit Windows Server 2012 R2 v1.2.0 running IIS 8.5', 'PermittedFileTypes': ['zip']}, {'SolutionStackName': '64bit Windows Server 2012 v1.2.0 running IIS 8', 'PermittedFileTypes': ['zip']}, {'SolutionStackName': '64bit Windows Server Core 2012 R2 running IIS 8.5', 'PermittedFileTypes': ['zip']}, {'SolutionStackName': '64bit Windows Server 2012 R2 running IIS 8.5', 'PermittedFileTypes': ['zip']}, {'SolutionStackName': '64bit Windows Server 2012 running IIS 8', 'PermittedFileTypes': ['zip']}, {'SolutionStackName': '64bit Amazon Linux 2018.03 v2.14.3 running Docker 18.09.9-ce', 'PermittedFileTypes': []}, {'SolutionStackName': '64bit Amazon Linux 2018.03 v2.20.0 running Multi-container Docker 18.09.9-ce (Generic)', 'PermittedFileTypes': ['zip', 'json']}, {'SolutionStackName': '64bit Debian jessie v2.14.3 running Go 1.4 (Preconfigured - Docker)', 'PermittedFileTypes': ['zip']}, {'SolutionStackName': '64bit Debian jessie v2.14.3 running Go 1.3 (Preconfigured - Docker)', 'PermittedFileTypes': ['zip']}, {'SolutionStackName': '64bit Debian jessie v2.14.3 running Python 3.4 (Preconfigured - Docker)', 'PermittedFileTypes': ['zip']}, {'SolutionStackName': '64bit Amazon Linux 2 v3.0.0 running Docker', 'PermittedFileTypes': []}, {'SolutionStackName': '64bit Amazon Linux 2 v3.0.0 running Python 3.7', 'PermittedFileTypes': ['zip']}, {'SolutionStackName': '64bit Amazon Linux 2 v3.0.0 running Corretto 11', 'PermittedFileTypes': ['jar', 'zip']}, {'SolutionStackName': '64bit Amazon Linux 2 v3.0.0 running Corretto 8', 'PermittedFileTypes': ['jar', 'zip']}, {'SolutionStackName': '64bit Amazon Linux 2 v0.1.0 running PHP 7.4 (BETA)', 'PermittedFileTypes': ['zip']}, {'SolutionStackName': '64bit Amazon Linux 2 v0.1.0 running PHP 7.3 (BETA)', 'PermittedFileTypes': ['zip']}, {'SolutionStackName': '64bit Amazon Linux 2 v0.1.0 running PHP 7.2 (BETA)', 'PermittedFileTypes': ['zip']}, {'SolutionStackName': '64bit Amazon Linux 2 v0.1.0 running Node.js 12 (BETA)', 'PermittedFileTypes': ['zip']}, {'SolutionStackName': '64bit Amazon Linux 2 v0.1.0 running Node.js 10 (BETA)', 'PermittedFileTypes': ['zip']}, {'SolutionStackName': '64bit Amazon Linux 2 v0.1.0 running Go 1 (BETA)', 'PermittedFileTypes': ['zip']}, {'SolutionStackName': '64bit Amazon Linux 2 v0.1.0 running Ruby 2.7 (BETA)', 'PermittedFileTypes': ['zip']}, {'SolutionStackName': '64bit Amazon Linux 2 v0.1.0 running Ruby 2.6 (BETA)', 'PermittedFileTypes': ['zip']}, {'SolutionStackName': '64bit Amazon Linux 2 v0.1.0 running Ruby 2.5 (BETA)', 'PermittedFileTypes': ['zip']}, {'SolutionStackName': '64bit Amazon Linux 2018.03 v2.10.4 running Java 8', 'PermittedFileTypes': ['jar', 'zip']}, {'SolutionStackName': '64bit Amazon Linux 2018.03 v2.10.4 running Java 7', 'PermittedFileTypes': ['jar', 'zip']}, {'SolutionStackName': '64bit Amazon Linux 2018.03 v2.15.1 running Go 1.14.1', 'PermittedFileTypes': ['zip']}, {'SolutionStackName': '64bit Amazon Linux 2018.03 v2.6.20 running Packer 1.0.3', 'PermittedFileTypes': []}, {'SolutionStackName': '64bit Amazon Linux 2018.03 v2.14.3 running GlassFish 5.0 Java 8 (Preconfigured - Docker)', 'PermittedFileTypes': ['zip']}], 'ResponseMetadata': {'RequestId': '810fca50-e016-4de3-8d6b-9497e3bea040', 'HTTPStatusCode': 200, 'date': 'Sat, 18 Apr 2020 18:53:07 GMT', 'RetryAttempts': 0}}
2020-04-18 13:53:08,419 (DEBUG) ebcli.lib.elasticbeanstalk : Solution Stack result size = 70
2020-04-18 13:53:08,433 (DEBUG) ebcli.lib.elasticbeanstalk : Inside list_platform_versions api wrapper
2020-04-18 13:53:08,434 (DEBUG) ebcli.lib.aws : Making api call: (elasticbeanstalk, list_platform_versions) to region: us-west-2 with args:{'Filters': [{'Type': 'PlatformOwner', 'Operator': '=', 'Values': ['self']}]}
2020-04-18 13:53:08,580 (DEBUG) ebcli.lib.aws : API call finished, status = 200
2020-04-18 13:53:08,580 (DEBUG) ebcli.lib.aws : Response: {'PlatformSummaryList': [], 'ResponseMetadata': {'RequestId': '67a8c525-c0f5-4d0b-b76f-97d046e02f43', 'HTTPStatusCode': 200, 'date': 'Sat, 18 Apr 2020 18:53:08 GMT', 'RetryAttempts': 0}}
2020-04-18 13:53:08,587 (INFO) eb : Traceback (most recent call last):
  File "/Users/jhaas/.local/share/virtualenvs/bazze-marketplace-RumDEcI_/lib/python3.7/site-packages/ebcli/containers/factory.py", line 115, in _get_solution_stack
    soln_stk = solution_stack_ops.find_solution_stack_from_string(solution_string)
  File "/Users/jhaas/.local/share/virtualenvs/bazze-marketplace-RumDEcI_/lib/python3.7/site-packages/ebcli/operations/solution_stack_ops.py", line 103, in find_solution_stack_from_string
    raise NotFoundError(alerts['platform.invalidstring'].format(solution_string))
ebcli.objects.exceptions.NotFoundError: Elastic Beanstalk can't find a platform version that matches "Python 3.7 running on 64bit Amazon Linux 2".

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/jhaas/.local/share/virtualenvs/bazze-marketplace-RumDEcI_/lib/python3.7/site-packages/ebcli/core/ebrun.py", line 62, in run_app
    app.run()
  File "/Users/jhaas/.local/share/virtualenvs/bazze-marketplace-RumDEcI_/lib/python3.7/site-packages/cement/core/foundation.py", line 797, in run
    return_val = self.controller._dispatch()
  File "/Users/jhaas/.local/share/virtualenvs/bazze-marketplace-RumDEcI_/lib/python3.7/site-packages/cement/core/controller.py", line 472, in _dispatch
    return func()
  File "/Users/jhaas/.local/share/virtualenvs/bazze-marketplace-RumDEcI_/lib/python3.7/site-packages/cement/core/controller.py", line 472, in _dispatch
    return func()
  File "/Users/jhaas/.local/share/virtualenvs/bazze-marketplace-RumDEcI_/lib/python3.7/site-packages/cement/core/controller.py", line 478, in _dispatch
    return func()
  File "/Users/jhaas/.local/share/virtualenvs/bazze-marketplace-RumDEcI_/lib/python3.7/site-packages/ebcli/core/abstractcontroller.py", line 92, in default
    self.do_command()
  File "/Users/jhaas/.local/share/virtualenvs/bazze-marketplace-RumDEcI_/lib/python3.7/site-packages/ebcli/controllers/local.py", line 64, in do_command
    self.app.pargs.allow_insecure_ssl)
  File "/Users/jhaas/.local/share/virtualenvs/bazze-marketplace-RumDEcI_/lib/python3.7/site-packages/ebcli/containers/factory.py", line 45, in make_container
    soln_stk = _get_solution_stack()
  File "/Users/jhaas/.local/share/virtualenvs/bazze-marketplace-RumDEcI_/lib/python3.7/site-packages/ebcli/containers/factory.py", line 121, in _get_solution_stack
    raise NotFoundError('Solution stack {} does not appear to be valid'.format(solution_string))
ebcli.objects.exceptions.NotFoundError: Solution stack Python 3.7 running on 64bit Amazon Linux 2 does not appear to be valid

Expected result

Should be able to run elastic beanstalk locally in docker.

Additional environment details (Ex: Windows, Mac, Amazon Linux etc)

  1. OS: MacOS

Add --debug flag to command you are running

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
jakubLangrcommented, Mar 19, 2022

Hi @halcarleton and @km2411

I just got this issue on 3.20.0 when running a freshly init’d and create’d app, when I run: eb local run --debug I get:

2022-03-19 19:08:43,660 (INFO) eb : Traceback (most recent call last):
  File "/home/jakub/.local/lib/python3.9/site-packages/ebcli/containers/commands.py", line 286, in _run_live
    return utils.exec_cmd_live_output(args)
  File "/home/jakub/.local/lib/python3.9/site-packages/ebcli/lib/utils.py", line 232, in exec_cmd
    raise CommandError(error_msg, output_str, returncode)
ebcli.objects.exceptions.CommandError: Exited with return code 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/jakub/.local/lib/python3.9/site-packages/ebcli/core/ebrun.py", line 62, in run_app
    app.run()
  File "/home/jakub/miniconda3/envs/e39/lib/python3.9/site-packages/cement/core/foundation.py", line 797, in run
    return_val = self.controller._dispatch()
  File "/home/jakub/miniconda3/envs/e39/lib/python3.9/site-packages/cement/core/controller.py", line 472, in _dispatch
    return func()
  File "/home/jakub/miniconda3/envs/e39/lib/python3.9/site-packages/cement/core/controller.py", line 472, in _dispatch
    return func()
  File "/home/jakub/miniconda3/envs/e39/lib/python3.9/site-packages/cement/core/controller.py", line 478, in _dispatch
    return func()
  File "/home/jakub/.local/lib/python3.9/site-packages/ebcli/core/abstractcontroller.py", line 92, in default
    self.do_command()
  File "/home/jakub/.local/lib/python3.9/site-packages/ebcli/controllers/local.py", line 66, in do_command
    cnt.start()
  File "/home/jakub/.local/lib/python3.9/site-packages/ebcli/containers/abstractcontainer.py", line 66, in start
    self._pull()
  File "/home/jakub/.local/lib/python3.9/site-packages/ebcli/containers/abstractcontainer.py", line 122, in _pull
    return commands.pull_img(self._get_full_docker_path())
  File "/home/jakub/.local/lib/python3.9/site-packages/ebcli/containers/commands.py", line 46, in pull_img
    _pull_img(img)
  File "/home/jakub/.local/lib/python3.9/site-packages/ebcli/containers/commands.py", line 215, in _pull_img
    return _run_live(args)
  File "/home/jakub/.local/lib/python3.9/site-packages/ebcli/containers/commands.py", line 288, in _run_live
    _handle_command_error(e)
  File "/home/jakub/.local/lib/python3.9/site-packages/ebcli/containers/commands.py", line 297, in _handle_command_error
    raise CommandError
ebcli.objects.exceptions.CommandError: None

2reactions
halcarletoncommented, Apr 28, 2020

This is likely because you did not fully reinitialize the application directory. I should have clarified that more. Just rerunning eb init is not enough, you will need to delete .elasticbeanstalk/config and then rerun eb init.

Alternatively, in this case, you could just run eb init --platform <platform-name>.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Install Python, pip, and the EB CLI on Windows
From the Start menu, open a Command Prompt window. · Verify that Python and pip are both installed correctly by using the following...
Read more >
Elastic Beanstalk error after migrating from python 3.7 to ...
I am using the EB platform: Python 3.7 AL2 version 3.3.11, and all is working fine. But, the troubleshooting comes when I try...
Read more >
Unable to install AWS Elastic Beanstalk CLI (Win10, Python ...
I am trying to install awsebcli on my machine and I am unable to run the command. eb --version.
Read more >
awsebcli - PyPI
Command Line Interface for AWS EB. ... Added support for eb local run with major versions 2 of Python package docker-py.
Read more >
[ AWS 11 ] Installing EB CLI for Elastic Beanstalk - YouTube
In this video, I will show you how to install and set up EB CLI, the command line interface to manage AWS Elastic...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found