Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does cross-compile works for influxdb #2024

Closed
shinji62 opened this issue Mar 20, 2015 · 6 comments
Closed

Does cross-compile works for influxdb #2024

shinji62 opened this issue Mar 20, 2015 · 6 comments

Comments

@shinji62
Copy link

Hi,

I am developing on my Mac so I build everything from my mac,
I used gox for cross-compiling influxdb binary for linux (ubuntu)

gox -verbose -osarch="linux/amd64" -output "pkg/{{.OS}}/{{.Arch}}/{{.Dir}}" ./... 

But I got this error everytime I try to start my compiled binary on my ubuntu box :


 8888888           .d888 888                   8888888b.  888888b.
   888            d88P"  888                   888  "Y88b 888  "88b
   888            888    888                   888    888 888  .88P
   888   88888b.  888888 888 888  888 888  888 888    888 8888888K.
   888   888 "88b 888    888 888  888  Y8bd8P' 888    888 888  "Y88b
   888   888  888 888    888 888  888   X88K   888    888 888    888
   888   888  888 888    888 Y88b 888 .d8""8b. 888  .d88P 888   d88P
 8888888 888  888 888    888  "Y88888 888  888 8888888P"  8888888P"

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x400f8c]

goroutine 1 [running]:
main.NewConfig(0x8a4e80)
        /Users/etourg/.gvm/pkgsets/go1.4/global/src/github.com/influxdb/influxdb/cmd/influxd/config.go:159 +0x38c
main.ParseConfigFile(0x7fffd700db3c, 0x2c, 0x0, 0x0, 0x0)
        /Users/etourg/.gvm/pkgsets/go1.4/global/src/github.com/influxdb/influxdb/cmd/influxd/config.go:323 +0x59
main.parseConfig(0x7fffd700db3c, 0x2c, 0x0, 0x0, 0x0)
        /Users/etourg/.gvm/pkgsets/go1.4/global/src/github.com/influxdb/influxdb/cmd/influxd/run.go:243 +0x54
main.execRun(0xc20800a010, 0x4, 0x4)
        /Users/etourg/.gvm/pkgsets/go1.4/global/src/github.com/influxdb/influxdb/cmd/influxd/main.go:110 +0x5cb
main.main()
        /Users/etourg/.gvm/pkgsets/go1.4/global/src/github.com/influxdb/influxdb/cmd/influxd/main.go:70 +0x35b

goroutine 2 [runnable]:
runtime.forcegchelper()
        /Users/etourg/.gvm/gos/go1.4/src/runtime/proc.go:90
runtime.goexit()
        /Users/etourg/.gvm/gos/go1.4/src/runtime/asm_amd64.s:2232 +0x1

goroutine 3 [runnable]:
runtime.bgsweep()
        /Users/etourg/.gvm/gos/go1.4/src/runtime/mgc0.go:82
runtime.goexit()
        /Users/etourg/.gvm/gos/go1.4/src/runtime/asm_amd64.s:2232 +0x1

goroutine 4 [runnable]:
runtime.runfinq()
        /Users/etourg/.gvm/gos/go1.4/src/runtime/malloc.go:712
runtime.goexit()
        /Users/etourg/.gvm/gos/go1.4/src/runtime/asm_amd64.s:2232 +0x1

goroutine 5 [runnable]:
os/signal.loop()
        /Users/etourg/.gvm/gos/go1.4/src/os/signal/signal_unix.go:19
created by os/signal.init·1
        /Users/etourg/.gvm/gos/go1.4/src/os/signal/signal_unix.go:27 +0x35

goroutine 6 [runnable]:
main.func·002()
        /Users/etourg/.gvm/pkgsets/go1.4/global/src/github.com/influxdb/influxdb/cmd/influxd/main.go:216
created by main.startProfiling
        /Users/etourg/.gvm/pkgsets/go1.4/global/src/github.com/influxdb/influxdb/cmd/influxd/main.go:222 +0x2dc

So if anyone have any idea ..
Thanks

@otoolep
Copy link
Contributor

otoolep commented Mar 20, 2015

Looks like your system is having a hard time creating the required
directories.

https://github.com/influxdb/influxdb/blob/master/cmd/influxd/config.go

Can you pass a config file to influxd, and set the directories as shown in:

https://github.com/influxdb/influxdb/blob/master/etc/config.sample.toml

Philip

On Thu, Mar 19, 2015 at 7:45 PM, Etourneau Gwenn notifications@github.com
wrote:

Hi,

I am developing on my Mac so I build everything from my mac,
I used gox for cross-compiling influxdb binary for linux (ubuntu)

