Skip to content

Failure to execute revision with 5.0.0 on Windows Server 2019 #591

@eyalkoren

Description

@eyalkoren

Describe the bug

When executing the revision goal on a Windows Server 2019 machine, getting the following error:

[INFO] --- git-commit-id-maven-plugin:5.0.0:revision (get-the-git-infos)  ---
[INFO] dotGitDirectory <WORKSPACE-DIR>
[INFO] Collected git.build.user.name with value 
[INFO] Collected git.build.user.email with value 
[INFO] Using environment variable based branch name. GIT_BRANCH = <BR>
[INFO] Collected git.branch with value <BR>
[INFO] Collected git.commit.id.describe with value f82fdc8-dirty
[INFO] Collected git.commit.id.describe-short with value f82fdc8-dirty
[INFO] Collected git.commit.id with value f82fdc8f972209a21a8e2789203e4bb1855486e5
[INFO] Collected git.commit.id.abbrev with value f82fdc8
[INFO] Collected git.dirty with value true
[INFO] Collected git.commit.user.name with value <USERNAME>
[INFO] Collected git.commit.user.email with value <USER-EMAIL>
[INFO] Collected git.commit.message.full with value ...
[INFO] Collected git.commit.message.short with value ...
[INFO] Collected git.commit.time with value ...
[INFO] Collected git.commit.author.time with value ...
[INFO] Collected git.commit.committer.time with value ...
[INFO] Collected git.remote.origin.url with value https://github.com/elastic/apm-agent-java.git
[INFO] Collected git.tags with value 
[INFO] Collected git.closest.tag.name with value 
[INFO] Collected git.closest.tag.commit.count with value 
...
[ERROR] Failed to execute goal io.github.git-commit-id:git-commit-id-maven-plugin:5.0.0:revision (get-the-git-infos) on project elastic-apm-agent: Could not complete Mojo execution... pl.project13.core.NativeGitProvider$NativeCommandException: Git command exited with invalid status [128]: directory: `<WORKSPACE-DIR>`, command: `git rev-list HEAD --count`, stdout: ``, stderr: `error: object directory <GIT-REFERENCES-DIR>/objects does not exist; check .git/objects/info/alternateserror: Could not read 91bedd2f072f7a8d36ba8ef23babce780134abbcfatal: Failed to traverse parents of commit 7a263d97724da2ccfa27f53e2a0f1719834097c7`

Steps to Reproduce

Should be reproducible when building the public https://github.com/elastic/apm-agent-java repository by running mvnw test on Windows Server 2019. Currently, the plugin failure doesn't fail the entire build. In order to make it fail, change the failOnUnableToExtractRepoInfo setting to true.

Not reproducible on Windows Server 2022 as well as Windows 10 Pro Desktop.

Plugin configuration:

            <plugin>
                <groupId>io.github.git-commit-id</groupId>
                <artifactId>git-commit-id-maven-plugin</artifactId>
                <version>5.0.0</version>
                <executions>
                    <execution>
                        <id>get-the-git-infos</id>
                        <goals>
                            <goal>revision</goal>
                        </goals>
                        <configuration>
                            <verbose>true</verbose>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

Expected behavior

Goal execution succeeds

Additional context

  • Executed on a Jenkins worker
  • Java version: 11.0.12, vendor: Oracle Corporation
  • Apache Maven 3.8.5
  • Windows Server 2019
  • Maven (wrapper) command being executed: mvnw test

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions