0

I am getting this error when trying to deploy to elastic beanstalk using CLI.

The deploy was working before I added the code to a remote git repository

(theplay.team) vagrant@debian-7:/vagrant/Devel/theplay.team/theplayteam$ eb deploy --verbose
INFO: Deploying code to playground-env in region us-east-1
INFO: Getting version label from git with git-describe
/vagrant/.virtualenvs/theplay.team/local/lib/python2.7/site-packages/urllib3/util/ssl_.py:339: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  SNIMissingWarning
INFO: Traceback (most recent call last):
  File "/vagrant/.virtualenvs/theplay.team/local/lib/python2.7/site-packages/ebcli/core/ebrun.py", line 41, in run_app
    app.run()
  File "/vagrant/.virtualenvs/theplay.team/local/lib/python2.7/site-packages/cement/core/foundation.py", line 797, in run
    return_val = self.controller._dispatch()
  File "/vagrant/.virtualenvs/theplay.team/local/lib/python2.7/site-packages/cement/core/controller.py", line 472, in _dispatch
    return func()
  File "/vagrant/.virtualenvs/theplay.team/local/lib/python2.7/site-packages/cement/core/controller.py", line 478, in _dispatch
    return func()
  File "/vagrant/.virtualenvs/theplay.team/local/lib/python2.7/site-packages/ebcli/core/abstractcontroller.py", line 85, in default
    self.do_command()
  File "/vagrant/.virtualenvs/theplay.team/local/lib/python2.7/site-packages/ebcli/controllers/deploy.py", line 83, in do_command
    staged=self.staged, timeout=self.timeout, source=self.source)
  File "/vagrant/.virtualenvs/theplay.team/local/lib/python2.7/site-packages/ebcli/operations/deployops.py", line 50, in deploy
    app_name, process=process_app_versions, label=label, message=message, staged=staged, build_config=build_config)
  File "/vagrant/.virtualenvs/theplay.team/local/lib/python2.7/site-packages/ebcli/operations/commonops.py", line 507, in create_app_version
    s3_bucket, s3_key = get_app_version_s3_location(app_name, version_label)
  File "/vagrant/.virtualenvs/theplay.team/local/lib/python2.7/site-packages/ebcli/operations/commonops.py", line 347, in get_app_version_s3_location
    app_version = elasticbeanstalk.application_version_exists(app_name, version_label)
  File "/vagrant/.virtualenvs/theplay.team/local/lib/python2.7/site-packages/ebcli/lib/elasticbeanstalk.py", line 408, in application_version_exists
    app_versions = get_application_versions(app_name, version_labels=[version_label])['ApplicationVersions']
  File "/vagrant/.virtualenvs/theplay.team/local/lib/python2.7/site-packages/ebcli/lib/elasticbeanstalk.py", line 403, in get_application_versions
    **kwargs)
  File "/vagrant/.virtualenvs/theplay.team/local/lib/python2.7/site-packages/ebcli/lib/elasticbeanstalk.py", line 40, in _make_api_call
    **operation_options)
  File "/vagrant/.virtualenvs/theplay.team/local/lib/python2.7/site-packages/ebcli/lib/aws.py", line 221, in make_api_call
    _handle_response_code(e.response, attempt, aggregated_error_message)
  File "/vagrant/.virtualenvs/theplay.team/local/lib/python2.7/site-packages/ebcli/lib/aws.py", line 285, in _handle_response_code
    raise NotAuthorizedError('Operation Denied. ' + message)
NotAuthorizedError: Operation Denied. The security token included in the request is invalid.
nael
  • 1,441
  • 19
  • 36
  • The issue looks to be that security credentials were not found by the EBCLI. Can you verify `~/.aws/credentials` is populated. If not, running `aws configure` should fix it. – progfan Dec 10 '18 at 00:31
  • Make sure the ports on the EC2 or load balancer are open (80 and 443 if you run HTTPS). Your VPC shuld also have the IP or the EB security group included. Also, if you have an RDS linked to your EB, you may need to add the server IP to the Incoming Traffic list. (MySQL/Aurora port 3306) – WayBehind Dec 10 '18 at 03:15
  • @progfan I've done what you said and still not fixed. – nael Dec 10 '18 at 21:44
  • Did you also try setting the env. variables, `AWS_ACCESS_KEY_ID` and `AWS_SECRET_KEY`? – progfan Dec 10 '18 at 22:46

0 Answers0