11

Getting following error when trying to run hbase shell in OSX(version: 10.11.4):

warning: -J-Dfile.encoding=UTF-8 argument ignored (launched in same VM?)

warning: -J-XX:MaxPermSize=1024m argument ignored (launched in same VM?)

warning: -J-Xmx4096m argument ignored (launched in same VM?)

TypeError: can't convert Pathname into String require at org/jruby/RubyKernel.java:1071

require at file:/usr/local/Cellar/hbase/1.2.6/libexec/lib/jruby-complete-1.6.8.jar!/META INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36

(root) at /usr/local/Cellar/hbase/1.2.6/libexec/bin/hirb.rb:118

I installed the Hbase with brew by : brew install hbase

As given in the solution here, I also trying set PATH variables like following:

➜  ~ export HBASE_HOME=/usr/local/Cellar/hbase/1.2.6/libexec
➜  ~ export PATH=$HBASE_HOME/bin:$PATH

I also have jruby-complete-1.6.8.jar in $HBASE_HOME/lib, as stated here. But still the same error continues.

Edit 1

➜ rvm list:

rvm rubies

   ruby-2.1.2 [ x86_64 ]
   ruby-2.2.0 [ x86_64 ]
=* ruby-2.2.2 [ x86_64 ]

# => - current
# =* - current && default
#  * - default


➜  ruby -v
ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin15]


➜  which ruby
/usr/bin/ruby

Guessing that something is wrong in rvm, I uninstalled it via: rvm remove and rvm uninstall. But still the error persists.

Edit 2

➜  brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry and just ignore them. Thanks!

Warning: You have unlinked kegs in your Cellar
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
  mongodb@2.6

Warning: Your Xcode (7.3.1) is outdated.
Please update to Xcode 8.2.1 (or delete it).
Xcode can be updated from the App Store.


Warning: Some installed formula are missing dependencies.
You should `brew install` the missing dependencies:
  brew install erlang@19

Run `brew missing` for more details.

➜  brew missing
rabbitmq: erlang@19

Edit 3

What I figured out is I am able to run HBASE as a root user, so if I do following:

> Sudo su
root> export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home
root> hbase shell
       ......It works......

So it seems, it is some permission issue, due to which not able to run normally.

Community
  • 1
  • 1
Saurabh
  • 71,488
  • 40
  • 181
  • 244
  • what's your ruby version? What's the output of `brew doctor`? – Thomas Ayoub Jul 28 '17 at 14:43
  • @ThomasAyoub Updated in the question. – Saurabh Jul 28 '17 at 16:45
  • Have you installed developer tools? What happens when you open Xcode? I also think upgrading xcode and reinstalling developer tools may help – Dbz Jul 31 '17 at 23:25
  • @Dbz XCode: 7.3.1 (7D1014) is installed and it opens normally. Haven't tried reinstalling developer tools, but those are earlier installed. Also see my latest edit in the question. – Saurabh Aug 01 '17 at 10:20
  • On OSX `10.12`, I was able to `brew install hbase`, made sure the links were set up with `brew link --overwrite hbase` and with no other changes, I was able to boot `hbase shell`. Java is `Java(TM) SE Runtime Environment (build 1.7.0_79-b15)`. I did not set `HBASE_HOME` and I did not edit the path. – WattsInABox Aug 01 '17 at 14:26
  • If hbase comes with jruby, then I'm going to guess that it requires jruby and will not work with your rvm-installed version of Ruby. This makes even more sense that it works as root -- if you run something as root, it won't know anything about your rvm installation or your installed rubies. – anothermh Aug 01 '17 at 19:12
  • I have RVM installed on my machine, my default ruby is not jruby, and hbase shell works fine so I don't think that's it, @anothermh – WattsInABox Aug 03 '17 at 14:21

1 Answers1

1

Have you tried using Oracle's JDK and installation from Apache page?

http://ftp.ps.pl/pub/apache/hbase/1.3.1/hbase-1.3.1-bin.tar.gz

It works perfectly fine in my case

> ./start-hbase.sh
starting master, logging to $HOME/..../hbase-1.3.1/bin/../logs/hbase-michalo-master-pi.local.out
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=128m; support was removed in 8.0
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0

And, in another shell

> ./hbase shell
WARN  [main] util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
HBase Shell; enter 'help<RETURN>' for list of supported commands.
Type "exit<RETURN>" to leave the HBase Shell
Version 1.3.1, r930b9a55528fe45d8edce7af42fef2d35e77677a, Thu Apr  6 19:36:54 PDT 2017

hbase(main):001:0>
Oo.oO
  • 12,464
  • 3
  • 23
  • 45