spotify / ffwd

a flexible metric forwarding agent
https://spotify.github.io/ffwd/
Apache License 2.0
79 stars 33 forks source link

PubSub dependencies are broken #237

Closed hexedpackets closed 3 years ago

hexedpackets commented 3 years ago

Introduced by #228. That PR added gRPC dependencies that are probably conflicting with PubSub. The failure only happens when trying to authenticate to PubSub, so the tests using the emulator still pass.


08:58:16.151 [main] ERROR com.spotify.ffwd.FastForwardAgent - Uncaught exception in thread main, exiting (status = 2)
java.lang.RuntimeException: Failed during initialization
    at com.spotify.ffwd.AgentCore.<init>(AgentCore.java:115)
    at com.spotify.ffwd.AgentCore.<init>(AgentCore.java:91)
    at com.spotify.ffwd.AgentCore$Builder.build(AgentCore.java:467)
    at com.spotify.ffwd.FastForwardAgent.setup(FastForwardAgent.java:106)
    at com.spotify.ffwd.FastForwardAgent.main(FastForwardAgent.java:54)
Caused by: com.google.inject.CreationException: Unable to create injector, see the following errors:

1) Error in custom provider, java.lang.IncompatibleClassChangeError: class io.grpc.auth.GoogleAuthLibraryCallCredentials can not implement io.grpc.CallCredentials, because it is not an interface (io.grpc.CallCredentials is in unnamed module of loader 'app')
  at com.spotify.ffwd.pubsub.PubsubOutputPlugin$1.publisher(PubsubOutputPlugin.java:132) (via modules: com.spotify.ffwd.output.OutputManagerModule$1 -> com.spotify.ffwd.pubsub.PubsubOutputPlugin$1)
  while locating com.google.cloud.pubsub.v1.Publisher
    for field at com.spotify.ffwd.pubsub.PubsubPluginSink.publisher(PubsubPluginSink.java:59)
  while locating com.spotify.ffwd.pubsub.PubsubPluginSink
  at com.spotify.ffwd.pubsub.PubsubOutputPlugin$1.configure(PubsubOutputPlugin.java:189) (via modules: com.spotify.ffwd.output.OutputManagerModule$1 -> com.spotify.ffwd.pubsub.PubsubOutputPlugin$1)
  while locating com.spotify.ffwd.pubsub.PubsubPluginSink annotated with @com.google.inject.name.Named(value="pubsubSink")
  while locating com.spotify.ffwd.output.BatchablePluginSink annotated with @com.spotify.ffwd.output.BatchingDelegate()
    for field at com.spotify.ffwd.output.BatchingPluginSink.sink(BatchingPluginSink.java:56)
  at com.spotify.ffwd.output.OutputPlugin$1.configure(OutputPlugin.java:98) (via modules: com.spotify.ffwd.output.OutputManagerModule$1 -> com.spotify.ffwd.pubsub.PubsubOutputPlugin$1 -> com.spotify.ffwd.output.OutputPlugin$1)

1 error
    at com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:543)
    at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:178)
    at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:109)
    at com.google.inject.internal.InjectorImpl.createChildInjector(InjectorImpl.java:237)
    at com.spotify.ffwd.AgentCore.setupPrimaryInjector(AgentCore.java:374)
    at com.spotify.ffwd.AgentCore.<init>(AgentCore.java:113)
    ... 4 more
