I need help understanding the root cause of a Java...
# replication-troubleshooting
b
I need help understanding the root cause of a Java null pointer exception in testing connections. It happens when I create sources for BigQuery, Snowflake, and Clickhouse - so it’s something that happens independent of source type. I have multiple AirByte instances running on separate EKS clusters, all installed via helm. This error is only happening on one of them! There’s obviously something different about the configuration of the one that’s failing, but how can I find out what that is? Starting thread…
When I setup any source, AirByte tests the source and shows an error. The connection error log shows what I believe is the location of the log in the minio pod. Opening a shell to the minio pod, I found this in the log:
Copy code
2023-03-03 19:56:21 ERROR i.a.w.g.DefaultCheckConnectionWorker(run):105 - Unexpected error while checking connection: 
java.lang.NullPointerException: null
        at java.io.Reader.<init>(Reader.java:168) ~[?:?]
        at java.io.InputStreamReader.<init>(InputStreamReader.java:124) ~[?:?]
        at io.airbyte.commons.io.IOs.newBufferedReader(IOs.java:120) ~[io.airbyte-airbyte-commons-0.40.23.jar:?]
        at io.airbyte.commons.io.LineGobbler.<init>(LineGobbler.java:99) ~[io.airbyte-airbyte-commons-0.40.23.jar:?]
        at io.airbyte.commons.io.LineGobbler.gobble(LineGobbler.java:67) ~[io.airbyte-airbyte-commons-0.40.23.jar:?]
        at io.airbyte.commons.io.LineGobbler.gobble(LineGobbler.java:28) ~[io.airbyte-airbyte-commons-0.40.23.jar:?]
        at io.airbyte.workers.general.DefaultCheckConnectionWorker.run(DefaultCheckConnectionWorker.java:71) ~[io.airbyte-airbyte-commons-worker-0.40.23.jar:?]
        at io.airbyte.workers.general.DefaultCheckConnectionWorker.run(DefaultCheckConnectionWorker.java:41) ~[io.airbyte-airbyte-commons-worker-0.40.23.jar:?]
        at io.airbyte.workers.temporal.TemporalAttemptExecution.lambda$getWorkerThread$5(TemporalAttemptExecution.java:195) ~[io.airbyte-airbyte-workers-0.40.23.jar:?]
        at java.lang.Thread.run(Thread.java:1589) ~[?:?]
2023-03-03 19:56:21 INFO i.a.w.t.TemporalAttemptExecution(lambda$getWorkerThread$5):198 - Completing future exceptionally...
io.airbyte.workers.exception.WorkerException: Unexpected error while getting checking connection.
        at io.airbyte.workers.general.DefaultCheckConnectionWorker.run(DefaultCheckConnectionWorker.java:106) ~[io.airbyte-airbyte-commons-worker-0.40.23.jar:?]
        at io.airbyte.workers.general.DefaultCheckConnectionWorker.run(DefaultCheckConnectionWorker.java:41) ~[io.airbyte-airbyte-commons-worker-0.40.23.jar:?]
        at io.airbyte.workers.temporal.TemporalAttemptExecution.lambda$getWorkerThread$5(TemporalAttemptExecution.java:195) ~[io.airbyte-airbyte-workers-0.40.23.jar:?]
        at java.lang.Thread.run(Thread.java:1589) ~[?:?]
Caused by: java.lang.NullPointerException
        at java.io.Reader.<init>(Reader.java:168) ~[?:?]
        at java.io.InputStreamReader.<init>(InputStreamReader.java:124) ~[?:?]
        at io.airbyte.commons.io.IOs.newBufferedReader(IOs.java:120) ~[io.airbyte-airbyte-commons-0.40.23.jar:?]
        at io.airbyte.commons.io.LineGobbler.<init>(LineGobbler.java:99) ~[io.airbyte-airbyte-commons-0.40.23.jar:?]
        at io.airbyte.commons.io.LineGobbler.gobble(LineGobbler.java:67) ~[io.airbyte-airbyte-commons-0.40.23.jar:?]
        at io.airbyte.commons.io.LineGobbler.gobble(LineGobbler.java:28) ~[io.airbyte-airbyte-commons-0.40.23.jar:?]
        at io.airbyte.workers.general.DefaultCheckConnectionWorker.run(DefaultCheckConnectionWorker.java:71) ~[io.airbyte-airbyte-commons-worker-0.40.23.jar:?]
        ... 3 more
2023-03-03 19:56:21 INFO i.a.w.t.TemporalAttemptExecution(get):163 - Stopping cancellation check scheduling...
2023-03-03 19:56:21 WARN i.t.i.a.ActivityTaskExecutors$BaseActivityTaskExecutor(execute):114 - Activity failure. ActivityId=c110fa80-a9a1-3c5e-9c55-4b90a0a785c3, activityType=RunWithJobOutput, attempt=1
java.util.concurrent.ExecutionException: io.airbyte.workers.exception.WorkerException: Unexpected error while getting checking connection.
        at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:396) ~[?:?]
        at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2073) ~[?:?]
        at io.airbyte.workers.temporal.TemporalAttemptExecution.get(TemporalAttemptExecution.java:161) ~[io.airbyte-airbyte-workers-0.40.23.jar:?]
        at io.airbyte.workers.temporal.check.connection.CheckConnectionActivityImpl.runWithJobOutput(CheckConnectionActivityImpl.java:109) ~[io.airbyte-airbyte-workers-0.40.23.jar:?]
        at jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:578) ~[?:?]
        at io.temporal.internal.activity.RootActivityInboundCallsInterceptor$POJOActivityInboundCallsInterceptor.executeActivity(RootActivityInboundCallsInterceptor.java:64) ~[temporal-sdk-1.17.0.jar:?]
        at io.temporal.internal.activity.RootActivityInboundCallsInterceptor.execute(RootActivityInboundCallsInterceptor.java:43) ~[temporal-sdk-1.17.0.jar:?]
        at io.temporal.internal.activity.ActivityTaskExecutors$BaseActivityTaskExecutor.execute(ActivityTaskExecutors.java:95) ~[temporal-sdk-1.17.0.jar:?]
        at io.temporal.internal.activity.ActivityTaskHandlerImpl.handle(ActivityTaskHandlerImpl.java:92) ~[temporal-sdk-1.17.0.jar:?]
        at io.temporal.internal.worker.ActivityWorker$TaskHandlerImpl.handleActivity(ActivityWorker.java:241) ~[temporal-sdk-1.17.0.jar:?]
        at io.temporal.internal.worker.ActivityWorker$TaskHandlerImpl.handle(ActivityWorker.java:206) ~[temporal-sdk-1.17.0.jar:?]
        at io.temporal.internal.worker.ActivityWorker$TaskHandlerImpl.handle(ActivityWorker.java:179) ~[temporal-sdk-1.17.0.jar:?]
        at io.temporal.internal.worker.PollTaskExecutor.lambda$process$0(PollTaskExecutor.java:93) ~[temporal-sdk-1.17.0.jar:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]
        at java.lang.Thread.run(Thread.java:1589) ~[?:?]
Caused by: io.airbyte.workers.exception.WorkerException: Unexpected error while getting checking connection.
        at io.airbyte.workers.general.DefaultCheckConnectionWorker.run(DefaultCheckConnectionWorker.java:106) ~[io.airbyte-airbyte-commons-worker-0.40.23.jar:?]
        at io.airbyte.workers.general.DefaultCheckConnectionWorker.run(DefaultCheckConnectionWorker.java:41) ~[io.airbyte-airbyte-commons-worker-0.40.23.jar:?]
        at io.airbyte.workers.temporal.TemporalAttemptExecution.lambda$getWorkerThread$5(TemporalAttemptExecution.java:195) ~[io.airbyte-airbyte-workers-0.40.23.jar:?]
        ... 1 more
Caused by: java.lang.NullPointerException
        at java.io.Reader.<init>(Reader.java:168) ~[?:?]
        at java.io.InputStreamReader.<init>(InputStreamReader.java:124) ~[?:?]
        at io.airbyte.commons.io.IOs.newBufferedReader(IOs.java:120) ~[io.airbyte-airbyte-commons-0.40.23.jar:?]
        at io.airbyte.commons.io.LineGobbler.<init>(LineGobbler.java:99) ~[io.airbyte-airbyte-commons-0.40.23.jar:?]
        at io.airbyte.commons.io.LineGobbler.gobble(LineGobbler.java:67) ~[io.airbyte-airbyte-commons-0.40.23.jar:?]
        at io.airbyte.commons.io.LineGobbler.gobble(LineGobbler.java:28) ~[io.airbyte-airbyte-commons-0.40.23.jar:?]
        at io.airbyte.workers.general.DefaultCheckConnectionWorker.run(DefaultCheckConnectionWorker.java:71) ~[io.airbyte-airbyte-commons-worker-0.40.23.jar:?]
        at io.airbyte.workers.general.DefaultCheckConnectionWorker.run(DefaultCheckConnectionWorker.java:41) ~[io.airbyte-airbyte-commons-worker-0.40.23.jar:?]
        at io.airbyte.workers.temporal.TemporalAttemptExecution.lambda$getWorkerThread$5(TemporalAttemptExecution.java:195) ~[io.airbyte-airbyte-workers-0.40.23.jar:?]
        ... 1 more
I’ve been looking at source code in airbyte-platform, but I can’t yet figure out the source of the null pointer.
This is a fresh install of airbyte version 0.40.23 (installed to match the version in another cluster that is working), but I also see this problem in 0.40.25, 0.40.32, and 0.41.0. I’ve tried all 3.
Wait. Not 0.40.32. I used 0.40.30.
I have also opened a shell to several pods, including the connection checkers, and used
curl
or
ping
to verify that we have proper DNS and Internet access in all.
I am quite stumped on this one.
y
This is similar to my experience with AirByte so far. It is super buggy and I think barely qualifies as Alpha level software. With that said. The way I've worked through these issues is to modify the code and put debug statements to see what is actually Null. Sometimes you will discover that your networks/ports are not mapped they way you think they are (what I think your issue will be). Or more often there is a bug in AirByte.
b
Thanks. I am hoping to avoid messing with the code, but it seems that maybe AirByte requires it. I don’t really have time to become an AirByte expert. I just need it to work. I have two AWS accounts. Each has an EKS cluster in it. On one, AirByte works fine. On the other, I hit this null pointer. There’s obviously something different between the two environments, but AirByte isn’t telling me enough about the error to let me find the root cause.
m
Sorry guys, but I never had to mess with Airbyte code and we use it in production almost a year. Of course we needed to modify some connectors to meet our needs, but the platform code is working fine for us.
As for the error on the stacktrace, it doesn't tell much because it is an error on the logger itself it seems https://github.com/airbytehq/airbyte/blob/77112b02bface48317d0e5c83b7087d44ef97b53[…]va/io/airbyte/workers/general/DefaultCheckConnectionWorker.java
Can you post a full log of the worker when the error occurs?
Apparently something is happening on the check phase of the connection. Check will try to use the docker image command
check
of the connector, but something is happening with the pod that is running the check command and it does not have a error stream
If you can also get the pod logs for the spawned connector (both source and destination) and try to see their logs it can also help.
b
I agree with your assessment, Marcelo. I will grab the logs from one of the connection-check pods that spins up when I create the source. The log I posted comes from the minio pod.
main:
Copy code
Using existing AIRBYTE_ENTRYPOINT: /airbyte/base.sh
Waiting on CHILD_PID 7
PARENT_PID: 1
EXIT_STATUS: 0
relay-stdout:
Copy code
2023/03/03 21:23:04 socat[8] N reading from and writing to stdio
2023/03/03 21:23:04 socat[8] N opening connection to AF=2 10.101.5.79:9028
2023/03/03 21:25:14 socat[8] W recvmsg(): Resource temporarily unavailable
2023/03/03 21:25:14 socat[8] E connect(5, AF=2 10.101.5.79:9028, 16): Operation timed out
2023/03/03 21:25:14 socat[8] N exit(1)
relay-stderr:
Copy code
2023/03/03 21:23:04 socat[8] N reading from and writing to stdio
2023/03/03 21:23:04 socat[8] N opening connection to AF=2 10.101.5.79:9029
2023/03/03 21:25:14 socat[8] W recvmsg(): Resource temporarily unavailable
2023/03/03 21:25:14 socat[8] E connect(5, AF=2 10.101.5.79:9029, 16): Operation timed out
2023/03/03 21:25:14 socat[8] N exit(1)
Heartbeat and init logs are essentially empty.
m
it is timing out after 2:10min, hmmm
was it able to create the pod, or it got stuck on ContainerCreating?
Can you try describing the pods on eks and getting their event log?
b
The pod got created. I was able to use k8s Lens to open a shell while it was running, for example. I wanted to verify that it had Internet access. And it does. DNS and Internet are working when the pod is running.
m
when airbyte runs locally, it uses docker commands to run and uses the stdout/stderr of the commands to comunicate between source/destination. On EKS this is not possible (we are on k8s), so it uses minio to do that. Minio usually runs on a disk allocated, but you can also change the config to use S3. Just to check, did you change the configs to use S3 or this is a pure minio config?
Also check the persistent volume claims from minio to see if they are working fine
b
pure minio, no s3, and the PVCs all have healthy volumes behind them.
When I do the helm install, I provide a values.yaml for customization. that is the only non-default thing that I do. I want AirByte to run in a specific namespace, so I provide customer nodeSelector values. Also, I have a load balancer that is looking for a particular label on the webapp, so my values.yaml file adds something for that. Here is what the file looks like:
Copy code
global:
    kube:
      nodeSelector:
        tenantname: duploservices-nonprod-tool

webapp:
    nodeSelector:
      tenantname: duploservices-nonprod-tool
    extraSelectorLabels:
      app: nonprod-airbyte-webapp

pod-sweeper:
    nodeSelector:
      tenantname: duploservices-nonprod-tool

server:
    nodeSelector:
      tenantname: duploservices-nonprod-tool

worker:
    nodeSelector:
      tenantname: duploservices-nonprod-tool

metrics:
    nodeSelector:
      tenantname: duploservices-nonprod-tool

airbyte-bootloader:
    nodeSelector:
      tenantname: duploservices-nonprod-tool

temporal:
    nodeSelector:
      tenantname: duploservices-nonprod-tool

cron:
    nodeSelector:
      tenantname: duploservices-nonprod-tool
I should say it this way: I have compute nodes for each of my namespaces. I want the airbyte pods to get scheduled onto compute nodes “assigned” to that namespace. Thus the nodeSelector entries.
m
Hmmmmmm, maybe that is it? There is a variable, JOB_KUBE_NAMESPACE, that needs to be set in order for the worker to spawn the new pods in the correct namespace I think
Default is to get from global annotations: - name: JOB_KUBE_NAMESPACE valueFrom: fieldRef: fieldPath: metadata.namespace {{- if $.Values.global.jobs.kube.annotations }}
So putting it on nodeSelector won't work
b
Can one set global annotations? How do we do that?
By the way, as you predicted, the problem is that the connection checkers were getting assigned to nodes in the ‘wrong’ namespace. The timeout was happening because they could not communicate with the worker pod.
I nuked the nodes in the other namespace and everything started working.
1,000 thank yous for chatting me through the process.
m
It should be just like yours: (i think)
Copy code
global:
    jobs:
        kube:
            annotations:
                namespace: duploservices-nonprod-tool
b
I will try that. Thank you!
m
I was totally wrong, I saw that on my phone and the identation tricked me, the JOB_KUBE_NAMESPACE is just from metadata.namespace variable
So should be just, (maybe?):
Copy code
worker:
    metadata:
        namespace: duploservices-nonprod-tool
m
This started happening today on our helm deployment, seemingly out of the blue!
b
For me, the root cause of the failure was that the pod that got spun up to check the source connection was on a different k8s node than the airbyte worker pod. The connection checker was timing out. The reason they could not connect is that the nodeSelector specification I used did not apply to the connection checkers. Marcelo is trying to help me make sure of how to specify the node selector.
Bummer that AirByte didn’t show me a proper error - such as timeout attempting to connect. The null pointer was supremely unhelpful.
s
Hey Brian, did you ever figure out the solution to this problem? My team just set up Airbyte 0.40.32 also on EKS, installed via helm, and we are running into the same error messages when trying to create any source or destination connectors
b
Hey, Stephen! Yes, the root cause is that in setting nodeSelectors in my values.yaml file I had one syntax error. The result was that when the connection checker was being spun up, it was being spun up on a node outside of the node group I had targeted. All of AirByte was running in one node group, but the connection checkers were being spun up in another node group. And we have networking setup such that the node groups can’t talk to one another. The error was being caused by the connection checker attempting to talk to its peers and timing out.
s
Got it - thanks! My team was seeing a similar issue with the connection checkers, though our issue was with needing to set the airbyte-server Service port name to
tcp
instead of
http
and turning off istio.
👍 1
n
@Brian Castelli I am getting a similar error while trying to create a new connector
Copy code
2023/10/17 20:50:35 socat[8] N reading from and writing to stdio
2023/10/17 20:50:35 socat[8] N opening connection to AF=2 10.101.14.107:9024
2023/10/17 20:52:45 socat[8] W recvmsg(): Resource temporarily unavailable
2023/10/17 20:52:45 socat[8] E connect(5, AF=2 10.101.14.107:9024, 16): Operation timed out
2023/10/17 20:52:45 socat[8] N exit(1)
b
Yes, this is the same root cause. We are trying to fix it.