Endpoint stop error!

180 views
Skip to first unread message

hansonye...@gmail.com

unread,
Nov 13, 2015, 7:12:21 AM11/13/15
to Kaa project
When the endpoint stops, an error has occurred. Are as follows: 

20:07:35.996 [main] INFO  com.locision.locker.LockerDemo - ----= Kaa Client stoped =---- 
20:07:36.012 [Thread-0] DEBUG o.k.k.c.c.impl.DefaultChannelManager - [default_bootstrap_channel] Worker is interrupted
java.lang.InterruptedException: null
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.reportInterruptAfterWait(AbstractQueuedSynchronizer.java:2017) ~[na:1.7.0_71]
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2052) ~[na:1.7.0_71]
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442) ~[na:1.7.0_71]
at org.kaaproject.kaa.client.channel.impl.DefaultChannelManager$SyncWorker.run(DefaultChannelManager.java:516) ~[kaa-client-sdk-p2-c2-n4-l7.jar:na]
20:07:36.011 [Thread-1] DEBUG o.k.k.c.c.impl.DefaultChannelManager - [default_operation_tcp_channel] Worker is interrupted
java.lang.InterruptedException: null
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.reportInterruptAfterWait(AbstractQueuedSynchronizer.java:2017) ~[na:1.7.0_71]
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2052) ~[na:1.7.0_71]
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442) ~[na:1.7.0_71]
at org.kaaproject.kaa.client.channel.impl.DefaultChannelManager$SyncWorker.run(DefaultChannelManager.java:516) ~[kaa-client-sdk-p2-c2-n4-l7.jar:na]
20:07:36.012 [pool-6-thread-2] WARN  o.k.k.c.c.i.c.DefaultOperationTcpChannel - Failed to read from the socket for channel [default_operation_tcp_channel]. Stack trace: 
java.net.SocketException: Socket closed
at java.net.SocketInputStream.socketRead0(Native Method) ~[na:1.7.0_71]
at java.net.SocketInputStream.read(SocketInputStream.java:152) ~[na:1.7.0_71]
at java.net.SocketInputStream.read(SocketInputStream.java:122) ~[na:1.7.0_71]
at java.net.SocketInputStream.read(SocketInputStream.java:108) ~[na:1.7.0_71]
at org.kaaproject.kaa.client.channel.impl.channels.DefaultOperationTcpChannel$SocketReadTask.run(DefaultOperationTcpChannel.java:206) ~[kaa-client-sdk-p2-c2-n4-l7.jar:na]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [na:1.7.0_71]
at java.util.concurrent.FutureTask.run(FutureTask.java:262) [na:1.7.0_71]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178) [na:1.7.0_71]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292) [na:1.7.0_71]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_71]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_71]
at java.lang.Thread.run(Thread.java:745) [na:1.7.0_71]
20:07:36.013 [Thread-0] DEBUG o.k.k.c.c.impl.DefaultChannelManager - [default_bootstrap_channel] Worker stopped
20:07:36.014 [Thread-1] DEBUG o.k.k.c.c.impl.DefaultChannelManager - [default_operation_tcp_channel] Worker stopped
20:07:36.015 [pool-6-thread-2] WARN  o.k.k.c.c.i.c.DefaultOperationTcpChannel - Socket connection for channel [{}] was interrupted: 
java.net.SocketException: Socket closed
at java.net.SocketInputStream.socketRead0(Native Method) ~[na:1.7.0_71]
at java.net.SocketInputStream.read(SocketInputStream.java:152) ~[na:1.7.0_71]
at java.net.SocketInputStream.read(SocketInputStream.java:122) ~[na:1.7.0_71]
at java.net.SocketInputStream.read(SocketInputStream.java:108) ~[na:1.7.0_71]
at org.kaaproject.kaa.client.channel.impl.channels.DefaultOperationTcpChannel$SocketReadTask.run(DefaultOperationTcpChannel.java:206) ~[kaa-client-sdk-p2-c2-n4-l7.jar:na]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [na:1.7.0_71]
at java.util.concurrent.FutureTask.run(FutureTask.java:262) [na:1.7.0_71]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178) [na:1.7.0_71]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292) [na:1.7.0_71]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_71]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_71]
at java.lang.Thread.run(Thread.java:745) [na:1.7.0_71]
20:07:36.016 [pool-6-thread-2] DEBUG o.k.k.c.c.i.c.DefaultOperationTcpChannel - Stale socket: Socket[addr=/10.0.0.200,port=9997,localport=56814] is detected, killing read task...
20:07:36.016 [pool-6-thread-2] INFO  o.k.k.c.c.i.c.DefaultOperationTcpChannel - Read Task is interrupted for channel [default_operation_tcp_channel]
Disconnected from the target VM, address: '127.0.0.1:56810', transport: 'socket'

Denis Kimcherenko

unread,
Nov 13, 2015, 7:37:29 AM11/13/15
to Kaa project
Hi,

It is a known issue, but not critical. We have opened a bug and will fix it in a 0.7.4 release.

Best regards,
Denis

hansonye...@gmail.com

unread,
Nov 13, 2015, 7:42:50 AM11/13/15
to Kaa project
Thank for your response. I have another problem. Why some Endpoints can't receive notifications, but they can receive them when they restart ?

在 2015年11月13日星期五 UTC+8下午8:37:29,Denis Kimcherenko写道:

Denis Kimcherenko

unread,
Nov 13, 2015, 7:57:29 AM11/13/15
to Kaa project
Could you give me more details about the second issue?

1. Kaa version.
2. Kaa SDK type.
3. All steps how to reproduce the issue.

Thanks,
Denis

hansonye...@gmail.com

unread,
Nov 13, 2015, 8:04:23 AM11/13/15
to Kaa project
Kaa 0.7.3.  All endpoints has subscribed the notification topic and a notification is sended. But some of endpoints can't receive it. However, when they restart again, they receive the one.

在 2015年11月13日星期五 UTC+8下午8:57:29,Denis Kimcherenko写道:

Denis Kimcherenko

unread,
Nov 13, 2015, 8:29:06 AM11/13/15
to Kaa project
1. According to logs, you are using Java SDK, am I right?
2. Is a notification topic mandatory or optional?

hansonye...@gmail.com

unread,
Nov 13, 2015, 8:33:16 PM11/13/15
to Kaa project
Yes, you are right. The topic is mandatory.

在 2015年11月13日星期五 UTC+8下午9:29:06,Denis Kimcherenko写道:

Denis Kimcherenko

unread,
Nov 14, 2015, 11:12:50 AM11/14/15
to Kaa project
Thnaks for information. We will try to reproduce your issue.
To speed up an investigation process, please, tell how many endpoints did you use in your test?

Thanks,
Denis

субота, 14 листопада 2015 р. 03:33:16 UTC+2 користувач hansonye...@gmail.com написав:

hansonye...@gmail.com

unread,
Nov 16, 2015, 10:01:44 PM11/16/15
to Kaa project
I know how to occur the problem. After I sent an unicast notification to an endpoint, all other endpoints in the group which this endpoint belongs to failed to receive other notifications

在 2015年11月15日星期日 UTC+8上午12:12:50,Denis Kimcherenko写道:

Petr Krutsiuk

unread,
Nov 17, 2015, 7:19:06 AM11/17/15
to Kaa project
Hi, 

Thanks for your reply. I will try to reproduce this issue and if I will succeed i'll open a new ticket for this bug. 

Petr Krutsiuk

unread,
Nov 17, 2015, 11:01:48 AM11/17/15
to Kaa project
Hi,

I tried to reproduce your issue but everything seems fine.
Could You please enable higher trace level, reproduce issue and attach new logs to this thread. In order to do this, please follow next steps:
From command line (install PuTTY if You are using Windows as host):

1. Connect to your KaaSandBox via ssh:

    $ ssh kaa@<YOUR-SANDBOX-IP>
    password: kaa

2. Stop Kaa services:

    $ sudo service kaa-operations stop
    $ sudo service kaa-bootstrap stop
    $ sudo service kaa-control stop
    $ sudo service kaa-admin stop

3. Clean Kaa logs:

    $ sudo rm -rf /var/log/kaa/*

4. Change log-level for kaa services:

    $ sudo nano /usr/lib/kaa-control/conf/logback.xml

    (in a folloving lines replace "INFO" on "TRACE":
     <logger name="org.kaaproject.kaa.server" level="INFO"/>
    in order to save changes press Ctrl+X and enter "y" in dialog line and press Enter.)

    $ sudo nano /usr/lib/kaa-operations/conf/logback.xml

    repeat previous instructions for next line:
     <logger name="org.kaaproject.kaa" level="INFO"/>

5. Next start Kaa services:

    $ sudo service kaa-operations start
    $ sudo service kaa-bootstrap start
    $ sudo service kaa-control start
    $ sudo service kaa-admin start

6. Try to reproduce your issue.
7. Create a zip file with your logs:

    $ tar -cvf /home/kaa/logs.tar.gz /var/log/kaa/
    $ logout

8. Copy archive on your host machine (or use WinSCP in case of Windows):

    $ scp kaa@<YOUR-SANDBOX-IP>:/home/kaa/logs.tar.gz /home/your-host-username/
     password: kaa

On Tuesday, November 17, 2015 at 5:01:44 AM UTC+2, hansonye...@gmail.com wrote:

hansonye...@gmail.com

unread,
Nov 17, 2015, 8:20:40 PM11/17/15
to Kaa project
Thanks for your reply.

在 2015年11月18日星期三 UTC+8上午12:01:48,Petr Krutsiuk写道:

hansonye...@gmail.com

unread,
Nov 18, 2015, 2:06:45 AM11/18/15
to Kaa project
The endpoint occured an error when receiving an unicast notification.
15:02:48.097 [pool-6-thread-2] INFO  o.k.k.c.c.i.c.DefaultOperationTcpChannel - Disconnect message (reason=INTERNAL_ERROR) received for channel [default_operation_tcp_channel]
15:02:48.097 [pool-6-thread-2] ERROR o.k.k.c.c.i.c.DefaultOperationTcpChannel - Server error occurred: INTERNAL_ERROR
15:02:48.098 [pool-6-thread-2] INFO  o.k.k.c.c.i.c.DefaultOperationTcpChannel - [default_operation_tcp_channel] has failed
15:02:48.098 [pool-6-thread-2] INFO  o.k.k.c.c.i.c.DefaultOperationTcpChannel - Channel "default_operation_tcp_channel": closing current connection
15:02:48.099 [pool-6-thread-2] DEBUG o.k.k.c.c.i.c.DefaultOperationTcpChannel - Sending Disconnect from channel [default_operation_tcp_channel]
15:02:48.116 [pool-6-thread-2] ERROR o.k.k.c.c.i.c.DefaultOperationTcpChannel - Failed to send Disconnect to server: {}
java.net.SocketException: Broken pipe
at java.net.SocketOutputStream.socketWrite0(Native Method) ~[na:1.7.0_71]
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:113) ~[na:1.7.0_71]
at java.net.SocketOutputStream.write(SocketOutputStream.java:147) ~[na:1.7.0_71]
at org.kaaproject.kaa.client.channel.impl.channels.DefaultOperationTcpChannel.sendFrame(DefaultOperationTcpChannel.java:275) [kaa-client-sdk-p2-c2-n4-l7.jar:na]
at org.kaaproject.kaa.client.channel.impl.channels.DefaultOperationTcpChannel.sendDisconnect(DefaultOperationTcpChannel.java:287) [kaa-client-sdk-p2-c2-n4-l7.jar:na]
at org.kaaproject.kaa.client.channel.impl.channels.DefaultOperationTcpChannel.closeConnection(DefaultOperationTcpChannel.java:318) [kaa-client-sdk-p2-c2-n4-l7.jar:na]
at org.kaaproject.kaa.client.channel.impl.channels.DefaultOperationTcpChannel.onServerFailed(DefaultOperationTcpChannel.java:358) [kaa-client-sdk-p2-c2-n4-l7.jar:na]
at org.kaaproject.kaa.client.channel.impl.channels.DefaultOperationTcpChannel.access$200(DefaultOperationTcpChannel.java:69) [kaa-client-sdk-p2-c2-n4-l7.jar:na]
at org.kaaproject.kaa.client.channel.impl.channels.DefaultOperationTcpChannel$5.onMessage(DefaultOperationTcpChannel.java:184) [kaa-client-sdk-p2-c2-n4-l7.jar:na]
at org.kaaproject.kaa.client.channel.impl.channels.DefaultOperationTcpChannel$5.onMessage(DefaultOperationTcpChannel.java:177) [kaa-client-sdk-p2-c2-n4-l7.jar:na]
at org.kaaproject.kaa.common.channels.protocols.kaatcp.messages.MessageFactory.onMqttFrame(MessageFactory.java:95) [kaa-client-sdk-p2-c2-n4-l7.jar:na]
at org.kaaproject.kaa.common.channels.protocols.kaatcp.Framer.callListeners(Framer.java:111) [kaa-client-sdk-p2-c2-n4-l7.jar:na]
at org.kaaproject.kaa.common.channels.protocols.kaatcp.Framer.pushBytes(Framer.java:98) [kaa-client-sdk-p2-c2-n4-l7.jar:na]
at org.kaaproject.kaa.client.channel.impl.channels.DefaultOperationTcpChannel$SocketReadTask.run(DefaultOperationTcpChannel.java:209) [kaa-client-sdk-p2-c2-n4-l7.jar:na]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [na:1.7.0_71]
at java.util.concurrent.FutureTask.run(FutureTask.java:262) [na:1.7.0_71]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178) [na:1.7.0_71]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292) [na:1.7.0_71]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_71]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_71]
at java.lang.Thread.run(Thread.java:745) [na:1.7.0_71]
15:02:54.581 [pool-6-thread-2] WARN  o.k.k.c.c.i.c.DefaultOperationTcpChannel - Loss of connectivity detected
15:02:54.587 [pool-6-thread-2] WARN  o.k.k.c.c.i.c.DefaultOperationTcpChannel - Attempt to reconnect will be made in 5000 ms according to failover strategy decision
15:02:54.587 [pool-6-thread-2] INFO  o.k.k.c.c.i.c.DefaultOperationTcpChannel - Scheduling open connection task
15:02:54.587 [pool-6-thread-2] INFO  o.k.k.c.c.i.c.DefaultOperationTcpChannel - Read Task is interrupted for channel [default_operation_tcp_channel]
15:02:59.590 [pool-6-thread-1] INFO  o.k.k.c.c.i.c.DefaultOperationTcpChannel - Channel [default_operation_tcp_channel]: opening connection to server IPTransportInfo [host=10.0.0.200, port=9997]

在 2015年11月18日星期三 UTC+8上午12:01:48,Petr Krutsiuk写道:
Hi,

Andrew Shvayka

unread,
Nov 18, 2015, 4:53:03 AM11/18/15
to Kaa project
Hi,

This looks like a server side issue.
Please attach server logs.

Thanks,
Andrew

hansonye...@gmail.com

unread,
Nov 18, 2015, 5:00:31 AM11/18/15
to Kaa project
There is no log for this error.

在 2015年11月18日星期三 UTC+8下午5:53:03,Andrew Shvayka写道:

Andrew Shvayka

unread,
Nov 18, 2015, 5:59:33 AM11/18/15
to hansonye...@gmail.com, Kaa project
Do you have trace level enabled on the server side according to instruction?

--
You received this message because you are subscribed to the Google Groups "Kaa project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kaaproject+...@googlegroups.com.
Visit this group at http://groups.google.com/group/kaaproject.
To view this discussion on the web visit https://groups.google.com/d/msgid/kaaproject/9894f8b4-659d-4d7c-b6f2-bfcc8a826ee5%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

hansonye...@gmail.com

unread,
Nov 18, 2015, 7:35:48 AM11/18/15
to Kaa project, hansonye...@gmail.com
Yes, I do.

在 2015年11月18日星期三 UTC+8下午6:59:33,Andrew Shvayka写道:

Hanson Ye

unread,
Nov 26, 2015, 9:47:34 PM11/26/15
to Kaa project, hansonye...@gmail.com
In case of an Endpoint stop or is forced to stop. How to recover its the newest profile which is stored in mongodb when it restarts ?


在 2015年11月18日星期三 UTC+8下午6:59:33,Andrew Shvayka写道:
Do you have trace level enabled on the server side according to instruction?

Andrew Kokhanovskyi

unread,
Nov 30, 2015, 1:59:43 PM11/30/15
to Kaa project, hansonye...@gmail.com
The endpoint-side storage of the profile information is intentionally left out of scope of the Kaa SDK. In many cases the endpoint profile consists of the information that you should be able to retrieve and populate in runtime. By NOT storing the last known contents of the endpoint profile we make sure that it actually gets populated with the most up to date information on the endpoint start. Of course, that will not prevent you from persisting the profile information, but that choice is yours to make.

Hope this explains.

AK
Reply all
Reply to author
Forward
0 new messages