Caused by: java.lang.IncompatibleClassChangeError: class io.grpc.auth.GoogleAuthLibraryCallCredentials can not implement io.grpc.CallCredentials, because it is not an interface (io.grpc.CallCredentials is in unnamed module of loader 'app')
    at java.base/java.lang.ClassLoader.defineClass1(Native Method)
    at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)
    at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
    at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:800)
    at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:698)
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:621)
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:579)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
    at com.google.api.gax.grpc.GrpcCallContext.withCredentials(GrpcCallContext.java:126)
    at com.google.api.gax.grpc.GrpcCallContext.withCredentials(GrpcCallContext.java:64)
    at com.google.api.gax.rpc.ClientContext.create(ClientContext.java:159)
    at com.google.cloud.pubsub.v1.stub.GrpcPublisherStub.create(GrpcPublisherStub.java:161)
    at com.google.cloud.pubsub.v1.Publisher.<init>(Publisher.java:154)
    at com.google.cloud.pubsub.v1.Publisher.<init>(Publisher.java:83)
    at com.google.cloud.pubsub.v1.Publisher$Builder.build(Publisher.java:607)
    at com.spotify.ffwd.pubsub.PubsubOutputPlugin$1.publisher(PubsubOutputPlugin.java:157)
    at com.spotify.ffwd.pubsub.PubsubOutputPlugin$1$$FastClassByGuice$$5c879ecf.invoke(<generated>)
    at com.google.inject.internal.ProviderMethod$FastClassProviderMethod.doProvision(ProviderMethod.java:264)
    at com.google.inject.internal.ProviderMethod.doProvision(ProviderMethod.java:173)
    at com.google.inject.internal.InternalProviderInstanceBindingImpl$CyclicFactory.provision(InternalProviderInstanceBindingImpl.java:185)
    at com.google.inject.internal.InternalProviderInstanceBindingImpl$CyclicFactory.get(InternalProviderInstanceBindingImpl.java:162)
    at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
    at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:168)
    at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:39)
    at com.google.inject.internal.SingleFieldInjector.inject(SingleFieldInjector.java:52)
    at com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:147)
    at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:124)
    at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:91)
    at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:306)
    at com.google.inject.internal.FactoryProxy.get(FactoryProxy.java:62)
    at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
    at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:168)
    at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:39)
    at com.google.inject.internal.FactoryProxy.get(FactoryProxy.java:62)
    at com.google.inject.internal.SingleFieldInjector.inject(SingleFieldInjector.java:52)
    at com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:147)
    at com.google.inject.internal.MembersInjectorImpl.injectAndNotify(MembersInjectorImpl.java:101)
    at com.google.inject.internal.Initializer$InjectableReference.get(Initializer.java:245)
    at com.google.inject.internal.Initializer.injectAll(Initializer.java:140)
    at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:176)
    ... 8 more```
hexedpackets commented 3 years ago

A new exception is still happening. Oddly it only happens with packaged JARs and not when running in eg intellij.

java.lang.IllegalStateException: Could not find policy 'pick_first'. Make sure its implementation is either registered to LoadBalancerRegistry or included in META-INF/services/io.grpc.LoadBalancerProvider from your jar files.
        at io.grpc.internal.AutoConfiguredLoadBalancerFactory$AutoConfiguredLoadBalancer.<init>(AutoConfiguredLoadBalancerFactory.java:92)
        at io.grpc.internal.AutoConfiguredLoadBalancerFactory.newLoadBalancer(AutoConfiguredLoadBalancerFactory.java:63)
        at io.grpc.internal.ManagedChannelImpl.exitIdleMode(ManagedChannelImpl.java:395)
        at io.grpc.internal.ManagedChannelImpl$RealChannel$2.run(ManagedChannelImpl.java:943)
        at io.grpc.SynchronizationContext.drain(SynchronizationContext.java:95)
        at io.grpc.SynchronizationContext.execute(SynchronizationContext.java:127)
        at io.grpc.internal.ManagedChannelImpl$RealChannel.newCall(ManagedChannelImpl.java:940)
        at com.google.api.gax.grpc.GrpcChannelUUIDInterceptor.interceptCall(GrpcChannelUUIDInterceptor.java:52)
        at io.grpc.ClientInterceptors$InterceptorChannel.newCall(ClientInterceptors.java:156)
        at com.google.api.gax.grpc.GrpcHeaderInterceptor.interceptCall(GrpcHeaderInterceptor.java:80)
        at io.grpc.ClientInterceptors$InterceptorChannel.newCall(ClientInterceptors.java:156)
        at com.google.api.gax.grpc.GrpcMetadataHandlerInterceptor.interceptCall(GrpcMetadataHandlerInterceptor.java:55)
        at io.grpc.ClientInterceptors$InterceptorChannel.newCall(ClientInterceptors.java:156)
        at io.grpc.internal.ManagedChannelImpl.newCall(ManagedChannelImpl.java:882)
        at io.grpc.internal.ForwardingManagedChannel.newCall(ForwardingManagedChannel.java:63)
        at com.google.api.gax.grpc.ChannelPool.newCall(ChannelPool.java:143)
        at com.google.api.gax.grpc.GrpcClientCalls.newCall(GrpcClientCalls.java:90)
        at com.google.api.gax.grpc.GrpcDirectCallable.futureCall(GrpcDirectCallable.java:58)
        at com.google.api.gax.grpc.GrpcUnaryRequestParamCallable.futureCall(GrpcUnaryRequestParamCallable.java:65)
        at com.google.api.gax.grpc.GrpcExceptionCallable.futureCall(GrpcExceptionCallable.java:64)
        at com.google.api.gax.rpc.AttemptCallable.call(AttemptCallable.java:86)
        at com.google.api.gax.rpc.RetryingCallable.futureCall(RetryingCallable.java:63)
        at com.google.api.gax.rpc.RetryingCallable.futureCall(RetryingCallable.java:41)
        at com.google.api.gax.tracing.TracedUnaryCallable.futureCall(TracedUnaryCallable.java:75)
        at com.google.api.gax.rpc.UnaryCallable$1.futureCall(UnaryCallable.java:126)
        at com.google.api.gax.rpc.UnaryCallable.futureCall(UnaryCallable.java:87)
        at com.google.api.gax.rpc.UnaryCallable.call(UnaryCallable.java:112)
        at com.google.cloud.pubsub.v1.TopicAdminClient.getTopic(TopicAdminClient.java:567)
        at com.google.cloud.pubsub.v1.TopicAdminClient.getTopic(TopicAdminClient.java:544)
        at com.spotify.ffwd.pubsub.PubsubPluginSink.start(PubsubPluginSink.java:150)
        at com.spotify.ffwd.output.BatchingPluginSink.start(BatchingPluginSink.java:201)
        at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
        at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1655)
        at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
        at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
        at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
        at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578)
        at com.spotify.ffwd.output.CoreOutputManager.start(CoreOutputManager.java:292)
        at com.spotify.ffwd.AgentCore.start(AgentCore.java:171)
        at com.spotify.ffwd.AgentCore.run(AgentCore.java:121)
        at com.spotify.ffwd.FastForwardAgent.run(FastForwardAgent.java:113)
        at com.spotify.ffwd.FastForwardAgent.main(FastForwardAgent.java:56)