balena-io-examples / balena-datadog

Balena + Datadog Example Project
https://www.balena.io/blog/monitoring-your-balena-devices-with-datadog/
8 stars 4 forks source link

Build Failing #9

Open davis190 opened 3 years ago

davis190 commented 3 years ago

Using the link from here: https://www.balena.io/blog/monitoring-your-balena-devices-with-datadog/ and building on generic x86_64 the build is failing.

Logs

From balena UI

[Info]      Building on x64_01
[Info]      Pulling previous images for caching purposes...
[Success]   Successfully pulled cache images
[Info]      Starting to build datadog
[Info]      Starting to build frontend
[Success]   Successfully built service frontend
[Success]   Successfully built service datadog
[Info]      Uploading images
[Success]   Successfully uploaded images
[Error]     Some services failed to build:
[Error]       Service: datadog
[Error]         Error: The command '/bin/sh -c export PATH=$PATH:$GOPATH/bin GODEBUG=netdns=go &&   cd /usr/app/src/github.com/DataDog/datadog-agent &&   invoke deps -v' returned a non-zero code: 1
[Info]      Built on x64_01
[Error]     Not deploying release.

From running balena deploy <APP> --debug

Error: The command '/bin/sh -c export PATH=$PATH:$GOPATH/bin GODEBUG=netdns=go &&   cd /usr/app/src/github.com/DataDog/datadog-agent &&   invoke deps -v' returned a non-zero code: 1
    at Stream.<anonymous> (/snapshot/volume/node_modules/resin-docker-build/build/builder.js:181:23)
    at Stream.stream.write (/snapshot/volume/node_modules/through/index.js:26:11)
    at Stream.ondata (internal/streams/legacy.js:15:31)
    at Stream.emit (events.js:198:13)
    at Stream.EventEmitter.emit (domain.js:448:20)
    at drain (/snapshot/volume/node_modules/through/index.js:36:16)
    at Stream.stream.queue.stream.push (/snapshot/volume/node_modules/through/index.js:45:5)
    at Parser.exports.parse.parser.onToken (/snapshot/volume/node_modules/JSONStream/index.js:132:18)
    at Parser.proto.write (/snapshot/volume/node_modules/jsonparse/jsonparse.js:135:34)
    at Stream.<anonymous> (/snapshot/volume/node_modules/JSONStream/index.js:23:12)
    at Stream.stream.write (/snapshot/volume/node_modules/through/index.js:26:11)
    at IncomingMessage.ondata (_stream_readable.js:710:20)
    at IncomingMessage.emit (events.js:198:13)
    at IncomingMessage.EventEmitter.emit (domain.js:448:20)
    at addChunk (_stream_readable.js:288:12)
    at readableAddChunk (_stream_readable.js:269:11)
From previous event:
    at createBuildStream.Bluebird.try.then (/snapshot/volume/node_modules/resin-docker-build/build/builder.js:73:20)
    at runCallback (timers.js:705:18)
    at tryOnImmediate (timers.js:676:5)
    at processImmediate (timers.js:658:5)
    at process.topLevelDomainCallback (domain.js:126:23)
From previous event:
    at Builder.createBuildStream (/snapshot/volume/node_modules/resin-docker-build/build/builder.js:72:97)
    at taskResolved.then (/snapshot/volume/node_modules/resin-multibuild/build/build.js:85:21)

Steps to reproduce:

  1. Follow this link
  2. Change device type to generic x86_64
  3. I also changed application type to microservices
jezzab commented 3 years ago

Had the same on armhf. Did a quick hack and this got it building but its far from optimal. Im sure there is a better way but im out of time:

RUN export PATH=$PATH:$GOPATH/bin GODEBUG=netdns=go
RUN cd /usr/app/src/github.com/DataDog/datadog-agent
RUN mkdir -p $GOPATH/src/golang.org/x \
  && git clone https://github.com/golang/lint.git $GOPATH/src/golang.org/x/lint \
  && go get -u golang.org/x/lint/golint

RUN mkdir -p $GOPATH/src/github.com/spf13/pflag \
  && git clone https://github.com/spf13/pflag.git $GOPATH/src/github.com/spf13/pflag \
  && go get -u github.com/spf13/pflag

RUN invoke deps -v
davis190 commented 3 years ago

I did something similar for my workaround, also not ideal.

RUN go get -d github.com/spf13/pflag
RUN mkdir -p /usr/app/src/github.com/spf13/pflag
RUN cp -r /usr/app/pkg/mod/github.com/spf13/pflag@v1.0.5/* /usr/app/src/github.com/spf13/pflag

RUN export PATH=$PATH:$GOPATH/bin GODEBUG=netdns=go && \
  cd /usr/app/src/github.com/DataDog/datadog-agent && \
  invoke deps -v
gelbal commented 3 years ago

Hi @davis190 @jezzab thank you for sharing your solutions. Can you please open a PR with your changes?

With the repo maintainers, we can all work together to clean up and merge the changes.

gitroli commented 3 years ago

My build is also failing with same error, can you please post the whole Dockerfile.template, which is working. Thx