Skip to content

Service endpoint_url from config file ignored #5779

Closed
@fkjaekel

Description

@fkjaekel

Describe the bug

In order to use the least environment variables possible with localstack, I created the following profile:

[services localstack-specific]
s3 =
  endpoint_url = http://s3.localhost.localstack.cloud:4566

[profile localstack]
region = us-east-1
output = json
endpoint_url=http://localhost:4566
services = localstack-specific

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

Be able to use the endpoint_url from config file instead of the AWS_ENDPOINT_URL_S3 environment variable

Current Behavior

Since the endpoint_url from config is not being used, if I don't set AWS_ENDPOINT_URL_S3 I get this at localstack:

File "/opt/code/localstack/.venv/lib/python3.11/site-packages/localstack/aws/protocol/parser.py", line 779, in _parse_xml_string_to_dom
raise ProtocolParserError(
localstack.aws.protocol.parser.ProtocolParserError: Unable to parse request (not well-formed (invalid token): line 1, column 0), invalid XML received:
b'{"sourceId":"1","eventDateTime":"2024-11-14T12:13:18.6870-03:00","code":"1 ","sourceApplicationId":1,"display":"TESTE","active":"true "}'
(Service: S3, Status Code: 500, Request ID: 4d0a9fbd-6893-4f2d-9f55-138ddb31fbd6, Extended Request ID: s9lzHYrFp76ZVxRcpX9+5cjAnEH2ROuNkd2BHfIa6UkFVdtjf5mKR3/eTPFvsiP/XV/VLi31234=)
Suppressed: software.amazon.awssdk.core.exception.SdkClientException: Request attempt 2 failure: exception while calling s3 with unknown operation: Traceback (most recent call last):
File "/opt/code/localstack/.venv/lib/python3.11/site-packages/localstack/aws/protocol/parser.py", line 776, in _parse_xml_string_to_dom
parser.feed(xml_string)
xml.etree.ElementTree.ParseError: not well-formed (invalid token): line 1, column 0

Reproduction Steps

set AWS_PROFILE=localstack and use S3AsyncClient

Possible Solution

No response

Additional Information/Context

localstack version: 4

AWS Java SDK version used

2.29.47

JDK version used

openjdk version "21.0.2" 2024-01-16 OpenJDK Runtime Environment GraalVM CE 21.0.2+13.1 (build 21.0.2+13-jvmci-23.1-b30) OpenJDK 64-Bit Server VM GraalVM CE 21.0.2+13.1 (build 21.0.2+13-jvmci-23.1-b30, mixed mode, sharing)

Operating System and version

Linux Mint 22

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue is a bug.p2This is a standard priority issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions