java.lang.NullPointerException

Couchbase JIRA | Mihir Kamdar | 1 week ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    When specifying an invalid handle to retrieve results from the analytics/result endpoint, there is no error returned. In fact there is no response returned to the request and there are some errors in the logs. *Request* : curl -v http://10.111.151.102:8095/analytics/result?handle=%7B%22handle%22:%5B1,0%5D%7D -G *Error in logs (cc.log)*: 2017-02-14T09:45:18.752Z INFO CBAS.logging.LoggingHandler [nioEventLoopGroup-2-1] [id: 0x5c8f7f4f, L:/0:0:0:0:0:0:0:0:8095] RECEIVED: [id: 0xa304ce3a, L:/10.111.151.102:8095 - R:/10.111.151.102:54912] 2017-02-14T09:45:18.897Z INFO CBAS.work.WorkQueue [Worker:ClusterController] Executing: GetResultPartitionLocations: JobId@JID:1 ResultSetId@RSID:0 Known@null Exception in thread "Executor-3:ClusterController" java.lang.NullPointerException at org.apache.hyracks.control.cc.dataset.DatasetDirectoryService.getNonNullDatasetJobRecord(DatasetDirectoryService.java:104) at org.apache.hyracks.control.cc.dataset.DatasetDirectoryService.updatedRecords(DatasetDirectoryService.java:223) at org.apache.hyracks.control.cc.dataset.DatasetDirectoryService.getResultPartitionLocations(DatasetDirectoryService.java:196) at org.apache.hyracks.control.cc.work.GetResultPartitionLocationsWork$1.run(GetResultPartitionLocationsWork.java:59) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)

    Couchbase JIRA | 1 week ago | Mihir Kamdar
    java.lang.NullPointerException
  2. 0

    {noformat} 1. Start a local cluster: ./samples/local/bin/start-sample-cluster.sh java version "1.8.0_45" Java(TM) SE Runtime Environment (build 1.8.0_45-b14) Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode) CLUSTERDIR=/opt/couchbase/cbas-install/samples/local INSTALLDIR=/opt/couchbase/cbas-install Waiting for cluster to start..done See output in /opt/couchbase/cbas-install/samples/local/logs/ 2. Issue curl command: curl -s --data pretty=true --data format=CLEAN_JSON --data-urlencode statement@file.txt http://localhost:8095/analytics/service Error received: { "requestID": "79492951-d037-4717-b9cd-69b6cbc860f3", "signature": "*", "errors": [{ "code": "1", "msg": " Asterix Cluster is in UNUSABLE state.\n One or more Node Controllers have left or haven't joined yet.\n" }], "status": "fatal", "metrics": { "elapsedTime": "60.008365743s", "executionTime": "60.007577309s", "resultCount": "0", "resultSize": "0" } } Error reported in cc.log: java.net.BindException: Address already in use at sun.nio.ch.Net.bind0(Native Method) at sun.nio.ch.Net.bind(Net.java:437) at sun.nio.ch.Net.bind(Net.java:429) at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223) at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74) at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:67) at org.apache.hyracks.ipc.impl.IPCConnectionManager.<init>(IPCConnectionManager.java:72) at org.apache.hyracks.ipc.impl.IPCSystem.<init>(IPCSystem.java:44) at org.apache.hyracks.control.cc.ClusterControllerService.<init>(ClusterControllerService.java:169) at org.apache.hyracks.control.cc.CCDriver.main(CCDriver.java:39) 3. Result of jps: jps 7233 NCService 7234 NCService 7310 Jps 4. netstat -anp | grep -i "8095" tcp 0 0 :::8095 :::* LISTEN 32736/java 5.ps -aef | grep -i 32736 root 7448 6179 0 11:50 pts/0 00:00:00 grep -i 32736 root 32736 1 0 Aug11 ? 00:07:26 /usr/java/jdk1.8.0_45//bin/java -Djava.rmi.server.hostname=localhost -classpath :/root/cbas-yingyi/etc:/root/cbas-yingyi/repo/* -Dapp.name=cbascc -Dapp.pid=32736 -Dapp.repo=/root/cbas-yingyi/repo -Dapp.home=/root/cbas-yingyi -Dbasedir=/root/cbas-yingyi org.apache.hyracks.control.cc.CCDriver -app-cc-main-class com.couchbase.analytics.bootstrap.CCApplicationEntryPoint -config-file /root/cbas-yingyi/samples/local/conf/cc.conf 6. Basically above process was using the port, killed the process and curl command worked fine. 7. Running the startup script should have thrown some kind of connection error. {noformat}

    Couchbase JIRA | 6 months ago | Prerna Manaktala
    java.net.BindException: Address already in use
  3. 0

    In order to reproduce MB-21435,I added Tills suggestions in script and hit this issue. {noformat} 1. Tried starting cluster using : ./samples/local/bin/start-sample-cluster.sh CLUSTERDIR=/root/cbas-install/cbas/samples/local INSTALLDIR=/root/cbas-install/cbas LOGSDIR=/root/cbas-install/cbas/samples/local/logs ERROR: sample cluster address (localhost:8095) already in use 2. Checked netstat and jps: root@ubuntu:~/cbas-install/cbas# netstat -anp | grep -i 8095 tcp 0 0 0.0.0.0:8095 0.0.0.0:* LISTEN 20672/java tcp 0 0 127.0.0.1:56327 127.0.0.1:8095 TIME_WAIT - unix 3 [ ] STREAM CONNECTED 7538095 6496/moxi root@ubuntu:~/cbas-install/cbas# jps 20672 CCDriver 6978 Jps 20803 NCDriver 20797 NCDriver 20670 NCService 20671 NCService 3. Tried shutting down cluster and then checked jps: root@ubuntu:~/cbas-install/cbas# curl -v -data http://localhost:8095/analytics/shutdown * Hostname was NOT found in DNS cache * Trying 127.0.0.1... * Connected to localhost (127.0.0.1) port 8095 (#0) > POST /analytics/shutdown HTTP/1.1 > User-Agent: curl/7.35.0 > Host: localhost:8095 > Accept: */* > Content-Length: 3 > Content-Type: application/x-www-form-urlencoded > * upload completely sent off: 3 out of 3 bytes < HTTP/1.1 202 Accepted < Date: Fri, 21 Oct 2016 05:45:32 GMT < Content-Type: application/json;charset=utf-8 < Content-Length: 799 * Server Jetty(9.3.11.v20160721) is not blacklisted < Server: Jetty(9.3.11.v20160721) < { "cluster": { "metadata_node": "red", "ncs": [ { "ncservice_pid": 20671, "node_id": "red", "partitions": [{ "active": true, "partition_id": "partition_0" }], "pid": 20803, "state": "ACTIVE" }, { "ncservice_pid": 20670, "node_id": "blue", "partitions": [{ "active": true, "partition_id": "partition_1" }], "pid": 20797, "state": "ACTIVE" } ], "state": "ACTIVE" }, "date": "Thu Oct 20 22:45:32 PDT 2016", "status": "SHUTTING_DOWN" * Connection #0 to host localhost left intact }root@ubuntu:~/cbas-install/cbas# jps 7073 Jps 20670 NCService 20671 NCService 4. Tried stopping cluster and then checked jps: root@ubuntu:~/cbas-install/cbas# ./samples/local/bin/stop-sample-cluster.sh WARNING: sample cluster does not appear to be running, will attempt to wait for CCDriver to terminate if running. root@ubuntu:~/cbas-install/cbas# jps 7166 Jps 20670 NCService 20671 NCService 5. All services should have been stopped but I still see these 2 NCServices running. I have taken jstack of these two, attaching them to the bug.Also attaching cbas logs. 6. Error seen in blue-service.log: 2016-10-20T22:45:32.398-07:00 ERRO CBAS.dataset.ResultStateSweeper [Executor-5:blue] Result cleaner thread interrupted, shutting down. org.apache.hyracks.api.exceptions.HyracksDataException: Task java.util.concurrent.FutureTask@2f949883 rejected from java.util.concurrent.ThreadPoolExecutor@426e1f4f[Shutting down, pool size = 7, active threads = 6, queued tasks = 0, completed tasks = 4569] at org.apache.hyracks.api.rewriter.runtime.SuperActivityOperatorNodePushable.runInParallel(SuperActivityOperatorNodePushable.java:228) at org.apache.hyracks.api.rewriter.runtime.SuperActivityOperatorNodePushable.deinitialize(SuperActivityOperatorNodePushable.java:165) at org.apache.hyracks.control.nc.Task.run(Task.java:315) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.FutureTask@2f949883 rejected from java.util.concurrent.ThreadPoolExecutor@426e1f4f[Shutting down, pool size = 7, active threads = 6, queued tasks = 0, completed tasks = 4569] at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2047) at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:823) at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1369) at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134) at org.apache.hyracks.api.rewriter.runtime.SuperActivityOperatorNodePushable.runInParallel(SuperActivityOperatorNodePushable.java:215) ... 5 more org.apache.hyracks.api.exceptions.HyracksDataException: Task java.util.concurrent.FutureTask@6cb84ed5 rejected from java.util.concurrent.ThreadPoolExecutor@426e1f4f[Shutting down, pool size = 6, active threads = 6, queued tasks = 0, completed tasks = 4569] at org.apache.hyracks.api.rewriter.runtime.SuperActivityOperatorNodePushable.runInParallel(SuperActivityOperatorNodePushable.java:228) at org.apache.hyracks.api.rewriter.runtime.SuperActivityOperatorNodePushable.deinitialize(SuperActivityOperatorNodePushable.java:165) at org.apache.hyracks.control.nc.Task.run(Task.java:315) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.FutureTask@6cb84ed5 rejected from java.util.concurrent.ThreadPoolExecutor@426e1f4f[Shutting down, pool size = 6, active threads = 6, queued tasks = 0, completed tasks = 4569] at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2047) at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:823) at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1369) {noformat}

    Couchbase JIRA | 4 months ago | Prerna Manaktala
    org.apache.hyracks.api.exceptions.HyracksDataException: Task java.util.concurrent.FutureTask@2f949883 rejected from java.util.concurrent.ThreadPoolExecutor@426e1f4f[Shutting down, pool size = 7, active threads = 6, queued tasks = 0, completed tasks = 4569]
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.NullPointerException

      No message provided

      at org.apache.hyracks.control.cc.dataset.DatasetDirectoryService.getNonNullDatasetJobRecord()
    2. org.apache.hyracks
      GetResultPartitionLocationsWork$1.run
      1. org.apache.hyracks.control.cc.dataset.DatasetDirectoryService.getNonNullDatasetJobRecord(DatasetDirectoryService.java:104)
      2. org.apache.hyracks.control.cc.dataset.DatasetDirectoryService.updatedRecords(DatasetDirectoryService.java:223)
      3. org.apache.hyracks.control.cc.dataset.DatasetDirectoryService.getResultPartitionLocations(DatasetDirectoryService.java:196)
      4. org.apache.hyracks.control.cc.work.GetResultPartitionLocationsWork$1.run(GetResultPartitionLocationsWork.java:59)
      4 frames
    3. Java RT
      Thread.run
      1. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      2. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      3. java.lang.Thread.run(Thread.java:745)
      3 frames