Skip to content

Conversation

@jcarranzan
Copy link
Contributor

@jcarranzan jcarranzan commented Nov 7, 2025

This PR fixes test failures in Quarkus Quickstarts (like amazon-dynamodb-quickstart, amazon-kms-quickstart,...) that use LocalStack Dev Services on Windows.

Failures were discovered in our Jenkins job rhbq-3.27-win22-jdk17-quickstarts-ts-jvm
When tests were running on a Windows machine using Quarkus Dev Services for LocalStack, these failed.
But the failures could occur in environments where the Docker host is configured on a non-localhost IP (e.g., when using Minikube).

The Java tests fail with ResourceNotFoundException, indicating that the init scripts never created the AWS resources (like DynamoDB tables):

[io.qua.ver.htt.run.QuarkusErrorHandler] (vert.x-eventloop-thread-0) HTTP Request to /async-fruits failed, error id: 91785ec3-3c1d-4fcb-9f24-4c60139a0320-2: software.amazon.awssdk.services.dynamodb.model.ResourceNotFoundException: Cannot do operations on a non-existent table (Service: DynamoDb, Status Code: 400, Request ID: 3fab99b0-c63f-442e-80c7-ca79219b5765) (SDK Attempt Count: 1)
        at software.amazon.awssdk.services.dynamodb.model.ResourceNotFoundException$BuilderImpl.build(ResourceNotFoundException.java:151)

The LocalStack container logs show the init scripts are executing, but the awslocal command fails with a connection error.
It is trying to connect to the external Docker Host IP (e.g., 192.168.0.10) from within the container, instead of using the container's internal localhost.
 

LocalStack version: 4.2.0
LocalStack build date: 2025-02-27
LocalStack build git hash: 2144203e0
++ awslocal kms create-key --query KeyMetadata.KeyId --output text
Could not connect to the endpoint URL: "http://192.168.0.10:4566/"
+ key_id=
2025-10-22T21:01:47.807 ERROR — [ady_monitor)] localstack.runtime.init    : Error while running script Script(path='/etc/localstack/init/ready.d/01_create_key.sh', stage=READY, state=ERROR): Script /etc/localstack/init/ready.d/01_create_key.sh returned a non-zero exit code 255
Tests init completed

Investigating seems related to a breaking change introduced in quarkus-amazon-services 3.4.0 (PR #1557 quarkiverse/quarkus-amazon-services#1557 )
Now in 3.4.0, the shared network is only configured when explicitly enabled via quarkus.devservices.launch-on-shared-network=true, but that on Linux environments would fail.

Adding the following property to src/test/resources/application.properties:
quarkus.aws.devservices.localstack.container-properties.LOCALSTACK_HOST=127.0.0.1 ensures the init scripts run successfully on Windows and on the rest of the environments.

@quarkus-bot
Copy link

quarkus-bot bot commented Nov 7, 2025

/cc @scrocquesel (amazon)

@quarkus-bot
Copy link

quarkus-bot bot commented Nov 7, 2025

Status for workflow Pull Request Build - development

This is the status report for running Pull Request Build - development on commit da32746.

Failing Jobs

Status Name Step Failures Logs Raw logs
Build - JDK 17 Build with Maven Failures Logs Raw logs

Full information is available in the Build summary check run.

Failures

⚙️ Build - JDK 17 #

- Failing: quartz-quickstart 

📦 quartz-quickstart

org.acme.quartz.TaskResourceTest.tasks line 21 - More details - Source on GitHub

java.lang.AssertionError: 
1 expectation failed.
JSON path size() doesn't match.
Expected: is a value equal to or greater than <1>
  Actual: <0>

	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)

@jcarranzan jcarranzan changed the title Fix LocalStack Dev Service failures on Windows for amazon-quickstarts Fix LocalStack Dev Service failures on non-localhost Docker hosts for amazon-quickstarts Nov 7, 2025
@michalvavrik michalvavrik requested a review from gsmet November 7, 2025 21:12
@scrocquesel
Copy link
Contributor

@jcarranzan Thank you for the investigation. Do you think something could be done directly in the quarkus extension to avoid having to configure this manually ?

@jcarranzan
Copy link
Contributor Author

@jcarranzan Thank you for the investigation. Do you think something could be done directly in the quarkus extension to avoid having to configure this manually ?

Hi @scrocquesel , good point, I will try it this week, thanks.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants