Title
#kolide
m

Marquis Carroll

03/06/2019, 7:13 AM
@seph sorry, I just realized I didn't really answer the question the command I am running is
make package-builder
s

seph

03/06/2019, 3:01 PM
What exactly did you run, and what is the full out that it produced? This seems like a pretty weird case. It’s also what travis-ci is doing.
3:01 PM
It seems a bit like a go deps error.
3:01 PM
Cut and paste the terminal, or screen shot it, or something
m

Marquis Carroll

03/06/2019, 7:01 PM
Marquiss-MBP:launcher marquis$ docker run --rm -it kolide/fpm echo "it works" it works Marquiss-MBP:launcher marquis$ make package-builder go run cmd/make/make.go -targets=deps-go,install-tools build command-line-arguments: cannot load archive/tar: cannot find module providing package archive/tar make: * [deps-go] Error 1 Marquiss-MBP:launcher marquis$
7:02 PM
I am just following the instructions on the package-builder docs. I did a brew install go and that's it.
s

seph

03/06/2019, 7:43 PM
@Marquis Carroll I think I see what’s happening. Can you try running
GO111MODULE=on go mod download
7:44 PM
and then
make package-builder
m

Marquis Carroll

03/06/2019, 7:49 PM
still get the same error as above
7:49 PM
Marquiss-MBP:launcher marquis$ GO111MODULE=on go mod download Marquiss-MBP:launcher marquis$ make package-builder go run cmd/make/make.go -targets=deps-go,install-tools build command-line-arguments: cannot load archive/tar: cannot find module providing package archive/tar make: * [deps-go] Error 1
s

seph

03/06/2019, 7:51 PM
Interesting. I think this is something in your environment. Running in docker:
dover:launcher seph$ docker run -i -t golang:1.12-stretch
root@8a9b9c01992b:/go# cd /tmp 
root@8a9b9c01992b:/tmp# git clone <https://github.com/kolide/launcher.git>
Cloning into 'launcher'...
remote: Enumerating objects: 48, done.
remote: Counting objects: 100% (48/48), done.
remote: Compressing objects: 100% (43/43), done.
remote: Total 2450 (delta 11), reused 7 (delta 2), pack-reused 2402
Receiving objects: 100% (2450/2450), 3.54 MiB | 0 bytes/s, done.
Resolving deltas: 100% (1423/1423), done.
root@8a9b9c01992b:/tmp# cd launcher/
root@8a9b9c01992b:/tmp/launcher# make package-builder
go run cmd/make/make.go -targets=deps-go,install-tools
go: finding <http://github.com/bitly/go-simplejson|github.com/bitly/go-simplejson> v0.5.0
go: finding <http://github.com/WatchBeam/clock|github.com/WatchBeam/clock> v0.0.0-20170901150240-b08e6b4da7ea
go: finding <http://github.com/bugsnag/panicwrap|github.com/bugsnag/panicwrap> v1.2.0
go: finding <http://github.com/Sirupsen/logrus|github.com/Sirupsen/logrus> v1.0.3
go: finding <http://github.com/bmizerany/assert|github.com/bmizerany/assert> v0.0.0-20160611221934-b7ed37b82869
...
Do you have anything odd about network connectivity?
7:52 PM
Wait… Why didn’t
GO111MODULE=on go mod download
produce output?
m

Marquis Carroll

03/06/2019, 8:58 PM
Yeah I am not sure what's wrong.. I am in the launcher directory, and that command did not produce any output.. what do you recommend?
s

seph

03/06/2019, 9:14 PM
Not sure. Seems like your go is weird.
m

Marquis Carroll

03/06/2019, 10:38 PM
How do you recommend properly getting that installed and starting over?
s

seph

03/07/2019, 12:46 AM
I’m not sure where to start with that. You may not need package-builder. It’s a tool to generate OS packages for launcher. It is unrelated to using launcher
12:53 AM
Launcher itself can be downloaded from the github releases page
m

Marquis Carroll

03/07/2019, 12:53 AM
Yeah so I think that is my object, I am trying to build debian packages for my ubuntu hosts to activate to my new kolide fleet server. Am I mistaken?
s

seph

03/07/2019, 1:10 AM
package-builder is one way to build that kind of package, yes. Debian has it’s own tool chain. There are third party tools (like fpm) as well
m

Marquis Carroll

03/07/2019, 6:50 PM
Thanks I will try FPM
12:12 AM
So good news the package-builder ended up working for me.. now, how do I specify making it a debian package?
12:12 AM
I didn't see that in the documentation
s

seph

03/08/2019, 1:59 AM
What did the problem turn out to be?
2:01 AM
From the docs:https://github.com/kolide/launcher/blob/master/docs/package-builder.md#cross-platform-binaries-and-targets If you’re running on a linux machine, you will, by default, get both an rpm and deb.
m

Marquis Carroll

03/08/2019, 2:48 AM
I’m going to be honest I have no clue. I just cleared out my system and reinstalled go and got the same errors and just kept doing make package builder command and it ended up working. Super weird. I created it on my Mac like the docs said so if I want a Linux one I need to make it on a Ubuntu host?
2:48 AM
It generated a .pkg file on my Mac
s

seph

03/08/2019, 3:00 AM
You can cross package from darwin to linux. Target would be linux-systemd-deb
m

Marquis Carroll

03/08/2019, 11:07 PM
hey sorry, last question I hope - when I did the flag for darwin-launchd-pkg etc.. it outputed this
launcher.darwin-launchd-pkg.pkg
so do I just rename the extension to dpkg?
s

seph

03/09/2019, 1:39 AM
darwin-launchd-pkg
would be me a mac packaing, using launchd, packaged via pkg. Not at all what you what for dpkg. As said, you want
linux-systemd-deb
m

Marquis Carroll

03/09/2019, 2:13 AM
could not generate packages: version detection: Failed to exec. Perhaps -- Can't autodetect while cross compiling. (): run command /var/folders/2v/x95_2hh924z3xr2qc7mc025w0000gn/T/package.packageRoot681561942/usr/local/launcher/bin/launcher [-version], stderr=: fork/exec /var/folders/2v/x95_2hh924z3xr2qc7mc025w0000gn/T/package.packageRoot681561942/usr/local/launcher/bin/launcher: exec format error
2:13 AM
Am I missing something here?
s

seph

03/09/2019, 3:27 PM
As the error says, package version auto-detection won’t work when you’re cross compiling. So specify it on the command line.
m

Marquis Carroll

03/11/2019, 4:09 PM
./build/package-builder make --hostname=<http://domain.com:8080|domain.com:8080> --enroll_secret=secretkey --extension_version nightly --targets linux-systemd-deb
4:09 PM
That's what I am doing that's supposed to be what I see correct?
4:09 PM
Of course I omitted the hostname and enroll secret purposely
4:09 PM
I am still getting that error
4:57 PM
These tools are not the friendliest. You will need to poke through the
--help
output for some directions. For example, there is a
-package_version
parameter.
m

Marquis Carroll

03/11/2019, 5:33 PM
Finally got it! thanks a bunch!
6:15 PM
Hey quick question, so I created the package and it properly "installs" my debian on the ubuntu host but it does not show up on my kolide fleet gui.. it keeps saying invalid enroll key, and missing node key.. but I am taking the enroll key from my server when I build the package. Is there something I should be aware of?
8:29 PM
so it says
Access the debug endpoints at /debug/?token=<token>
and it keeps saying invalid enroll secret so should I specify that token in the fleet serve command?