Skip to content

Address types of NameResolver 'unix' for '...' not supported by transport exception in Fat Jar #10853

@ModAlpha

Description

@ModAlpha

I have ktor server app and I'm using gradle as build tool and using this dependency for gRPC
implementation("io.grpc:grpc-netty-shaded:1.61.0")
on my mac M1 and jdk 17 and gradle 8.5.0
and I'm connecting to another service via gRPC

 private fun connect() {
        val host = config.property("mainService.host").getString()
        val port = config.property("mainService.port").getString()

        val channel = ManagedChannelBuilder.forAddress(host, port.toInt()).usePlaintext().build()
        stub = InvoiceInternalServiceGrpcKt.InvoiceInternalServiceCoroutineStub(channel)
    }

when running the app via IntelliJ IDEA all fine but when running the app via fat jar this exception occur

java.lang.IllegalArgumentException: Address types of NameResolver 'unix' for '...' not supported by transport
        at io.grpc.internal.ManagedChannelImpl.getNameResolver(ManagedChannelImpl.java:750)
        at io.grpc.internal.ManagedChannelImpl.getNameResolver(ManagedChannelImpl.java:771)
        at io.grpc.internal.ManagedChannelImpl.<init>(ManagedChannelImpl.java:635)
        at io.grpc.internal.ManagedChannelImplBuilder.build(ManagedChannelImplBuilder.java:662)
        at io.grpc.ForwardingChannelBuilder2.build(ForwardingChannelBuilder2.java:254)
        at ai.pedant.infrastructure.services.DocumentService.connect(DocumentService.kt:83)
        at ai.pedant.infrastructure.services.DocumentService.<init>(DocumentService.kt:24)
        at ai.pedant.di.ServiceModuleKt$serviceModule$1$3.invoke(ServiceModule.kt:14)
        at ai.pedant.di.ServiceModuleKt$serviceModule$1$3.invoke(ServiceModule.kt:14)
        at org.koin.core.instance.InstanceFactory.create(InstanceFactory.kt:51)
        at org.koin.core.instance.SingleInstanceFactory.create(SingleInstanceFactory.kt:46)
        at org.koin.core.instance.SingleInstanceFactory$get$1.invoke(SingleInstanceFactory.kt:53)
        at org.koin.core.instance.SingleInstanceFactory$get$1.invoke(SingleInstanceFactory.kt:51)
        at org.koin.mp.KoinPlatformTools.synchronized(KoinPlatformTools.kt:20)
        at org.koin.core.instance.SingleInstanceFactory.get(SingleInstanceFactory.kt:51)
        at org.koin.core.registry.InstanceRegistry.resolveInstance$koin_core(InstanceRegistry.kt:116)
        at org.koin.core.scope.Scope.resolveValue(Scope.kt:246)
        at org.koin.core.scope.Scope.resolveInstance(Scope.kt:231)
        at org.koin.core.scope.Scope.get(Scope.kt:210)
        at ai.pedant.di.ServiceModuleKt$serviceModule$1$1.invoke(ServiceModule.kt:21)
        at ai.pedant.di.ServiceModuleKt$serviceModule$1$1.invoke(ServiceModule.kt:12)
        at org.koin.core.instance.InstanceFactory.create(InstanceFactory.kt:51)
        at org.koin.core.instance.SingleInstanceFactory.create(SingleInstanceFactory.kt:46)
        at org.koin.core.instance.SingleInstanceFactory$get$1.invoke(SingleInstanceFactory.kt:53)
        at org.koin.core.instance.SingleInstanceFactory$get$1.invoke(SingleInstanceFactory.kt:51)
        at org.koin.mp.KoinPlatformTools.synchronized(KoinPlatformTools.kt:20)
        at org.koin.core.instance.SingleInstanceFactory.get(SingleInstanceFactory.kt:51)
        at org.koin.core.registry.InstanceRegistry.resolveInstance$koin_core(InstanceRegistry.kt:116)
        at org.koin.core.scope.Scope.resolveValue(Scope.kt:246)
        at org.koin.core.scope.Scope.resolveInstance(Scope.kt:231)
        at org.koin.core.scope.Scope.get(Scope.kt:210)
        at ai.pedant.di.GrpcContollerModuleKt$grpcControllerModule$1$1.invoke(GrpcContollerModule.kt:19)
        at ai.pedant.di.GrpcContollerModuleKt$grpcControllerModule$1$1.invoke(GrpcContollerModule.kt:10)
        at org.koin.core.instance.InstanceFactory.create(InstanceFactory.kt:51)
        at org.koin.core.instance.SingleInstanceFactory.create(SingleInstanceFactory.kt:46)
        at org.koin.core.instance.SingleInstanceFactory$get$1.invoke(SingleInstanceFactory.kt:53)
        at org.koin.core.instance.SingleInstanceFactory$get$1.invoke(SingleInstanceFactory.kt:51)
        at org.koin.mp.KoinPlatformTools.synchronized(KoinPlatformTools.kt:20)
        at org.koin.core.instance.SingleInstanceFactory.get(SingleInstanceFactory.kt:51)
        at org.koin.core.registry.InstanceRegistry.resolveInstance$koin_core(InstanceRegistry.kt:116)
        at org.koin.core.scope.Scope.resolveValue(Scope.kt:246)
        at org.koin.core.scope.Scope.resolveInstance(Scope.kt:231)
        at org.koin.core.scope.Scope.get(Scope.kt:210)
        at ai.pedant.GrpcServer$special$$inlined$inject$default$2.invoke(KoinComponent.kt:74)
        at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
        at ai.pedant.GrpcServer.get_vendorWebController(GrpcServer.kt:19)
        at ai.pedant.GrpcServer.<init>(GrpcServer.kt:31)
        at ai.pedant.ApplicationKt.startGrpcServer(Application.kt:48)
        at ai.pedant.ApplicationKt.access$startGrpcServer(Application.kt:1)
        at ai.pedant.ApplicationKt$module$2.invokeSuspend(Application.kt:42)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions