lightbend / reactive-cli

https://developer.lightbend.com/docs/lightbend-orchestration/current/
Apache License 2.0
23 stars 16 forks source link

Mac throwing exception after brew install - revisited #180

Closed valdemon closed 5 years ago

valdemon commented 6 years ago

Seems the same as #166 .

Called with sudo once, as suggested in https://github.com/lightbend/reactive-cli/issues/166#issuecomment-411891944 - hasn't helped though.

macOS Sierra, v. 10.12.6

uname -a
Darwin xxxxxxx 16.7.0 Darwin Kernel Version 16.7.0: Wed Oct 10 20:06:00 PDT 2018; root:xnu-3789.73.24~1/RELEASE_X86_64 x86_64
➜  ~  brew install lightbend/tools/reactive-cli
➜  ~  sudo rp version
Password:
rp (Reactive CLI) 1.3.1
jq support: Available
➜  ~  rp version     
java.io.IOException
    at java.lang.Throwable.fillInStackTrace(Unknown Source)
    at java.lang.Throwable.init(Unknown Source)
    at java.lang.Exception.init(Unknown Source)
    at java.io.IOException.init(Unknown Source)
    at java.io.IOException.init(Unknown Source)
    at scala.scalanative.nio.fs.NativePosixFileAttributeView.scala$scalanative$nio$fs$NativePosixFileAttributeView$$getGroup(Unknown Source)
    at scala.scalanative.nio.fs.NativePosixFileAttributeView$$anon$2.scala$scalanative$nio$fs$NativePosixFileAttributeView$$anon$$fileGroup(Unknown Source)
    at scala.scalanative.nio.fs.NativePosixFileAttributeView$$anon$2$$anon$1$$anonfun$1.apply(Unknown Source)
    at scala.scalanative.nio.fs.NativePosixFileAttributeView$$anon$2$$anon$1$$anonfun$1.apply(Unknown Source)
    at scala.scalanative.native.Zone$.apply(Unknown Source)
    at scala.scalanative.nio.fs.NativePosixFileAttributeView$$anon$2$$anon$1.init(Unknown Source)
    at scala.scalanative.nio.fs.NativePosixFileAttributeView$$anon$2.group(Unknown Source)
    at scala.scalanative.nio.fs.NativePosixFileAttributeView.asMap(Unknown Source)
    at scala.scalanative.nio.fs.NativePosixFileAttributeView.asMap(Unknown Source)
    at java.nio.file.attribute.FileAttributeView$class.getAttribute(Unknown Source)
    at scala.scalanative.nio.fs.NativePosixFileAttributeView.getAttribute(Unknown Source)
    at java.nio.file.Files$.getAttribute(Unknown Source)
    at java.nio.file.Files$.size(Unknown Source)
    at java.nio.file.Files$.readAllBytes(Unknown Source)
    at com.lightbend.rp.reactivecli.Platform$.readFile(Unknown Source)
    at com.lightbend.rp.reactivecli.files.package$.readFile(Unknown Source)
    at com.lightbend.rp.reactivecli.process.NativeProcess$$anonfun$exec$1$$anonfun$apply$1.apply(Unknown Source)
    at com.lightbend.rp.reactivecli.process.NativeProcess$$anonfun$exec$1$$anonfun$apply$1.apply(Unknown Source)
    at scala.scalanative.native.Zone$.apply(Unknown Source)
    at com.lightbend.rp.reactivecli.process.NativeProcess$$anonfun$exec$1.apply(Unknown Source)
    at com.lightbend.rp.reactivecli.process.NativeProcess$$anonfun$exec$1.apply(Unknown Source)
    at com.lightbend.rp.reactivecli.Platform$.withTempFile(Unknown Source)
    at com.lightbend.rp.reactivecli.files.package$.withTempFile(Unknown Source)
    at com.lightbend.rp.reactivecli.process.NativeProcess$.exec(Unknown Source)
    at com.lightbend.rp.reactivecli.Platform$.processExec(Unknown Source)
    at com.lightbend.rp.reactivecli.process.package$.exec(Unknown Source)
    at com.lightbend.rp.reactivecli.process.kubectl$.apiVersions$lzycompute(Unknown Source)
    at com.lightbend.rp.reactivecli.process.kubectl$.findApi(Unknown Source)
    at com.lightbend.rp.reactivecli.argparse.kubernetes.KubernetesArgs$.DefaultIngressApiVersion$lzycompute(Unknown Source)
    at com.lightbend.rp.reactivecli.argparse.kubernetes.KubernetesArgs$.DefaultIngressApiVersion(Unknown Source)
    at com.lightbend.rp.reactivecli.argparse.InputArgs$$anon$1.init(Unknown Source)
    at com.lightbend.rp.reactivecli.argparse.InputArgs$.parser(Unknown Source)
    at com.lightbend.rp.reactivecli.Main$.init(Unknown Source)
    at com.lightbend.rp.reactivecli.Main$.load(Unknown Source)
    at <none>.main(Unknown Source)
TimMoore commented 6 years ago

Have you also installed the Kubernetes CLI via Homebrew?

Have you changed your TMPDIR environment variable? The code that is failing is trying to read a temporary file, and it looks like it's having a permission problem.

Does TMPDIR=/tmp rp version work?

valdemon commented 6 years ago

Hi @TimMoore,

TimMoore commented 6 years ago

@valdemon catching the error and wrapping it with a more descriptive one is a good idea. I'd like to understand what's causing it better, so that it can provide a useful message.

I agree that overriding TMPDIR is not a great solution. I only suggested it as a debugging aid.

It looks like your user account doesn't have permissions to read the file from $TMPDIR. Can you help troubleshoot why? Is your user account an administrator account or a standard account? What's the full output of ls -ld $TMPDIR? Here's mine (where my username is tmoore, and I'm running macOS Mojave):

[13:23:01] ~ $ ls -ld $TMPDIR
drwx------@ 155 tmoore  staff  4960 26 Nov 13:11 /var/folders/2l/q3hcf61d60536v6jm0tlmh800000gn/T/

The permissions look similar (actually more restrictive), but the directory is owned by my user account. What about on your machine?

TimMoore commented 6 years ago

There's this related discussion thread as well https://discuss.lightbend.com/t/reactive-cli-on-mac-throwing-exception/1744/3

TimMoore commented 5 years ago

Lightbend Orchestration is no longer actively developed and will reach its End of Life on April 15, 2020.

We recommend Migrating to the Improved Kubernetes Deployment Experience.