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.

ERROR: HTTPError - HTTP Error 403: Forbidden (> eb logs)

See original GitHub issue

Description

Getting ERROR: HTTPError - HTTP Error 403: Forbidden while using eb logs

Steps to reproduce

Type eb logs

Observed result

2020-08-23 15:19:38,482 (INFO) eb : Traceback (most recent call last): File “/home/ayz/.ebcli-virtual-env/lib/python3.7/site-packages/ebcli/core/ebrun.py”, line 62, in run_app app.run() File “/home/ayz/.ebcli-virtual-env/lib/python3.7/site-packages/cement/core/foundation.py”, line 797, in run return_val = self.controller._dispatch() File “/home/ayz/.ebcli-virtual-env/lib/python3.7/site-packages/cement/core/controller.py”, line 472, in _dispatch return func() File “/home/ayz/.ebcli-virtual-env/lib/python3.7/site-packages/cement/core/controller.py”, line 478, in _dispatch return func() File “/home/ayz/.ebcli-virtual-env/lib/python3.7/site-packages/ebcli/core/abstractcontroller.py”, line 92, in default self.do_command() File “/home/ayz/.ebcli-virtual-env/lib/python3.7/site-packages/ebcli/controllers/logs.py”, line 65, in do_command self.__get_logs() File “/home/ayz/.ebcli-virtual-env/lib/python3.7/site-packages/ebcli/controllers/logs.py”, line 103, in __get_logs instance_id=self.instance File “/home/ayz/.ebcli-virtual-env/lib/python3.7/site-packages/ebcli/operations/logsops.py”, line 486, in retrieve_beanstalk_logs get_logs(env_name, info_type, do_zip=do_zip, instance_id=instance_id) File “/home/ayz/.ebcli-virtual-env/lib/python3.7/site-packages/ebcli/operations/logsops.py”, line 345, in get_logs _handle_tail_logs(instance_id_list) File “/home/ayz/.ebcli-virtual-env/lib/python3.7/site-packages/ebcli/operations/logsops.py”, line 888, in _handle_tail_logs log_result = utils.get_data_from_url(url) File “/home/ayz/.ebcli-virtual-env/lib/python3.7/site-packages/ebcli/lib/utils.py”, line 263, in get_data_from_url return urllib.request.urlopen(url, timeout=timeout).read() File “/home/ayz/.pyenv/versions/3.7.2/lib/python3.7/urllib/request.py”, line 222, in urlopen return opener.open(url, data, timeout) File “/home/ayz/.pyenv/versions/3.7.2/lib/python3.7/urllib/request.py”, line 531, in open response = meth(req, response) File “/home/ayz/.pyenv/versions/3.7.2/lib/python3.7/urllib/request.py”, line 641, in http_response ‘http’, request, response, code, msg, hdrs) File “/home/ayz/.pyenv/versions/3.7.2/lib/python3.7/urllib/request.py”, line 569, in error return self._call_chain(*args) File “/home/ayz/.pyenv/versions/3.7.2/lib/python3.7/urllib/request.py”, line 503, in _call_chain result = func(*args) File “/home/ayz/.pyenv/versions/3.7.2/lib/python3.7/urllib/request.py”, line 649, in http_error_default raise HTTPError(req.full_url, code, msg, hdrs, fp) urllib.error.HTTPError: HTTP Error 403: Forbidden

2020-08-23 15:19:38,482 (INFO) eb : HTTPError - HTTP Error 403: Forbidden Retrieving logs…

Expected result

Logs are expected

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

DISTRIB_ID=ManjaroLinux DISTRIB_RELEASE=19.0.2 DISTRIB_CODENAME=Kyria DISTRIB_DESCRIPTION=“Manjaro Linux”

  1. OS: Manjaro
  2. EBCLI version: EB CLI 3.18.2 (Python 3.7.2)

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:9
  • Comments:13

github_iconTop GitHub Comments

1reaction
educolocommented, Nov 5, 2020

@Palakpatel67 I’m not sure if this is the same issue, but when I use specific instance id works well. So eb logs --instance i-xxxxxxxxx works but eb logs returns a 403 forbidden. With eb logs --verbose i had this output

Retrieving logs...
INFO: Traceback (most recent call last):
  File "/home/eduardo/.virtualenvs/pa/lib/python3.8/site-packages/ebcli/core/ebrun.py", line 62, in run_app
    app.run()
  File "/home/eduardo/.virtualenvs/pa/lib/python3.8/site-packages/cement/core/foundation.py", line 797, in run
    return_val = self.controller._dispatch()
  File "/home/eduardo/.virtualenvs/pa/lib/python3.8/site-packages/cement/core/controller.py", line 472, in _dispatch
    return func()
  File "/home/eduardo/.virtualenvs/pa/lib/python3.8/site-packages/cement/core/controller.py", line 478, in _dispatch
    return func()
  File "/home/eduardo/.virtualenvs/pa/lib/python3.8/site-packages/ebcli/core/abstractcontroller.py", line 92, in default
    self.do_command()
  File "/home/eduardo/.virtualenvs/pa/lib/python3.8/site-packages/ebcli/controllers/logs.py", line 65, in do_command
    self.__get_logs()
  File "/home/eduardo/.virtualenvs/pa/lib/python3.8/site-packages/ebcli/controllers/logs.py", line 99, in __get_logs
    logsops.retrieve_beanstalk_logs(
  File "/home/eduardo/.virtualenvs/pa/lib/python3.8/site-packages/ebcli/operations/logsops.py", line 486, in retrieve_beanstalk_logs
    get_logs(env_name, info_type, do_zip=do_zip, instance_id=instance_id)
  File "/home/eduardo/.virtualenvs/pa/lib/python3.8/site-packages/ebcli/operations/logsops.py", line 345, in get_logs
    _handle_tail_logs(instance_id_list)
  File "/home/eduardo/.virtualenvs/pa/lib/python3.8/site-packages/ebcli/operations/logsops.py", line 888, in _handle_tail_logs
    log_result = utils.get_data_from_url(url)
  File "/home/eduardo/.virtualenvs/pa/lib/python3.8/site-packages/ebcli/lib/utils.py", line 263, in get_data_from_url
    return urllib.request.urlopen(url, timeout=timeout).read()
  File "/usr/lib/python3.8/urllib/request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.8/urllib/request.py", line 531, in open
    response = meth(req, response)
  File "/usr/lib/python3.8/urllib/request.py", line 640, in http_response
    response = self.parent.error(
  File "/usr/lib/python3.8/urllib/request.py", line 569, in error
    return self._call_chain(*args)
  File "/usr/lib/python3.8/urllib/request.py", line 502, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.8/urllib/request.py", line 649, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden

INFO: HTTPError - HTTP Error 403: Forbidden

Hope this helps, thanks

0reactions
fitohoyoscommented, Feb 12, 2021

@Palakpatel67 I’m not sure if this is the same issue, but when I use specific instance id works well. So eb logs --instance i-xxxxxxxxx works but eb logs returns a 403 forbidden. With eb logs --verbose i had this output

Retrieving logs...
INFO: Traceback (most recent call last):
  File "/home/eduardo/.virtualenvs/pa/lib/python3.8/site-packages/ebcli/core/ebrun.py", line 62, in run_app
    app.run()
  File "/home/eduardo/.virtualenvs/pa/lib/python3.8/site-packages/cement/core/foundation.py", line 797, in run
    return_val = self.controller._dispatch()
  File "/home/eduardo/.virtualenvs/pa/lib/python3.8/site-packages/cement/core/controller.py", line 472, in _dispatch
    return func()
  File "/home/eduardo/.virtualenvs/pa/lib/python3.8/site-packages/cement/core/controller.py", line 478, in _dispatch
    return func()
  File "/home/eduardo/.virtualenvs/pa/lib/python3.8/site-packages/ebcli/core/abstractcontroller.py", line 92, in default
    self.do_command()
  File "/home/eduardo/.virtualenvs/pa/lib/python3.8/site-packages/ebcli/controllers/logs.py", line 65, in do_command
    self.__get_logs()
  File "/home/eduardo/.virtualenvs/pa/lib/python3.8/site-packages/ebcli/controllers/logs.py", line 99, in __get_logs
    logsops.retrieve_beanstalk_logs(
  File "/home/eduardo/.virtualenvs/pa/lib/python3.8/site-packages/ebcli/operations/logsops.py", line 486, in retrieve_beanstalk_logs
    get_logs(env_name, info_type, do_zip=do_zip, instance_id=instance_id)
  File "/home/eduardo/.virtualenvs/pa/lib/python3.8/site-packages/ebcli/operations/logsops.py", line 345, in get_logs
    _handle_tail_logs(instance_id_list)
  File "/home/eduardo/.virtualenvs/pa/lib/python3.8/site-packages/ebcli/operations/logsops.py", line 888, in _handle_tail_logs
    log_result = utils.get_data_from_url(url)
  File "/home/eduardo/.virtualenvs/pa/lib/python3.8/site-packages/ebcli/lib/utils.py", line 263, in get_data_from_url
    return urllib.request.urlopen(url, timeout=timeout).read()
  File "/usr/lib/python3.8/urllib/request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.8/urllib/request.py", line 531, in open
    response = meth(req, response)
  File "/usr/lib/python3.8/urllib/request.py", line 640, in http_response
    response = self.parent.error(
  File "/usr/lib/python3.8/urllib/request.py", line 569, in error
    return self._call_chain(*args)
  File "/usr/lib/python3.8/urllib/request.py", line 502, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.8/urllib/request.py", line 649, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden

INFO: HTTPError - HTTP Error 403: Forbidden

Hope this helps, thanks

This helps, thanks. Still I’d like to just type “eb logs”.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot HTTP 403 errors from API Gateway - Amazon AWS
An HTTP 403 response code means that a client is forbidden from accessing a valid URL. The server understands the request, but it...
Read more >
What Is the 403 Forbidden Error and How to Fix It (8 Methods ...
403 Forbidden – you don't have permission to access this resource is an HTTP status code that occurs when the web server understands...
Read more >
403 Forbidden Error: What It Is and How to Fix It - Airbrake Blog
The 403 Forbidden Error is an HTTP response status code that indicates an identified client does not have proper authorization to access the ......
Read more >
What Does a 403 Forbidden Error Mean? How Do You Fix It?
The 403 Forbidden error is an HTTP status code that means that access to the page or resource you were trying to reach...
Read more >
python urllib2.HTTPError: HTTP Error 403: Forbidden
A 403 error means that you do not have access to the information the site contains. From Wikipedia: A web server may return...
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