gox -verbose -osarch="linux/amd64" -output "pkg/{{.OS}}/{{.Arch}}/{{.Dir}}" ./...

But I got this error everytime I try to start my compiled binary on my
ubuntu box :

8888888 .d888 888 8888888b. 888888b.
888 d88P" 888 888 "Y88b 888 "88b
888 888 888 888 888 888 .88P
888 88888b. 888888 888 888 888 888 888 888 888 8888888K.
888 888 "88b 888 888 888 888 Y8bd8P' 888 888 888 "Y88b
888 888 888 888 888 888 888 X88K 888 888 888 888
888 888 888 888 888 Y88b 888 .d8""8b. 888 .d88P 888 d88P
8888888 888 888 888 888 "Y88888 888 888 8888888P" 8888888P"

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x400f8c]

goroutine 1 [running]:
main.NewConfig(0x8a4e80)
/Users/etourg/.gvm/pkgsets/go1.4/global/src/github.com/influxdb/influxdb/cmd/influxd/config.go:159 +0x38c
main.ParseConfigFile(0x7fffd700db3c, 0x2c, 0x0, 0x0, 0x0)
/Users/etourg/.gvm/pkgsets/go1.4/global/src/github.com/influxdb/influxdb/cmd/influxd/config.go:323 +0x59
main.parseConfig(0x7fffd700db3c, 0x2c, 0x0, 0x0, 0x0)
/Users/etourg/.gvm/pkgsets/go1.4/global/src/github.com/influxdb/influxdb/cmd/influxd/run.go:243 +0x54
main.execRun(0xc20800a010, 0x4, 0x4)
/Users/etourg/.gvm/pkgsets/go1.4/global/src/github.com/influxdb/influxdb/cmd/influxd/main.go:110 +0x5cb
main.main()
/Users/etourg/.gvm/pkgsets/go1.4/global/src/github.com/influxdb/influxdb/cmd/influxd/main.go:70 +0x35b

goroutine 2 [runnable]:
runtime.forcegchelper()
/Users/etourg/.gvm/gos/go1.4/src/runtime/proc.go:90
runtime.goexit()
/Users/etourg/.gvm/gos/go1.4/src/runtime/asm_amd64.s:2232 +0x1

goroutine 3 [runnable]:
runtime.bgsweep()
/Users/etourg/.gvm/gos/go1.4/src/runtime/mgc0.go:82
runtime.goexit()
/Users/etourg/.gvm/gos/go1.4/src/runtime/asm_amd64.s:2232 +0x1

goroutine 4 [runnable]:
runtime.runfinq()
/Users/etourg/.gvm/gos/go1.4/src/runtime/malloc.go:712
runtime.goexit()
/Users/etourg/.gvm/gos/go1.4/src/runtime/asm_amd64.s:2232 +0x1

goroutine 5 [runnable]:
os/signal.loop()
/Users/etourg/.gvm/gos/go1.4/src/os/signal/signal_unix.go:19
created by os/signal.init·1
/Users/etourg/.gvm/gos/go1.4/src/os/signal/signal_unix.go:27 +0x35

goroutine 6 [runnable]:
main.func·002()
/Users/etourg/.gvm/pkgsets/go1.4/global/src/github.com/influxdb/influxdb/cmd/influxd/main.go:216
created by main.startProfiling
/Users/etourg/.gvm/pkgsets/go1.4/global/src/github.com/influxdb/influxdb/cmd/influxd/main.go:222 +0x2dc

So if anyone have any idea ..
Thanks


Reply to this email directly or view it on GitHub
#2024.

@otoolep
Copy link
Contributor

otoolep commented Mar 20, 2015

Specifically:

https://github.com/influxdb/influxdb/blob/master/cmd/influxd/config.go#L159

On Thu, Mar 19, 2015 at 8:35 PM, Philip O'Toole philip@influxdb.com wrote:

Looks like your system is having a hard time creating the required
directories.

https://github.com/influxdb/influxdb/blob/master/cmd/influxd/config.go

Can you pass a config file to influxd, and set the directories as shown in:

https://github.com/influxdb/influxdb/blob/master/etc/config.sample.toml

Philip

On Thu, Mar 19, 2015 at 7:45 PM, Etourneau Gwenn <notifications@github.com

wrote:

Hi,

I am developing on my Mac so I build everything from my mac,
I used gox for cross-compiling influxdb binary for linux (ubuntu)

gox -verbose -osarch="linux/amd64" -output "pkg/{{.OS}}/{{.Arch}}/{{.Dir}}" ./...

