You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
./gradlew test
(...lots of output...)
> Task :test:fixtures:azure-fixture:composeBuild FAILED
time="2024-12-05T10:29:45+11:00" level=warning msg="buildx: failed to get git commit: "
invalid tag "8a6d57b53415578aaf23306eab866aac_azure-fixture_-azure-fixture-other": invalid reference format
If I run with haltonfailure=false, the following tasks fail:
:test:fixtures:azure-fixture:composeBuild
:test:fixtures:gcs-fixture:composeBuild
:test:fixtures:krb5kdc-fixture:composeBuild
Debug logs (eg from ./gradlew :test:fixtures:azure-fixture:composeBuild) show that a particular docker-compose command is failing:
2024-12-05T11:12:52.188+1100 [INFO] [org.gradle.process.internal.DefaultExecHandle] Starting process 'command 'docker''. Working directory: /Users/arrandengate/src/OpenSearch/test/fixtures/azure-fixture Command: docker compose -f docker-compose.yml --ansi never -p 8a6d57b53415578aaf23306eab866aac_azure-fixture_ build
I am able to reproduce the issue by running that command by itself.
arrandengate@arran-mac-0 azure-fixture % cd /Users/arrandengate/src/OpenSearch/test/fixtures/azure-fixture
arrandengate@arran-mac-0 azure-fixture % docker compose -f docker-compose.yml --ansi never -p 8a6d57b53415578aaf23306eab866aac_azure-fixture_ build
[+] Building 0.0s (0/0) docker:desktop-linux
invalid tag "8a6d57b53415578aaf23306eab866aac_azure-fixture_-azure-fixture-other": invalid reference format
It is caused by an invalid project name provided to docker-compose with the -p flag. (It seems like the project name can't end with an underscore, or contain a hyphen followed by an underscore. I've seen project names like both 8a6d57b53415578aaf23306eab866aac_azure-fixture_-azure-fixture-other and 8a6d57b53415578aaf23306eab866aac_azure-fixture_ passed into docker-compose in the failing tests.)
In our code, it seems that this project name isn't specified directly - it is constructed by the Gradle docker-compose plugin.
The plugin has existing Github issues for this problem:
We could upgrade to the version of the gradle docker compose plugin where this issue is fixed. We are currently on 0.17.6. We would need to upgrade to at least 0.17.10.
Alternatively, there is a workaround mentioned in avast/gradle-docker-compose-plugin#404 - we could set a nested name in the docker compose gradle plugin.
I tried this and it seems to work - eg, if I add the following to test/fixtures/azure-fixture/build.gradle, the test succeeds:
dockerCompose {
nestedName = "fixture"
}
The value of the nestedName could be anything, it doesn't matter. To my understanding, the problem is caused by the plugin generating project names that use hyphens and underscores as separators. These characters are legal, but they cannot be adjacent to each other, or at the end. Adding another component to the name means the project name won't have these characters in illegal positions.
Related component
Build
To Reproduce
Run the following:
./gradlew :test:fixtures:azure-fixture:composeBuild
Expected behavior
The test should succeed.
Additional Details
I encountered this issue under the following conditions:
OS: OSX Sonoma 14.7.1
JDK: Temurin 21.0.5 (tried several others)
OpenSearch: 2.18.0 (tried also 2.10.0)
docker-compose: v2.22.0-desktop.2
Gradle: 8.10.2
The text was updated successfully, but these errors were encountered:
Describe the bug
I encounter a failure when I run tests:
If I run with
haltonfailure=false
, the following tasks fail:Debug logs (eg from
./gradlew :test:fixtures:azure-fixture:composeBuild
) show that a particular docker-compose command is failing:I am able to reproduce the issue by running that command by itself.
It is caused by an invalid project name provided to
docker-compose
with the-p
flag. (It seems like the project name can't end with an underscore, or contain a hyphen followed by an underscore. I've seen project names like both8a6d57b53415578aaf23306eab866aac_azure-fixture_-azure-fixture-other
and8a6d57b53415578aaf23306eab866aac_azure-fixture_
passed into docker-compose in the failing tests.)In our code, it seems that this project name isn't specified directly - it is constructed by the Gradle docker-compose plugin.
The plugin has existing Github issues for this problem:
How can the problem be fixed?
We could upgrade to the version of the gradle docker compose plugin where this issue is fixed. We are currently on 0.17.6. We would need to upgrade to at least 0.17.10.
Alternatively, there is a workaround mentioned in avast/gradle-docker-compose-plugin#404 - we could set a nested name in the docker compose gradle plugin.
I tried this and it seems to work - eg, if I add the following to
test/fixtures/azure-fixture/build.gradle
, the test succeeds:The value of the nestedName could be anything, it doesn't matter. To my understanding, the problem is caused by the plugin generating project names that use hyphens and underscores as separators. These characters are legal, but they cannot be adjacent to each other, or at the end. Adding another component to the name means the project name won't have these characters in illegal positions.
Related component
Build
To Reproduce
Run the following:
./gradlew :test:fixtures:azure-fixture:composeBuild
Expected behavior
The test should succeed.
Additional Details
I encountered this issue under the following conditions:
OS: OSX Sonoma 14.7.1
JDK: Temurin 21.0.5 (tried several others)
OpenSearch: 2.18.0 (tried also 2.10.0)
docker-compose: v2.22.0-desktop.2
Gradle: 8.10.2
The text was updated successfully, but these errors were encountered: