Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.
This repository has been archived by the owner on May 10, 2024. It is now read-only.

boto.exception.BotoServerError: BotoServerError: 503 Service Unavailable #3892

Open
@krismarc

Description

Hi boto community,

if proxy is configured in boto config file the script is checking OS for proxy configuration anyway and in some cases like SLES the no_proxy variable values are 'comma + space' separated. This results in skip_proxy with false.

[Boto]
debug = 2
num_retries = 1
proxy = random.proxy.com
proxy_port = 8080

Added some prints to debug:

True
path /
auth_path /
path2 /
use_proxy
True
**skip_proxy
False**
path3 https://<path changed>/
method:(GET) protocol:(https) host(random.host.com) port(443) path(https://<path changed>/) params({}) headers({}) body()
reply: 'HTTP/1.1 200 Connection established\r\n'
send: 'GET https://<path changed>/ HTTP/1.1\r\nHost: **** \r\nAccept-Encoding: identity\r\nDate: Thu, 05 Dec 2019 13:15:05 GMT\r\nContent-Length: 0\r\nAuthorization: AWS 2*** \r\nUser-Agent: Boto/2.49.0 Python/2.7.13 Linux/4.12.14-95.24-default\r\n\r\n'
reply: 'HTTP/1.1 503 Service Unavailable\r\n'
header: Server: squid
header: Mime-Version: 1.0
header: Date: Thu, 05 Dec 2019 13:15:05 GMT
header: Content-Type: text/html;charset=utf-8
header: Content-Length: 18387
header: X-Squid-Error: ERR_DNS_FAIL 0
header: X-Cache: MISS from swre-prx001-ch-her-4
header: Via: 1.1 swre-prx001-ch-her-4 (squid)
header: Connection: close
send: 'GET https://<path changed>/ HTTP/1.1\r\nHost: **** \r\nAccept-Encoding: identity\r\nDate: Thu, 05 Dec 2019 13:15:05 GMT\r\nContent-Length: 0\r\nAuthorization: AWS 2*** \r\nUser-Agent: Boto/2.49.0 Python/2.7.13 Linux/4.12.14-95.24-default\r\n\r\n'
reply: ''
reply: 'HTTP/1.1 200 Connection established\r\n'
Traceback (most recent call last):
  File "s3.py", line 4, in <module>
    for bucket in conn.get_all_buckets():
  File "/usr/lib/python2.7/site-packages/boto/s3/connection.py", line 443, in get_all_buckets
    response = self.make_request('GET', headers=headers)
  File "/usr/lib/python2.7/site-packages/boto/s3/connection.py", line 675, in make_request
    retry_handler=retry_handler
  File "/usr/lib/python2.7/site-packages/boto/connection.py", line 1080, in make_request
    retry_handler=retry_handler)
  File "/usr/lib/python2.7/site-packages/boto/connection.py", line 1030, in _mexe
    raise BotoServerError(response.status, response.reason, body)
boto.exception.BotoServerError: BotoServerError: 503 Service Unavailable

This starts here: (fine only if no_proxy values are just comma separated)

for name in self.no_proxy.split(','):

working ("just comma separated"):

cat /etc/sysconfig/proxy | grep NO_PROXY
Example: NO_PROXY="www.me.de, do.main, localhost"
NO_PROXY="localhost,127.0.0.1,.expected.domain.com"

not working ("comma + space" separated):

cat /etc/sysconfig/proxy | grep NO_PROXY
Example: NO_PROXY="www.me.de, do.main, localhost"
NO_PROXY="localhost, 127.0.0.1, .expected.domain.com"

If I change the above code to (with extra space for split) then it starts to work in opposite way:
for name in self.no_proxy.split(', '):

Kind regards,
KrzMar

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions