Skip to content

"error: invalid key: http.extraheader" after upgrading agent #174

Description

@michha

We are running Azure DevOps Server 2022 with the latest patch installed. Our pipelines execute in self-hosted containers, which allows us to pinpoint changes effectively.
We have observed that updating the agent in our image from 4.270.0 to 4.271.0 causes the WikiPdfExportTask to fail. These issue occurs with both task versions 4.4.10 and 4.5.12.
The release notes for 4.271.0 highlight an update of mingit from 2.50.1 to 2.53.0 as a notable change.
To determine if this is a regression in the 4.271.0 agent itself, I also tested newer versions: 4.273.0, 4.275.0, 5.276.0, 5.277.0. WikiPdfExportTask fails on every version with the exact same "invalid key: http.extraheader" message.

Do you have any hints?

4.270.0

Cloning Repo
Using OAUTH Agent Token, overriding username and password
The provided repo URL is https://someserver/SomeCollection/ABC/_git/ABC.wiki
The protocol is https
The provided repo URL is https://someserver/SomeCollection/ABC/_git/ABC.wiki
Removing leading [http://](http:) or [https://](https://github.com/MaxMelcher/AzureDevOps.WikiPDFExport/issues/new) block
Trimmed the URL to someserver/SomeCollection/ABC/_git/ABC.wiki
Injecting the authentication via the clone command using paramter -c http.extraheader='AUTHORIZATION: bearer ***'
URL used https://someserver/SomeCollection/ABC/_git/ABC.wiki
Cleaned C:\agent\_work\4\s\repo
Cloned someserver/SomeCollection/ABC/_git/ABC.wiki to C:\agent\_work\4\s\repo
Processing the contents of the folder 'C:\agent\_work\4\s\repo' 
Using C:\agent\_work\4\s\repo as the root path to export
Using the .order file in the root of the wiki to determine the order of the pages to export
Adding extra parameters to the command line
Changing folder to C:\agent\_work\4\s\repo
Using command '"C:\Program Files\WikiPdfExport\azuredevops-export-wiki.exe"  -p "C:\agent\_work\4\s\repo" -o "C:\agent\_work\4\a\output.pdf" --chrome-path "C:\Program Files\Google\Chrome\Application\chrome.exe" --attachments-path "C:\agent\_work\4\s\repo\.attachments" --breakPage --css "C:\Program Files\WikiPdfExport\devopswikistyle.css" --heading --highlight-code --organization "[https://someserver/SomeCollection/"](https://someserver/SomeCollection/%22) --disableTelemetry --pat *** --verbose'
00:00:00.24 Reading .order file in directory C:\agent\_work\4\s\repo
00:00:00.25     Pages: 15

4.271.0 and newer

Cloning Repo
Using OAUTH Agent Token, overriding username and password
The provided repo URL is https://someserver/SomeCollection/ABC/_git/ABC.wiki
The protocol is https
The provided repo URL is https://someserver/SomeCollection/ABC/_git/ABC.wiki
Removing leading [http://](http:) or [https://](https://github.com/MaxMelcher/AzureDevOps.WikiPDFExport/issues/new) block
Trimmed the URL to someserver/SomeCollection/ABC/_git/ABC.wiki
Injecting the authentication via the clone command using paramter -c http.extraheader='AUTHORIZATION: bearer ***'
URL used https://someserver/SomeCollection/ABC/_git/ABC.wiki
Cleaned C:\agent\_work\1\s\repo
##[error]Error: Cloning into 'C:\agent\_work\1\s\repo'...
error: invalid key:  http.extraheader
fatal: unable to write parameters to config file

##[error]Error: Cloning into 'C:\agent\_work\1\s\repo'...
error: invalid key:  http.extraheader
fatal: unable to write parameters to config file

Processing the contents of the folder 'C:\agent\_work\1\s\repo' 
##[error]Cannot find wiki folder C:\agent\_work\1\s\repo

task configuration:

- task: WikiPdfExportTask@4
  inputs:
    repo: ${{ parameters.WikiGitUrl }}
    useAgentToken: true
    injectExtraHeader: true
    localpath: '$(System.DefaultWorkingDirectory)\repo'
    outputFile: '$(Build.ArtifactStagingDirectory)\output.pdf'
    overrideExePath: 'C:\Program Files\WikiPdfExport\azuredevops-export-wiki.exe'
    ExtraParameters: '--chrome-path "C:\Program Files\Google\Chrome\Application\chrome.exe" --attachments-path "$(System.DefaultWorkingDirectory)\repo\.attachments" --breakPage --css "C:\Program Files\WikiPdfExport\devopswikistyle.css" --heading --highlight-code --organization "$(System.CollectionUri)" --disableTelemetry --pat $(System.AccessToken) --verbose'
  target:
    settableVariables: none

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions