quarkusio/quarkus · error · IllegalStateException
The container image ${dockerImageName} requires you to accep
Error message
The container image ${dockerImageName} requires you to accept a license agreement. To accept, add the following to your Quarkus configuration: quarkus.devservices.license-acceptance=${dockerImageName} What it means
This error is raised when the MSSQL dev services container fails to start because Testcontainers' MSSQLServerContainer enforces acceptance of the Microsoft SQL Server EULA. Quarkus catches the underlying IllegalStateException (whose message contains 'license agreement') and rethrows it with instructions on how to accept the license via configuration. It is a deliberate guardrail: running the MSSQL image legally requires ACCEPT_EULA=Y.
Source
Thrown at extensions/devservices/mssql/src/main/java/io/quarkus/devservices/mssql/deployment/MSSQLDevServicesProcessor.java:137
private final String hostName;
public QuarkusMSSQLServerContainer(Optional<String> imageName, OptionalInt fixedExposedPort,
String defaultNetworkId, boolean useSharedNetwork) {
super(DockerImageName
.parse(imageName.orElseGet(() -> ConfigureUtil.getDefaultImageNameFor("mssql")))
.asCompatibleSubstituteFor(MSSQLServerContainer.IMAGE));
this.fixedExposedPort = fixedExposedPort;
this.useSharedNetwork = useSharedNetwork;
this.hostName = ConfigureUtil.configureNetwork(this, defaultNetworkId, useSharedNetwork, "mssql");
}
@Override
protected void configure() {
try {
super.configure();
} catch (IllegalStateException e) {
if (e.getMessage() != null && e.getMessage().contains("license agreement")) {
throw new IllegalStateException(
"The container image " + getDockerImageName()
+ " requires you to accept a license agreement."
+ " To accept, add the following to your Quarkus configuration:"
+ " quarkus.devservices.license-acceptance=" + getDockerImageName(),
e);
}
throw e;
}
if (useSharedNetwork) {
return;
}
if (fixedExposedPort.isPresent()) {
addFixedExposedPort(fixedExposedPort.getAsInt(), MS_SQL_SERVER_PORT);
} else {
addExposedPort(MS_SQL_SERVER_PORT);
}View on GitHub (pinned to e1c734241f)
Solutions
- Add quarkus.devservices.license-acceptance=<dockerImageName> (e.g. mcr.microsoft.com/mssql/server:2022-latest) to application.properties
- Or set the Testcontainers equivalent directly via quarkus.datasource.devservices.container-env.ACCEPT_EULA=Y
- If you cannot accept the license, disable dev services (quarkus.datasource.devservices.enabled=false) and point to a real database via quarkus.datasource.jdbc.url
Example fix
// before # application.properties (no license acceptance) quarkus.datasource.devservices.enabled=true // after quarkus.devservices.license-acceptance=mcr.microsoft.com/mssql/server:2022-latest
Defensive patterns
Strategy: validation
Validate before calling
String image = "mcr.microsoft.com/mssql/server:2022-latest";
String accepted = ConfigProvider.getConfig().getValue("quarkus.devservices.license-acceptance", String.class);
if (!image.equals(accepted)) {
throw new IllegalArgumentException("Add quarkus.devservices.license-acceptance=" + image);
} Try / catch
try {
devServicesResult = mssqlProcessorStart(...);
} catch (IllegalStateException e) {
if (e.getMessage() != null && e.getMessage().contains("license agreement")) {
log.error("Accept the MSSQL EULA: quarkus.devservices.license-acceptance=" + imageName);
} else throw e;
} Prevention
- Always set quarkus.devservices.license-acceptance for MSSQL in shared configs
- Commit the license acceptance property to the repository so CI inherits it
- Keep the accepted value in sync with the devservices image name
When it happens
Trigger: Starting the MSSQL dev services container (dev mode or quarkus:test) without setting the license acceptance property; using an MSSQL image whose container init checks for the EULA environment variable.
Common situations: First-time use of quarkus-deavorservices-mssql; CI environments with a fresh container cache where no previous run accepted the EULA; switching to a different MSSQL docker image name that has its own license acceptance requirement.
Related errors
- The fixed Kafka port must be greater than 0
- Should be implemented!
- Only official eclipse-mosquitto images are supported
- The fixed port must be greater than 0
- Only official rabbitmq images are supported
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/1499f506ad42d80a.
Report an issue: GitHub.