LoginSignup
0
0

More than 5 years have passed since last update.

embulk gem install で flock unsupported or native support failed to load でエラーになる

Last updated at Posted at 2018-06-20

現象

Raspbian の環境で、digdag + embulk を利用していて、プラグインをインストールしようとしたら
flock unsupported or native support failed to load でエラーになってしまう

環境

Raspberry Pi 3(Raspbian 9.3)
Digdag v0.9.26
embulk v0.9.7
java 1.8.0_171

解決方法

ARM Linux用 JFFI をビルドしてコピーする
ant のインストール必要。

$ sudo apt-get install ant

$ sudo apt-get install build-essential
$ git clone https://github.com/jnr/jffi.git
$ cd jffi
$ ant jar

$ cd build/jni
$ sudo cp libjffi-1.2.so /usr/lib

解決に至るまで

flock unsupported or native support failed to load でググった結果
まったく同じ症状にたどり着く
https://github.com/jruby/jruby/issues/3699

直接的な解決方法がよくわからなかったが、まずは
-Xnative.verbose=true オプションをつけてデバッグすることにした
bash_profile に以下を追記して、source ~/.bash_profile

bash_profile
export _JAVA_OPTIONS="-Djruby.native.verbose=true"

再度 embulk gem install xxxx を試みると、以下のエラーが吐き出された

Failed to load native POSIX impl; falling back on Java impl. Stacktrace follows.
java.lang.UnsatisfiedLinkError: could not load FFI provider jnr.ffi.provider.jffi.Provider

...

Caused by: java.lang.IllegalStateException: Can't overwrite cause with java.lang.UnsatisfiedLinkError: java.lang.UnsatisfiedLinkError: /tmp/jffi7667517909278970909.so: /tmp/jffi7667517909278970909.so: 共有オブジェクトファイルを開けません: そのようなファイルやディレクトリはありません

最終的にここに誘導されるが、具体的な解決策が理解できなかった。
https://github.com/jruby/jruby/wiki/Native-Libraries

Raspbian が 32bit なので LD_LIBRARY_PATH をなにかする必要があるのか?とか
tmp の場所を変えてみたりとか -Djava.io.tmpdir=/home/pi/tmp
いろいろ回り道して最終的に、解決にたどり着いたのがここ。

https://github.com/spotify/docker-client/issues/477
jnr.ffi.provider.jffi.Provider raspbian でググった。

途中諦めかけたけど、なんとか解決できてよかった。半日かかってしまった。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0