Search code examples
amazon-web-servicesdockeramazon-s3docker-composelocalstack

cannot reach to my localstack S3 from my test container


Below is my docker compose yaml file.

localstack:
  image: xxx.ecr.us-east-1.amazonaws.com/hub/localstack/localstack:latest
  container_name: localstack
  ports:
    - "4566:4566"
  environment:
    - SERVICES=s3
    - DEBUG=1
    - DATA_DIR=
    - AWS_REGION=us-east-1
    - AWS_DEFAULT_REGION=us-east-1
    - AWS_ACCESS_KEY_ID=fake
    - AWS_SECRET_ACCESS_KEY=fake
    - HOSTNAME=localstack
    - HOSTNAME_EXTERNAL=localstack
  volumes:
    - "${LOCALSTACK_VOLUME_DIR:-./volume}:/var/lib/localstack"
    - "/var/run/docker.sock:/var/run/docker.sock"

test:
  image: xxx.ecr.us-east-1.amazonaws.com/build-images/build-image:0.12.0
  container_name: test
  environment:
    - AWS_REGION=us-east-1
    - AWS_ACCESS_KEY_ID=myAccessKeyId
    - AWS_SECRET_ACCESS_KEY=mySecretAccessKey
    - JAVA_OPTS=-Dwebdriver.chrome.whitelistedIps=
    - ARTIFACTORY_SVC_ACCT_PWD=${ARTIFACTORY_SVC_ACCT_PWD}
    - ARTIFACTORY_SVC_ACCT=${ARTIFACTORY_SVC_ACCT}
  ports:
    - "46050:46050"
  volumes:
    - .:/tmp
  depends_on:
    - db
  entrypoint:
    - tail
    - -f
    - /dev/null

When I run the docker-compose up -d, both two containers seem boot successfully. However, when I tried to list the S3 buckets on my localstack container from the test aws --endpoint-url=http://localhost:4566 s3 ls, I got the error below:

Could not connect to the endpoint URL: "http://localhost:4566/"

Below is the logs printed in localstack container:

LocalStack supervisor: starting
LocalStack supervisor: localstack process (PID 15) starting
LocalStack version: 3.0.3.dev
LocalStack Docker container id: f476389c1d5a
LocalStack build date: 2023-12-07
LocalStack build git hash: 40266a13
2023-12-12T05:18:54.655 DEBUG --- [  MainThread] stevedore._cache           : reading /root/.cache/python-entrypoints/6ebcf49943e60a3f3e28a4612bb5d19d74cc786b2d2635e6690c6e41d3239d47
2023-12-12T05:18:54.662 DEBUG --- [  MainThread] stevedore._cache           : writing to /root/.cache/python-entrypoints/6ebcf49943e60a3f3e28a4612bb5d19d74cc786b2d2635e6690c6e41d3239d47
2023-12-12T05:18:54.664 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='_patch_botocore_json_parser', value='localstack.aws.client:_patch_botocore_json_parser', group='localstack.hooks.on_infra_start')
2023-12-12T05:18:54.665 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='_publish_config_as_analytics_event', value='localstack.runtime.analytics:_publish_config_as_analytics_event', group='localstack.hooks.on_infra_start')
2023-12-12T05:18:54.665 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='_publish_container_info', value='localstack.runtime.analytics:_publish_container_info', group='localstack.hooks.on_infra_start')
2023-12-12T05:18:54.665 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='_run_init_scripts_on_start', value='localstack.runtime.init:_run_init_scripts_on_start', group='localstack.hooks.on_infra_start')
2023-12-12T05:18:54.667 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='deprecation_warnings', value='localstack.plugins:deprecation_warnings', group='localstack.hooks.on_infra_start')
2023-12-12T05:18:54.667 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='register_partition_adjusting_proxy_listener', value='localstack.plugins:register_partition_adjusting_proxy_listener', group='localstack.hooks.on_infra_start')
2023-12-12T05:18:54.667 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='setup_dns_configuration_on_host', value='localstack.dns.plugins:setup_dns_configuration_on_host', group='localstack.hooks.on_infra_start')
2023-12-12T05:18:54.668 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='start_dns_server', value='localstack.dns.plugins:start_dns_server', group='localstack.hooks.on_infra_start')
2023-12-12T05:18:54.668 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='validate_configuration', value='localstack.services.lambda_.plugins:validate_configuration', group='localstack.hooks.on_infra_start')
2023-12-12T05:18:54.670 DEBUG --- [  MainThread] plugin.manager             : instantiating plugin PluginSpec(localstack.hooks.on_infra_start._patch_botocore_json_parser = <function _patch_botocore_json_parser at 0x7ffffc139f80>)
2023-12-12T05:18:54.671 DEBUG --- [  MainThread] plugin.manager             : loading plugin localstack.hooks.on_infra_start:_patch_botocore_json_parser
2023-12-12T05:18:54.671 DEBUG --- [  MainThread] plugin.manager             : instantiating plugin PluginSpec(localstack.hooks.on_infra_start._publish_config_as_analytics_event = <function _publish_config_as_analytics_event at 0x7ffffc13a340>)
2023-12-12T05:18:54.671 DEBUG --- [  MainThread] plugin.manager             : loading plugin localstack.hooks.on_infra_start:_publish_config_as_analytics_event
2023-12-12T05:18:54.671 DEBUG --- [  MainThread] plugin.manager             : instantiating plugin PluginSpec(localstack.hooks.on_infra_start._publish_container_info = <function _publish_container_info at 0x7ffffc13a660>)
2023-12-12T05:18:54.671 DEBUG --- [  MainThread] plugin.manager             : loading plugin localstack.hooks.on_infra_start:_publish_container_info
2023-12-12T05:18:54.671 DEBUG --- [  MainThread] plugin.manager             : instantiating plugin PluginSpec(localstack.hooks.on_infra_start._run_init_scripts_on_start = <function _run_init_scripts_on_start at 0x7ffffc13b600>)
2023-12-12T05:18:54.671 DEBUG --- [  MainThread] plugin.manager             : loading plugin localstack.hooks.on_infra_start:_run_init_scripts_on_start
2023-12-12T05:18:54.671 DEBUG --- [  MainThread] plugin.manager             : instantiating plugin PluginSpec(localstack.hooks.on_infra_start.deprecation_warnings = <function deprecation_warnings at 0x7ffffc13bd80>)
2023-12-12T05:18:54.671 DEBUG --- [  MainThread] plugin.manager             : loading plugin localstack.hooks.on_infra_start:deprecation_warnings
2023-12-12T05:18:54.671 DEBUG --- [  MainThread] plugin.manager             : instantiating plugin PluginSpec(localstack.hooks.on_infra_start.register_partition_adjusting_proxy_listener = <function register_partition_adjusting_proxy_listener at 0x7ffffc13bc40>)
2023-12-12T05:18:54.671 DEBUG --- [  MainThread] plugin.manager             : plugin localstack.hooks.on_infra_start:register_partition_adjusting_proxy_listener is disabled
2023-12-12T05:18:54.671 DEBUG --- [  MainThread] plugin.manager             : instantiating plugin PluginSpec(localstack.hooks.on_infra_start.setup_dns_configuration_on_host = <function setup_dns_configuration_on_host at 0x7ffffc17c0e0>)
2023-12-12T05:18:54.671 DEBUG --- [  MainThread] plugin.manager             : loading plugin localstack.hooks.on_infra_start:setup_dns_configuration_on_host
2023-12-12T05:18:54.671 DEBUG --- [  MainThread] plugin.manager             : instantiating plugin PluginSpec(localstack.hooks.on_infra_start.start_dns_server = <function start_dns_server at 0x7ffffc13bf60>)
2023-12-12T05:18:54.671 DEBUG --- [  MainThread] plugin.manager             : loading plugin localstack.hooks.on_infra_start:start_dns_server
2023-12-12T05:18:54.671 DEBUG --- [  MainThread] plugin.manager             : instantiating plugin PluginSpec(localstack.hooks.on_infra_start.validate_configuration = <function validate_configuration at 0x7ffffc17f880>)
2023-12-12T05:18:54.671 DEBUG --- [  MainThread] plugin.manager             : loading plugin localstack.hooks.on_infra_start:validate_configuration
2023-12-12T05:18:54.958 DEBUG --- [  MainThread] localstack.dns.server      : Determined fallback dns: 127.0.0.11
2023-12-12T05:18:54.958 DEBUG --- [  MainThread] localstack.dns.server      : Starting DNS servers (tcp/udp port 53 on 0.0.0.0)...
2023-12-12T05:18:54.958 DEBUG --- [  MainThread] localstack.dns.server      : Adding host .*localhost.localstack.cloud pointing to LocalStack
2023-12-12T05:18:54.958 DEBUG --- [  MainThread] localstack.dns.server      : Adding host .*localhost.localstack.cloud with record DynamicRecord(record_type=<RecordType.A: 1>, record_id=None)
2023-12-12T05:18:54.958 DEBUG --- [  MainThread] localstack.dns.server      : Adding host .*localhost.localstack.cloud with record DynamicRecord(record_type=<RecordType.AAAA: 2>, record_id=None)
2023-12-12T05:18:54.962 DEBUG --- [-functhread1] localstack.dns.server      : DNS Server started
2023-12-12T05:18:55.994 DEBUG --- [  MainThread] localstack.dns.server      : DNS server startup finished.
2023-12-12T05:18:55.996 DEBUG --- [  MainThread] localstack.runtime.init    : Init scripts discovered: {BOOT: [], START: [], READY: [], SHUTDOWN: []}
2023-12-12T05:18:55.996 DEBUG --- [  MainThread] localstack.plugins         : Checking for the usage of deprecated community features and configs...
2023-12-12T05:18:55.998  WARN --- [  MainThread] localstack.deprecations    : DATA_DIR is deprecated (since 1.0.0) and will be removed in upcoming releases of LocalStack! Please use PERSISTENCE instead. The state will be stored in your LocalStack volume in the state/ directory.
2023-12-12T05:18:55.998  WARN --- [  MainThread] localstack.deprecations    : HOSTNAME_EXTERNAL is deprecated (since 2.0.0) and will be removed in upcoming releases of LocalStack! This configuration will be migrated to LOCALSTACK_HOST
2023-12-12T05:18:55.998 DEBUG --- [  MainThread] localstack.dns.server      : Overwriting container DNS server to point to localhost
2023-12-12T05:18:56.021 DEBUG --- [  MainThread] localstack.utils.threads   : start_thread called without providing a custom name
2023-12-12T05:18:56.022 DEBUG --- [-functhread3] localstack.utils.run       : Executing command: whoami
2023-12-12T05:18:56.183  WARN --- [-functhread3] l.services.internal        : Enabling diagnose endpoint, please be aware that this can expose sensitive information via your network.
2023-12-12T05:18:56.187 DEBUG --- [-functhread3] localstack.utils.ssl       : Attempting to download local SSL certificate file
2023-12-12T05:18:57.280  INFO --- [-functhread3] localstack.utils.http      : Unable to download Github artifact from from https://cdn.jsdelivr.net/gh/localstack/localstack-artifacts@master/local-certs/server.key to /var/lib/localstack/cache/server.test.pem: MyHTTPSConnectionPool(host='cdn.jsdelivr.net', port=443): Max retries exceeded with url: /gh/localstack/localstack-artifacts@master/local-certs/server.key (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1006)'))) Traceback (most recent call last):
  File "/opt/code/localstack/.venv/lib/python3.11/site-packages/urllib3/connectionpool.py", line 468, in _make_request
    self._validate_conn(conn)
  File "/opt/code/localstack/.venv/lib/python3.11/site-packages/urllib3/connectionpool.py", line 1097, in _validate_conn
    conn.connect()
  File "/opt/code/localstack/.venv/lib/python3.11/site-packages/urllib3/connection.py", line 642, in connect
    sock_and_verified = _ssl_wrap_socket_and_match_hostname(
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/code/localstack/.venv/lib/python3.11/site-packages/urllib3/connection.py", line 783, in _ssl_wrap_socket_and_match_hostname
    ssl_sock = ssl_wrap_socket(
               ^^^^^^^^^^^^^^^^
  File "/opt/code/localstack/.venv/lib/python3.11/site-packages/urllib3/util/ssl_.py", line 471, in ssl_wrap_socket
    ssl_sock = _ssl_wrap_socket_impl(sock, context, tls_in_tls, server_hostname)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/code/localstack/.venv/lib/python3.11/site-packages/urllib3/util/ssl_.py", line 515, in _ssl_wrap_socket_impl
    return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/ssl.py", line 517, in wrap_socket
    return self.sslsocket_class._create(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/ssl.py", line 1108, in _create
    self.do_handshake()
  File "/usr/local/lib/python3.11/ssl.py", line 1379, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1006)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/opt/code/localstack/.venv/lib/python3.11/site-packages/urllib3/connectionpool.py", line 791, in urlopen
    response = self._make_request(
               ^^^^^^^^^^^^^^^^^^^
  File "/opt/code/localstack/.venv/lib/python3.11/site-packages/urllib3/connectionpool.py", line 492, in _make_request
    raise new_e
urllib3.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1006)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "/opt/code/localstack/.venv/lib/python3.11/site-packages/requests/adapters.py", line 486, in send
    resp = conn.urlopen(
           ^^^^^^^^^^^^^
  File "/opt/code/localstack/.venv/lib/python3.11/site-packages/urllib3/connectionpool.py", line 845, in urlopen
    retries = retries.increment(
              ^^^^^^^^^^^^^^^^^^
  File "/opt/code/localstack/.venv/lib/python3.11/site-packages/urllib3/util/retry.py", line 515, in increment
    raise MaxRetryError(_pool, url, reason) from reason  # type: ignore[arg-type]
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
urllib3.exceptions.MaxRetryError: MyHTTPSConnectionPool(host='cdn.jsdelivr.net', port=443): Max retries exceeded with url: /gh/localstack/localstack-artifacts@master/local-certs/server.key (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1006)')))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/opt/code/localstack/localstack/utils/http.py", line 264, in do_download
    download(download_url, target_file, timeout=timeout, request_headers=request_headers)
  File "/opt/code/localstack/localstack/utils/http.py", line 198, in download
    r = s.get(url, stream=True, verify=_verify, timeout=timeout, headers=request_headers)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/code/localstack/.venv/lib/python3.11/site-packages/requests/sessions.py", line 602, in get
    return self.request("GET", url, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/code/localstack/.venv/lib/python3.11/site-packages/requests/sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/code/localstack/.venv/lib/python3.11/site-packages/requests/sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/code/localstack/.venv/lib/python3.11/site-packages/requests/adapters.py", line 517, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: MyHTTPSConnectionPool(host='cdn.jsdelivr.net', port=443): Max retries exceeded with url: /gh/localstack/localstack-artifacts@master/local-certs/server.key (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1006)')))
2023-12-12T05:18:57.301  INFO --- [-functhread4] hypercorn.error            : Running on https://0.0.0.0:4566 (CTRL + C to quit)
2023-12-12T05:18:57.301  INFO --- [-functhread4] hypercorn.error            : Running on https://0.0.0.0:4566 (CTRL + C to quit)
2023-12-12T05:18:57.545  INFO --- [  MainThread] localstack.utils.bootstrap : Execution of "start_runtime_components" took 1523.14ms
2023-12-12T05:18:57.545 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='acm:default', value='localstack.services.providers:acm', group='localstack.aws.provider')
2023-12-12T05:18:57.549 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='apigateway:default', value='localstack.services.providers:apigateway', group='localstack.aws.provider')
2023-12-12T05:18:57.549 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='cloudformation:default', value='localstack.services.providers:cloudformation', group='localstack.aws.provider')
2023-12-12T05:18:57.549 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='cloudwatch:default', value='localstack.services.providers:cloudwatch', group='localstack.aws.provider')
2023-12-12T05:18:57.549 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='config:default', value='localstack.services.providers:awsconfig', group='localstack.aws.provider')
2023-12-12T05:18:57.549 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='dynamodb:default', value='localstack.services.providers:dynamodb', group='localstack.aws.provider')
2023-12-12T05:18:57.549 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='dynamodbstreams:default', value='localstack.services.providers:dynamodbstreams', group='localstack.aws.provider')
2023-12-12T05:18:57.550 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='ec2:default', value='localstack.services.providers:ec2', group='localstack.aws.provider')
2023-12-12T05:18:57.550 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='es:default', value='localstack.services.providers:es', group='localstack.aws.provider')
2023-12-12T05:18:57.550 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='events:default', value='localstack.services.providers:events', group='localstack.aws.provider')
2023-12-12T05:18:57.550 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='firehose:default', value='localstack.services.providers:firehose', group='localstack.aws.provider')
2023-12-12T05:18:57.550 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='iam:default', value='localstack.services.providers:iam', group='localstack.aws.provider')
2023-12-12T05:18:57.550 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='kinesis:default', value='localstack.services.providers:kinesis', group='localstack.aws.provider')
2023-12-12T05:18:57.550 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='kms:default', value='localstack.services.providers:kms', group='localstack.aws.provider')
2023-12-12T05:18:57.550 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='lambda:asf', value='localstack.services.providers:lambda_asf', group='localstack.aws.provider')
2023-12-12T05:18:57.550 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='lambda:default', value='localstack.services.providers:lambda_', group='localstack.aws.provider')
2023-12-12T05:18:57.550 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='lambda:v2', value='localstack.services.providers:lambda_v2', group='localstack.aws.provider')
2023-12-12T05:18:57.550 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='logs:default', value='localstack.services.providers:logs', group='localstack.aws.provider')
2023-12-12T05:18:57.550 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='opensearch:default', value='localstack.services.providers:opensearch', group='localstack.aws.provider')
2023-12-12T05:18:57.550 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='redshift:default', value='localstack.services.providers:redshift', group='localstack.aws.provider')
2023-12-12T05:18:57.550 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='resource-groups:default', value='localstack.services.providers:resource_groups', group='localstack.aws.provider')
2023-12-12T05:18:57.550 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='resourcegroupstaggingapi:default', value='localstack.services.providers:resourcegroupstaggingapi', group='localstack.aws.provider')
2023-12-12T05:18:57.550 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='route53:default', value='localstack.services.providers:route53', group='localstack.aws.provider')
2023-12-12T05:18:57.550 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='route53resolver:default', value='localstack.services.providers:route53resolver', group='localstack.aws.provider')
2023-12-12T05:18:57.550 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='s3:asf', value='localstack.services.providers:s3_asf', group='localstack.aws.provider')
2023-12-12T05:18:57.550 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='s3:default', value='localstack.services.providers:s3', group='localstack.aws.provider')
2023-12-12T05:18:57.550 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='s3:legacy_v2', value='localstack.services.providers:s3_legacy_v2', group='localstack.aws.provider')
2023-12-12T05:18:57.550 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='s3:stream', value='localstack.services.providers:s3_stream', group='localstack.aws.provider')
2023-12-12T05:18:57.550 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='s3:v2', value='localstack.services.providers:s3_v2', group='localstack.aws.provider')
2023-12-12T05:18:57.550 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='s3:v3', value='localstack.services.providers:s3_v3', group='localstack.aws.provider')
2023-12-12T05:18:57.550 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='s3control:default', value='localstack.services.providers:s3control', group='localstack.aws.provider')
2023-12-12T05:18:57.550 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='scheduler:default', value='localstack.services.providers:scheduler', group='localstack.aws.provider')
2023-12-12T05:18:57.550 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='secretsmanager:default', value='localstack.services.providers:secretsmanager', group='localstack.aws.provider')
2023-12-12T05:18:57.550 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='ses:default', value='localstack.services.providers:ses', group='localstack.aws.provider')
2023-12-12T05:18:57.550 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='sns:default', value='localstack.services.providers:sns', group='localstack.aws.provider')
2023-12-12T05:18:57.550 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='sqs-query:default', value='localstack.services.providers:sqs_query', group='localstack.aws.provider')
2023-12-12T05:18:57.550 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='sqs:default', value='localstack.services.providers:sqs', group='localstack.aws.provider')
2023-12-12T05:18:57.550 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='ssm:default', value='localstack.services.providers:ssm', group='localstack.aws.provider')
2023-12-12T05:18:57.550 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='stepfunctions:default', value='localstack.services.providers:stepfunctions', group='localstack.aws.provider')
2023-12-12T05:18:57.550 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='stepfunctions:legacy', value='localstack.services.providers:stepfunctions_v1', group='localstack.aws.provider')
2023-12-12T05:18:57.550 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='stepfunctions:v1', value='localstack.services.providers:stepfunctions_legacy', group='localstack.aws.provider')
2023-12-12T05:18:57.550 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='stepfunctions:v2', value='localstack.services.providers:stepfunctions_v2', group='localstack.aws.provider')
2023-12-12T05:18:57.551 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='sts:default', value='localstack.services.providers:sts', group='localstack.aws.provider')
2023-12-12T05:18:57.551 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='support:default', value='localstack.services.providers:support', group='localstack.aws.provider')
2023-12-12T05:18:57.551 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='swf:default', value='localstack.services.providers:swf', group='localstack.aws.provider')
2023-12-12T05:18:57.551 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='transcribe:default', value='localstack.services.providers:transcribe', group='localstack.aws.provider')
Ready.
2023-12-12T05:18:57.551 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='_run_init_scripts_on_ready', value='localstack.runtime.init:_run_init_scripts_on_ready', group='localstack.hooks.on_infra_ready')
2023-12-12T05:18:57.551 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='register_virtual_host_routes', value='localstack.services.s3.virtual_host:register_virtual_host_routes', group='localstack.hooks.on_infra_ready')
2023-12-12T05:18:57.551 DEBUG --- [  MainThread] plugin.manager             : instantiating plugin PluginSpec(localstack.hooks.on_infra_ready._run_init_scripts_on_ready = <function _run_init_scripts_on_ready at 0x7ffffc13b740>)
2023-12-12T05:18:57.551 DEBUG --- [  MainThread] plugin.manager             : loading plugin localstack.hooks.on_infra_ready:_run_init_scripts_on_ready
2023-12-12T05:18:57.551 DEBUG --- [  MainThread] plugin.manager             : instantiating plugin PluginSpec(localstack.hooks.on_infra_ready.register_virtual_host_routes = <function register_virtual_host_routes at 0x7ffff885ede0>)
2023-12-12T05:18:57.551 DEBUG --- [  MainThread] plugin.manager             : plugin localstack.hooks.on_infra_ready:register_virtual_host_routes is disabled
2023-12-12T05:19:04.221 DEBUG --- [   asgi_gw_0] l.a.p.service_router       : loading service catalog index cache file /var/lib/localstack/cache/service-catalog-3_0_3_dev-1_32_5.pickle
2023-12-12T05:19:13.884 DEBUG --- [   asgi_gw_0] plugin.manager             : instantiating plugin PluginSpec(localstack.aws.provider.s3:default = <function s3 at 0x7ffff885cfe0>)
2023-12-12T05:19:13.884 DEBUG --- [   asgi_gw_0] plugin.manager             : loading plugin localstack.aws.provider:s3:default
2023-12-12T05:19:14.154  INFO --- [   asgi_gw_0] localstack.request.aws     : AWS s3.CreateBucket => 200

Please note that the last line about "createBucket => 200" is that I manually (aws cli) created a bucket within localstack container itself.

Any idea why I cannot reach to the localstack S3? Thanks.


Solution

  • If you really get that error, this happens because localstack is not available at localhost related to test container.

    Both of these containers have their own localhost. If you want to connect to the localstack from your other container, the connect endpoint would be: http://localstack:4566

    Docker containers in the same compose file can by default access each other with the service name as the host name, in this case localstack and test.