Author Topic: plugin error: System.Exception -> xJson  (Read 2100 times)

0 Members and 1 Guest are viewing this topic.

Mace

  • $upporter
  • Contributor
  • *****
  • Posts: 77
  • Karma: 1
    • View Profile
plugin error: System.Exception -> xJson
« on: March 26, 2015, 07:44:12 AM »
So I've been having a couple errors lately and the log doesn't really help me.

Version: 2.1.4.2
Running VC on Win 7 (service pack 1, .NET: 4.5) on a separate server to Kodi

command example:
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.4.2-->
<command id="856" name="Folder Path" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>XJson.Raw</cmdType>
    <params>
      <param>XBMC.GetInfoLabels</param>
      <param>"labels" : ["Container.FolderPath"]</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
</command>

That's just an example, but it's randomly on everything.
error is: 
Code: [Select]
26/03/2015 8:29:09 PM 952 [plugin] Sending json request:
26/03/2015 8:29:09 PM 952 [plugin] {"jsonrpc": "2.0", "method": "XBMC.GetInfoLabels", "params":{"labels" : ["Container.FolderPath"]},"id": "0"}
26/03/2015 8:29:10 PM 305 [plugin] Web Exception while calling JSON RPC:{"jsonrpc": "2.0", "method": "XBMC.GetInfoLabels", "params":{"labels" : ["Container.FolderPath"]},"id": "0"}
System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a receive. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
   at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
   at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
   --- End of inner exception stack trace ---
   at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
   at System.Net.PooledStream.Read(Byte[] buffer, Int32 offset, Int32 size)
   at System.Net.Connection.SyncRead(HttpWebRequest request, Boolean userRetrievedStream, Boolean probeRead)
   --- End of inner exception stack trace ---
   at System.Net.HttpWebRequest.GetResponse()
   at vcPlugin.xJsonHttpCommunicator.PostRequest(String strRequest)
26/03/2015 8:29:10 PM 305 [error] plugin error:
System.Exception: Failed to connect to XBMC:
System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a receive. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
   at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
   at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
   --- End of inner exception stack trace ---
   at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
   at System.Net.PooledStream.Read(Byte[] buffer, Int32 offset, Int32 size)
   at System.Net.Connection.SyncRead(HttpWebRequest request, Boolean userRetrievedStream, Boolean probeRead)
   --- End of inner exception stack trace ---
   at System.Net.HttpWebRequest.GetResponse()
   at vcPlugin.xJsonHttpCommunicator.PostRequest(String strRequest)
   at vcPlugin.xJsonHttpCommunicator.PostRequest(String strRequest)
   at vcPlugin.xJsonHttpCommunicator.getObj(String[] allParameters)
   at vcPlugin.xJsonHttpCommunicator.jsonRaw(String[] allParameters, Boolean convertSlashToFwd)
   at vcPlugin.Plugin.doAction(String[] parsedActions, String[] parsedParams)
   at eval_d.eval_ᜃ(macroElement A_0, List`1 A_1, Int32 A_2)

I know this looks like a host thing more so than VC.
If I do a reconnect to webserver it works for a few seconds then decides to drop connection again.
It only ever seems to appear when trying to talk to Kodi on another windows 7 system.
I have a appletv and openelec kodi aswell and this error doesn't appear.
I can run a REST client from chrome on the same system as my server and have no issues, but i think that might connect differently.
I can log onto remote server on the same system as my server without a problem.
And my app on my iPad doesn't have any issues connecting.
I've been hunting logs on both systems and haven't found anything.
This is all the Kodi log saids:
Code: [Select]
   DEBUG: webserver: request received for /jsonrpc
   DEBUG: Previous line repeats 1 times.
   DEBUG: Thread JobWorker 12180 terminating (autodelete)
   DEBUG: webserver: request received for /jsonrpc
   DEBUG: Previous line repeats 1 times.

Does this error mean anything to you or is it something with my server?
Can you see anything there that might be a cause?
Any ideas on what other ways i can problem solve?

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: plugin error: System.Exception -> xJson
« Reply #1 on: March 26, 2015, 11:35:36 AM »
Am I right in thinking this only happens with certain commands and most other stuff is working normally?

If that is the case then the remote server (Kodi) is probably forcibly closing the connection because it doesn't like the command for some reason.  So it's probably not a problem with the server, or your network, or with VC, but with the command.

If this is randomly happening with all sorts of other normal commands like the ones included in the default config then that is another story.

Mace

  • $upporter
  • Contributor
  • *****
  • Posts: 77
  • Karma: 1
    • View Profile
Re: plugin error: System.Exception -> xJson
« Reply #2 on: March 26, 2015, 11:44:30 AM »
The second option.

All sorts of commands, builtin, raw, key strokes. Anything going to the web server.

I'm petty sure its a kodi issue, but seems weird that everything else works (other remote controls) and only have issues with VC.
But only with the windows version.

Beats me.

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2012
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: plugin error: System.Exception -> xJson
« Reply #3 on: March 26, 2015, 12:40:20 PM »
Communicating between 2 W7 machines, I haven't been able to re-create the problem using your example xml or anything else that's in my tree, no matter how hard I try.

If you discover that it tends to be specific commands, you can try posting a few of them for us to test. Without a pattern or decent log info from your Kodi server it'll be a challenge to diagnose.  :(
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

Mace

  • $upporter
  • Contributor
  • *****
  • Posts: 77
  • Karma: 1
    • View Profile
Re: plugin error: System.Exception -> xJson
« Reply #4 on: March 26, 2015, 02:01:25 PM »
Judging from web packets I've been watching, it's got to be Kodi.

I can send commands that work and watch all the data. A minute later send the same command and it fails, but all the packets are the same. Just lacks a return packet form Kodi.

It's weird i can run a command that will send 2 json requests, the first will fail and the second will send. Even the kodi log shows the second part working with {Match. 1.1} sent, obviously because the first part of the command failed there was no 'match' so it sent '{Match. 1.1}' instead.
And then a minute later it will work the other way around.
But doesn't mater what commands are sent, it's all totally random.

It feels like the web server just decides to stop talking for a few seconds.
Was just interested to know if anyone else had the same issues.

Oh well the hunts goes on.....