前提・実現したいこと
embulk の embulk-input-google_analytics で GAのデータを取り込みたい
実行コマンド: ./.sh
json_key_content にサービスアカウントの JSON をそのまま記載すると意図した通りに動きますが、環境変数を指定すると Error: org.jruby.proxy.org.embulk.config.ConfigException$Proxy1: json_key_content is not a valid JSON object
とエラーになります。
発生している問題・エラーメッセージ
org.embulk.exec.PartialExecutionException: org.jruby.proxy.org.embulk.config.ConfigException$Proxy1: json_key_content is not a valid JSON object at org.embulk.exec.BulkLoader$LoaderState.buildPartialExecuteException(BulkLoader.java:340) at org.embulk.exec.BulkLoader.doRun(BulkLoader.java:566) at org.embulk.exec.BulkLoader.access$000(BulkLoader.java:35) at org.embulk.exec.BulkLoader$1.run(BulkLoader.java:353) at org.embulk.exec.BulkLoader$1.run(BulkLoader.java:350) at org.embulk.spi.Exec.doWith(Exec.java:22) at org.embulk.exec.BulkLoader.run(BulkLoader.java:350) at org.embulk.EmbulkEmbed.run(EmbulkEmbed.java:205) at org.embulk.EmbulkRunner.runInternal(EmbulkRunner.java:292) at org.embulk.EmbulkRunner.run(EmbulkRunner.java:156) at org.embulk.cli.EmbulkRun.runSubcommand(EmbulkRun.java:433) at org.embulk.cli.EmbulkRun.run(EmbulkRun.java:90) at org.embulk.cli.Main.main(Main.java:64) Suppressed: java.lang.NullPointerException at org.embulk.exec.BulkLoader.doCleanup(BulkLoader.java:463) at org.embulk.exec.BulkLoader$3.run(BulkLoader.java:397) at org.embulk.exec.BulkLoader$3.run(BulkLoader.java:394) at org.embulk.spi.Exec.doWith(Exec.java:22) at org.embulk.exec.BulkLoader.cleanup(BulkLoader.java:394) at org.embulk.EmbulkEmbed.run(EmbulkEmbed.java:208) ... 5 more Caused by: org.jruby.proxy.org.embulk.config.ConfigException$Proxy1: json_key_content is not a valid JSON object at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at org.jruby.javasupport.proxy.JavaProxyConstructor.newInstanceImpl(JavaProxyConstructor.java:119) at org.jruby.javasupport.proxy.JavaProxyConstructor.newInstance(JavaProxyConstructor.java:205) at org.jruby.javasupport.Java$JCreateMethod.call(Java.java:618) at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:200) at org.jruby.internal.runtime.methods.JavaMethod$JavaMethodN.call(JavaMethod.java:739) at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:278) at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:79) at org.jruby.java.proxies.ConcreteJavaProxy$InitializeMethod.call(ConcreteJavaProxy.java:48) at org.jruby.ir.runtime.IRRuntimeHelpers.instanceSuper(IRRuntimeHelpers.java:984) at org.jruby.ir.instructions.InstanceSuperInstr.interpret(InstanceSuperInstr.java:69) at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:360) at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:74) at org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:84) at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:179) at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:165) at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:328) at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:165) at org.jruby.RubyClass.newInstance(RubyClass.java:1001) at org.jruby.RubyClass$INVOKER$i$newInstance.call(RubyClass$INVOKER$i$newInstance.gen) at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:200) at org.jruby.java.proxies.ConcreteJavaProxy$NewMethod.call(ConcreteJavaProxy.java:158) at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:318) at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:155) at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:315) at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:74) at org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:84) at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:179) at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:165) at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:328) at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:165) at org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:170) at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:336) at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:74) at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:109) at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:95) at Embulk$$InputPlugin$$JavaAdapter_160637524.transaction(Embulk$$InputPlugin$$JavaAdapter_160637524.gen:13) at org.embulk.exec.BulkLoader.doRun(BulkLoader.java:507) ... 11 more Error: org.jruby.proxy.org.embulk.config.ConfigException$Proxy1: json_key_content is not a valid JSON object
該当のソースコード
ga_test.sh
shellスクリプト
1export GOOGLE_API_JSON=`cat ./service_account.json` 2embulk run ./vt_ga_test.yml.liquid
vt_ga_test.yml.liquid
embulk
1in: 2 type: google_analytics 3 auth_method: service_account 4 json_key_content: {{ env.GOOGLE_API_JSON }} 5 view_id: XXX 6 time_series: "ga:dateHour" # hourly basis 7 dimensions: 8 - "ga:userType" 9 metrics: 10 - "ga:totalEvents" 11 start_date: "2020-06-10" 12 end_date: "2020-06-10" 13out: {type: stdout}
試したこと
ここに問題に対して試したことを記載してください。
補足情報(FW/ツールのバージョンなど)
ここにより詳細な情報を記載してください。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2020/06/18 22:42