{"record":{"id":"68f63121ec7cd8e2","repo":"pinpoint-apm/pinpoint","slug":"remoteaddress-is-null","errorCode":null,"errorMessage":"RemoteAddress is null","messagePattern":"RemoteAddress is null","errorType":"exception","errorClass":"StatusRuntimeException","httpStatus":null,"severity":"error","filePath":"collector/src/main/java/com/navercorp/pinpoint/collector/receiver/grpc/PermissionServerTransportFilter.java","lineNumber":54,"sourceCode":"\n    private final String debugString;\n    private final AddressFilter addressFilter;\n\n    public PermissionServerTransportFilter(String debugString, final AddressFilter addressFilter) {\n        this.debugString = Objects.requireNonNull(debugString, \"debugString\");\n        this.addressFilter = Objects.requireNonNull(addressFilter, \"addressFilter\");\n    }\n\n    @Override\n    public Attributes transportReady(final Attributes attributes) {\n        if (logger.isDebugEnabled()) {\n            logger.debug(\"Ready attributes={}\", attributes);\n        }\n\n        final InetSocketAddress remoteSocketAddress = (InetSocketAddress) attributes.get(Grpc.TRANSPORT_ATTR_REMOTE_ADDR);\n        if (remoteSocketAddress == null) {\n            // Unauthenticated\n            logger.warn(\"Unauthenticated transport. TRANSPORT_ATTR_REMOTE_ADDR must not be null\");\n            throw Status.INTERNAL.withDescription(\"RemoteAddress is null\").asRuntimeException();\n        }\n\n        final InetAddress inetAddress = remoteSocketAddress.getAddress();\n        if (addressFilter.accept(inetAddress)) {\n            return attributes;\n        }\n\n        // Permission denied\n        logger.debug(\"Permission denied transport.\");\n        throw Status.PERMISSION_DENIED.withDescription(\"invalid IP\").asRuntimeException();\n    }\n\n    @Override\n    public void transportTerminated(Attributes transportAttrs) {\n        if (logger.isDebugEnabled()) {\n            logger.debug(\"Terminated attributes={}\", transportAttrs);\n        }","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/collector/src/main/java/com/navercorp/pinpoint/collector/receiver/grpc/PermissionServerTransportFilter.java#L36-L72","documentation":"PermissionServerTransportFilter.transportReady inspects the gRPC transport-ready attributes for TRANSPORT_ATTR_REMOTE_ADDR to build the client's InetAddress for address filtering. If the remote address attribute is null, the transport cannot be evaluated, so it throws a gRPC Status.INTERNAL runtime exception ('RemoteAddress is null') to reject the connection as unauthenticated.","triggerScenarios":"A gRPC transport completes ready-handshake without a REMOTE_ADDR attribute in the attributes map — i.e., (InetSocketAddress) attributes.get(Grpc.TRANSPORT_ATTR_REMOTE_ADDR) returns null — such as via in-process transports, proxies, or unusual channel setups that don't populate remote address.","commonSituations":"Clients connecting through an intermediary that suppresses transport attributes; tests or in-process server stubs (e.g., InProcessServer) that lack a real socket address; misconfigured gRPC/Netty versions where the attribute is not set; health-probe or unix-socket style connections.","solutions":["Connect from a real network socket so gRPC populates TRANSPORT_ATTR_REMOTE_ADDR","If using InProcessServer/InProcessChannel for tests, configure the address filter to bypass or provide remote-address attributes","Check gRPC/Netty version compatibility where transport attributes may be missing","Verify no proxy/interceptor chain strips the transport attributes before this filter"],"exampleFix":"// before (test setup using in-process transport against an address-filtered server)\nServer server = InProcessServerBuilder.forName(\"pinpoint\").addService(service).build().start();\n// after (use a real socket transport, or exempt tests from the filter)\nServer server = NettyServerBuilder.forPort(9991).addService(service).build().start();","handlingStrategy":"try-catch","validationCode":"// Client side: ensure a real socket transport is used, not in-process, when the collector filters by address\nif (channel instanceof InProcessChannel) {\n    throw new IllegalStateException(\"Address-filtered collector requires a real network transport\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    stub.sendSpan(request);\n} catch (StatusRuntimeException e) {\n    if (e.getStatus().getCode() == Status.Code.INTERNAL && e.getMessage().contains(\"RemoteAddress is null\")) {\n        logger.error(\"Collector could not determine client address; use a real socket transport\");\n    }\n    throw e;\n}","preventionTips":["Use Netty socket transports (not InProcess) against address-filtered collectors","Keep gRPC and Netty versions aligned so transport attributes are populated","Avoid intermediaries that hide the client socket address","Cover connection setup in integration tests against the same filter configuration"],"tags":["grpc","network","collector","connection"],"backgroundTag":"null-argument","analyzedSha":"744c3d3075e595656abb1ae331ad2c0e4c9eb996","analyzedAt":"2026-09-07T18:48:45.289Z","contentChangedAt":"2026-09-07T18:48:45.289Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}