Open
Description
The windows amd 64 build fails to launch. Errors with panic: Failed to load netapi32.dll: The specified module could not
be found.
This issue is reported as an open GOLang issue 21867 The InfluxDB is using APIs not supported on Windows Nano Server. There are work arounds proposed in the report.
Reproduce
Copy the binaries into a Nano Server image. Example of a dockerfile to create an image
####DOCKERFILE
# escape=`
ARG WindowsServerCoreVersion=ltsc2022
ARG INFLUXDB_VERSION=2.0.8
ARG INFLUXDB_SHA256=68584fcb22ff63d35215eff055a5e6d64e9f5da939fe11adae85b661436c1e4b
FROM mcr.microsoft.com/windows/servercore:$WindowsServerCoreVersion AS installer
ARG INFLUXDB_VERSION=$INFLUXDB_VERSION
ARG INFLUXDB_SHA256=$INFLUXDB_SHA256
ARG WindowsServerCoreVersion=$WindowsServerCoreVersion
ENV INFLUXDB_VERSION $INFLUXDB_VERSION
ENV INFLUXDB_SHA256 $INFLUXDB_SHA256
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; `
New-Item -ItemType Directory -Force -Path C:\webdownload | Out-Null; `
Invoke-WebRequest $('https://dl.influxdata.com/influxdb/releases/influxdb2-{0}-windows-amd64.zip' -f $env:INFLUXDB_VERSION) -OutFile 'C:\webdownload\influxdb.zip' -UseBasicParsing; `
if ((Get-FileHash C:\webdownload\influxdb.zip -Algorithm sha256).Hash -ne $env:INFLUXDB_SHA256) { Write-Error 'INFLUXDB_SHA256 mismatch';exit 1 } `
FROM mcr.microsoft.com/windows/nanoserver:$WindowsServerCoreVersion AS base
ARG INFLUXDB_VERSION=$INFLUXDB_VERSION
ARG WindowsServerCoreVersion=$WindowsServerCoreVersion
COPY --from=installer ["C:/influxdb/influxdb2-${INFLUXDB_VERSION}-windows-amd64/", "C:/Program Files/InfluxDB"]
# In order to set system PATH, ContainerAdministrator must be used
USER ContainerAdministrator
EXPOSE 8086
WORKDIR "Program Files/InfluxDB"
ENTRYPOINT [ "influxd.exe" ]
Run docker image.
GOLang Console output
panic: Failed to load netapi32.dll: The specified module could not be found.
goroutine 1 [running]:
syscall.(*LazyProc).mustFind(...)
/home/circleci/.tools/go/src/syscall/dll_windows.go:322 syscall.(*LazyProc).Addr(...)
/home/circleci/.tools/go/src/syscall/dll_windows.go:329 syscall.NetGetJoinInformation(0x0, 0xc00091f9b0, 0xc00091f9ac, 0x2,0xc0001ba390)
/home/circleci/.tools/go/src/syscall/zsyscall_windows.go:1177+0x105
os/user.isDomainJoined(0xc00091fa08, 0x457c8e, 0x0)
/home/circleci/.tools/go/src/os/user/lookup_windows.go:18 +0x5a
os/user.lookupFullName(0xc0001bd2f0, 0xc, 0xc0001c67a0, 0x16,0xc0001ba390, 0x23, 0x16, 0xc0001ba390, 0x23, 0x1)
/home/circleci/.tools/go/src/os/user/lookup_windows.go:51 +0x2d
os/user.newUser(0xc0001bd2d0, 0xc, 0xc0001bd2e0, 0xc, 0xc0001ba330,0x1f, 0xc0001c67a0, 0x16, 0xc0001bd2f0, 0xc, ...)
/home/circleci/.tools/go/src/os/user/lookup_windows.go:181 +0xd4
os/user.current(0x0, 0x0, 0x0)
/home/circleci/.tools/go/src/os/user/lookup_windows.go:225 +0x2de
os/user.Current.func1()
/home/circleci/.tools/go/src/os/user/lookup.go:15 +0x29
sync.(*Once).doSlow(0x9cce0c0, 0x88f72e8)
/home/circleci/.tools/go/src/sync/once.go:68 +0xf7
sync.(*Once).Do(...)
/home/circleci/.tools/go/src/sync/once.go:59
os/user.Current(0x1, 0xc000925050, 0xc00091fc60)
/home/circleci/.tools/go/src/os/user/lookup.go:15 +0x105
github.com/influxdata/influxdb/v2/cmd/influxd/upgrade.influxDirV1(0x72b25c0, 0xc00018c400, 0x0, 0x19)
/home/circleci/go/src/github.com/influxdata/influxdb/cmd/influxd/upgrade/upgrade.go:693 +0x2d
github.com/influxdata/influxdb/v2/cmd/influxd/upgrade.init.1()
/home/circleci/go/src/github.com/influxdata/influxdb/cmd/influxd/upgrade/v1_dump_meta.go:99 +0x47