But I got this error everytime I try to start my compiled binary on my
ubuntu box :

8888888 .d888 888 8888888b. 888888b.
888 d88P" 888 888 "Y88b 888 "88b
888 888 888 888 888 888 .88P
888 88888b. 888888 888 888 888 888 888 888 888 8888888K.
888 888 "88b 888 888 888 888 Y8bd8P' 888 888 888 "Y88b
888 888 888 888 888 888 888 X88K 888 888 888 888
888 888 888 888 888 Y88b 888 .d8""8b. 888 .d88P 888 d88P
8888888 888 888 888 888 "Y88888 888 888 8888888P" 8888888P"

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x400f8c]

goroutine 1 [running]:
main.NewConfig(0x8a4e80)
/Users/etourg/.gvm/pkgsets/go1.4/global/src/github.com/influxdb/influxdb/cmd/influxd/config.go:159 +0x38c
main.ParseConfigFile(0x7fffd700db3c, 0x2c, 0x0, 0x0, 0x0)
/Users/etourg/.gvm/pkgsets/go1.4/global/src/github.com/influxdb/influxdb/cmd/influxd/config.go:323 +0x59
main.parseConfig(0x7fffd700db3c, 0x2c, 0x0, 0x0, 0x0)
/Users/etourg/.gvm/pkgsets/go1.4/global/src/github.com/influxdb/influxdb/cmd/influxd/run.go:243 +0x54
main.execRun(0xc20800a010, 0x4, 0x4)
/Users/etourg/.gvm/pkgsets/go1.4/global/src/github.com/influxdb/influxdb/cmd/influxd/main.go:110 +0x5cb
main.main()
/Users/etourg/.gvm/pkgsets/go1.4/global/src/github.com/influxdb/influxdb/cmd/influxd/main.go:70 +0x35b

goroutine 2 [runnable]:
runtime.forcegchelper()
/Users/etourg/.gvm/gos/go1.4/src/runtime/proc.go:90
runtime.goexit()
/Users/etourg/.gvm/gos/go1.4/src/runtime/asm_amd64.s:2232 +0x1

goroutine 3 [runnable]:
runtime.bgsweep()
/Users/etourg/.gvm/gos/go1.4/src/runtime/mgc0.go:82
runtime.goexit()
/Users/etourg/.gvm/gos/go1.4/src/runtime/asm_amd64.s:2232 +0x1

goroutine 4 [runnable]:
runtime.runfinq()
/Users/etourg/.gvm/gos/go1.4/src/runtime/malloc.go:712
runtime.goexit()
/Users/etourg/.gvm/gos/go1.4/src/runtime/asm_amd64.s:2232 +0x1

goroutine 5 [runnable]:
os/signal.loop()
/Users/etourg/.gvm/gos/go1.4/src/os/signal/signal_unix.go:19
created by os/signal.init·1
/Users/etourg/.gvm/gos/go1.4/src/os/signal/signal_unix.go:27 +0x35

goroutine 6 [runnable]:
main.func·002()
/Users/etourg/.gvm/pkgsets/go1.4/global/src/github.com/influxdb/influxdb/cmd/influxd/main.go:216
created by main.startProfiling
/Users/etourg/.gvm/pkgsets/go1.4/global/src/github.com/influxdb/influxdb/cmd/influxd/main.go:222 +0x2dc

So if anyone have any idea ..
Thanks


Reply to this email directly or view it on GitHub
#2024.

@shinji62
Copy link
Author

@otoolep I found the problem here : #2026

@otoolep
Copy link
Contributor

otoolep commented Mar 20, 2015

Will be fixed by #2039

@otoolep otoolep closed this as completed Mar 20, 2015
@shinji62
Copy link
Author

@otoolep Even if I understand your fix, is not a real fix in case of cross compiling, the problem is the os/user don't work when you cross compile, so saying "failed to determine current user for storage" is not true is more like the way how you determine is false. That's why I was using another library which is working even with cross compiling.

@corylanou
Copy link
Contributor

Determining a home directory is only intended for when the system is spun up without a config. It is only intended to spin up without a config for people to do a quick "test drive" of the system, or local development, not meant for production. Creating a config is very easy, and let's you specify exactly where the data directory should be.

So this is less about if we can/can't determine a user home directory, and really only trying to make a convenience for quickly evaluating the system. If you install from our packages, we give you a config to run with and this isn't a problem.

If someone were to push up a PR that solves this better without a third party library, and continues to leverage the convenience, I'm sure we would review and likely merge it in. In the meantime, specifying a config is the best route to solve the problem.

Thanks again for your attention on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants