Skip to content

Error in getting https proxy when it is unset via teamcity parameter #1987

@TobiasFunk

Description

@TobiasFunk

Hey we are using teamcity which is not really capable of deleting environment parameters / variables

For our agents we need to delete the HTTPS_PROXY, so we set the parameter like that:
params {
param("env.HTTPS_PROXY", "")
}

The equalivalent in powershell to reproduce the issue is this:
$env:HTTPS_PROXY=""

When we execute now bootstrap i get this error:

./bootstrap-vcpkg.bat
Downloading https://github.com/microsoft/vcpkg-tool/releases/download/2026-02-21/vcpkg.exe -> C:\BUILD\vcpkg\windows\vcpkg.exe
While calling Windows API function GetEnvironmentVariableW got error 0x00000001:
(unknown error, FormatMessageW failed with 0x00000057)

I did a small test program and the GetEnvironmentVariableW returns false, but does not reset GetLastError(), so GetLastError() will return whatever a previous API call set there.

Expected result:
No error for getting env variable
Don't use proxy
Download starts

Actual result:
Error for getting env variable
download fails

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions