rest-api/data/send - возвращает 500 "Internal Server Error"

При попытке отправить data/send приходит 500 ошибка, причем работает через раз. Иногда нормально отправляется и приходит статус 200, а иногда приходит 500
data = {
"nodeId": "",
"sessionId": session_id,
"operationId": "",
"payload": {"type": type, "value": data}
}
res = requests.post(settings.WCS_HOST + "rest-api/data/send", data=json.dumps(data), headers={"Content-Type": "application/json"})

Причем при повторной отправки тогоже самого data, на n-ый раз приходит 200 и всё отправляется.

В чем может быть причина, что 500 приходит через раз?
 
Last edited:
Логи:

09:55:06,992 ERROR RestCallController - HTTPS-pool-5-thread-564 Got remote exception while sending data to client!
com.flashphoner.server.commons.rmi.operations.exception.ClientNotFoundException
at com.flashphoner.rest.server.NodeApi.sendData(Unknown Source)
at com.flashphoner.rest.server.rest_v2.RestDataController.send(Unknown Source)
at jdk.internal.reflect.GeneratedMethodAccessor204.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at com.flashphoner.rest.server.RestApiRouter.processRequest(Unknown Source)
at com.flashphoner.server.http.handlers.RestApiRequestHandler.process(Unknown Source)
at com.flashphoner.server.http.G.messageReceived(Unknown Source)
at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(Unknown Source)
at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(Unknown Source)
at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(Unknown Source)
at org.jboss.netty.handler.stream.ChunkedWriteHandler.handleUpstream(Unknown Source)
at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(Unknown Source)
at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(Unknown Source)
at org.jboss.netty.handler.codec.http.HttpChunkAggregator.messageReceived(Unknown Source)
at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(Unknown Source)
at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(Unknown Source)
at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(Unknown Source)
at org.jboss.netty.channel.Channels.fireMessageReceived(Unknown Source)
at org.jboss.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(Unknown Source)
at org.jboss.netty.handler.codec.replay.ReplayingDecoder.callDecode(Unknown Source)
at org.jboss.netty.handler.codec.replay.ReplayingDecoder.messageReceived(Unknown Source)
at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(Unknown Source)
at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(Unknown Source)
at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(Unknown Source)
at org.jboss.netty.channel.Channels.fireMessageReceived(Unknown Source)
at org.jboss.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(Unknown Source)
at org.jboss.netty.handler.codec.frame.FrameDecoder.callDecode(Unknown Source)
at org.jboss.netty.handler.codec.frame.FrameDecoder.messageReceived(Unknown Source)
at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(Unknown Source)
at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(Unknown Source)
at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(Unknown Source)
at org.jboss.netty.channel.Channels.fireMessageReceived(Unknown Source)
at org.jboss.netty.channel.Channels.fireMessageReceived(Unknown Source)
at org.jboss.netty.channel.socket.nio.NioWorker.read(Unknown Source)
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.processSelectedKeys(Unknown Source)
at org.jboss.netty.channel.socket.nio.DeadlockAwareNioWorker.run(Unknown Source)
at org.jboss.netty.util.ThreadRenamingRunnable.run(Unknown Source)
at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
 

Max

Administrator
Staff member
Добрый день.
com.flashphoner.server.commons.rmi.operations.exception.ClientNotFoundException
Это означает, что клиент с таким sessionId не подключен. Возможно, у клиента проблемы с каналом, и он успевает отключиться к тому моменту, как ему будет отправлено сообщение. Для того, чтобы проверить, что клиент подключен, используйте REST API запрос /connection/find с поиском по sessionId, например
Code:
POST /rest-api/connection/find HTTP/1.1
Host: localhost:8081
Content-Type: application/json
 
{
    "sessionId":"/192.168.1.102:39564/192.168.1.101:8443"
}
 
Top