Skip to content

Go Get/Install Error for v1.4.0 due to invalid char ':' in fixtures/udev/data files #2482

@dtchanpura

Description

@dtchanpura

Host operating system: output of uname -a

Linux lt02 5.19.11-arch1-1 SMP PREEMPT_DYNAMIC Sat, 24 Sep 2022 18:24:15 +0000 x86_64 GNU/Linux

node_exporter version: output of node_exporter --version

$ make build # works
$ ./node_exporter --version
node_exporter, version 1.4.0 (branch: tag-v1.4.0, revision: 7da1321761b3b8dfc9e496e1a60e6a476fec6018)
  build user:       darshil@lt02
  build date:       20220927-07:41:53
  go version:       go1.19.1
  platform:         linux/amd64

node_exporter command line flags

None

Are you running node_exporter in Docker?

No.

What did you do that produced an error?

Running command go get for adding node_exporter as dependency

$ go get github.com/prometheus/node_exporter@latest

What did you expect to see?

Similar to v1.3.1 the expectation is to have exit-code 0 for go-get

$ go get github.com/prometheus/node_exporter@v1.3.1
go: downloading github.com/prometheus/node_exporter v1.3.1
$ echo $?
0

What did you see instead?

Instead for v1.4.0 the exit-code is 1 and following is the output.

$ go get github.com/prometheus/node_exporter@latest
go: downloading github.com/prometheus/node_exporter v1.4.0
go: github.com/prometheus/node_exporter@latest: create zip: collector/fixtures/udev/data/b11:0: malformed file path "collector/fixtures/udev/data/b11:0": invalid char ':'
collector/fixtures/udev/data/b179:0: malformed file path "collector/fixtures/udev/data/b179:0": invalid char ':'
collector/fixtures/udev/data/b179:1: malformed file path "collector/fixtures/udev/data/b179:1": invalid char ':'
collector/fixtures/udev/data/b179:2: malformed file path "collector/fixtures/udev/data/b179:2": invalid char ':'
collector/fixtures/udev/data/b252:0: malformed file path "collector/fixtures/udev/data/b252:0": invalid char ':'
collector/fixtures/udev/data/b252:1: malformed file path "collector/fixtures/udev/data/b252:1": invalid char ':'
collector/fixtures/udev/data/b252:2: malformed file path "collector/fixtures/udev/data/b252:2": invalid char ':'
collector/fixtures/udev/data/b252:3: malformed file path "collector/fixtures/udev/data/b252:3": invalid char ':'
collector/fixtures/udev/data/b252:4: malformed file path "collector/fixtures/udev/data/b252:4": invalid char ':'
collector/fixtures/udev/data/b252:5: malformed file path "collector/fixtures/udev/data/b252:5": invalid char ':'
collector/fixtures/udev/data/b254:0: malformed file path "collector/fixtures/udev/data/b254:0": invalid char ':'
collector/fixtures/udev/data/b259:0: malformed file path "collector/fixtures/udev/data/b259:0": invalid char ':'
collector/fixtures/udev/data/b8:0: malformed file path "collector/fixtures/udev/data/b8:0": invalid char ':'
collector/fixtures/udev/data/b8:16: malformed file path "collector/fixtures/udev/data/b8:16": invalid char ':'
collector/fixtures/udev/data/b8:32: malformed file path "collector/fixtures/udev/data/b8:32": invalid char ':'

Same with go install

$ go install github.com/prometheus/node_exporter@latest
go: downloading github.com/prometheus/node_exporter v1.4.0
go: github.com/prometheus/node_exporter@latest: create zip: collector/fixtures/udev/data/b11:0: malformed file path "collector/fixtures/udev/data/b11:0": invalid char ':'
collector/fixtures/udev/data/b179:0: malformed file path "collector/fixtures/udev/data/b179:0": invalid char ':'
collector/fixtures/udev/data/b179:1: malformed file path "collector/fixtures/udev/data/b179:1": invalid char ':'
collector/fixtures/udev/data/b179:2: malformed file path "collector/fixtures/udev/data/b179:2": invalid char ':'
collector/fixtures/udev/data/b252:0: malformed file path "collector/fixtures/udev/data/b252:0": invalid char ':'
collector/fixtures/udev/data/b252:1: malformed file path "collector/fixtures/udev/data/b252:1": invalid char ':'
collector/fixtures/udev/data/b252:2: malformed file path "collector/fixtures/udev/data/b252:2": invalid char ':'
collector/fixtures/udev/data/b252:3: malformed file path "collector/fixtures/udev/data/b252:3": invalid char ':'
collector/fixtures/udev/data/b252:4: malformed file path "collector/fixtures/udev/data/b252:4": invalid char ':'
collector/fixtures/udev/data/b252:5: malformed file path "collector/fixtures/udev/data/b252:5": invalid char ':'
collector/fixtures/udev/data/b254:0: malformed file path "collector/fixtures/udev/data/b254:0": invalid char ':'
collector/fixtures/udev/data/b259:0: malformed file path "collector/fixtures/udev/data/b259:0": invalid char ':'
collector/fixtures/udev/data/b8:0: malformed file path "collector/fixtures/udev/data/b8:0": invalid char ':'
collector/fixtures/udev/data/b8:16: malformed file path "collector/fixtures/udev/data/b8:16": invalid char ':'
collector/fixtures/udev/data/b8:32: malformed file path "collector/fixtures/udev/data/b8:32": invalid char ':'

Notes

  • This behavior of supporting go-get/go-install doesn't seem to be the part of the scope for node_exporter and binaries work just fine, but the direct install for places where Go compiler is available and doesn't need a bulky package manager makes it easy.
  • The options for fixing it can be, archiving the udev fixtures and at the test time, putting it in fixtures directory to make tests pass, similar to sys.ttar, I have made changes to it and the test cases are working, will be happy to create a PR if this issue looks valid.

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