IPCConnectedFactoryExchange / CFX

Apache License 2.0
75 stars 69 forks source link

ExecuteRequest throws "Unexpected character encountered while parsing value: . Path '', line 0, position 0" #114

Closed LanceUppercut closed 3 years ago

LanceUppercut commented 3 years ago

Hello,

When calling ExecuteRequest, the following JSON parse exception is thrown:

ERROR MESSAGE: Unexpected character encountered while parsing value: . Path '', line 0, position 0. at CFX.Transport.AmqpCFXEndpoint.d__138.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at CFX.Transport.AmqpCFXEndpoint.ExecuteRequest(String targetUri, CFXEnvelope request) at CGC.HellerRecipeExtractor.Service.CFXController.Connect() in.....

I'm running RabbitMQ 3.8.12 locally with amqp1.0 plugin enabled. I'm trying to retrieve the recipe running on a Heller oven. The Heller CFX app and my .NET app are all running locally. I created a new exchange called "Heller".

Below is the code to create the envelope and call ExecuteRequest - taken from the Demo app on GitHub.

CFXEnvelope env = new CFXEnvelope()
{
    Source = MyEndpoint.CFXHandle,
    Target = hellerHandle,
    MessageBody = new  AreYouThereRequest()
    {
        CFXHandle = myHandle
    }
};

env.Source = myHandle;
env.Target = hellerHandle;
CFXEnvelope response = null;

try
{
    response = MyEndpoint.ExecuteRequest(hellerUri, env);
}
catch (Exception x)
{
    logger.Error($"ERROR OCCURRED MAKING REQUEST TO {hellerUri}, handle {hellerHandle}.\nERROR MESSAGE:  {x.Message} \n{x.StackTrace}");
}

Here's the CFX log:

Info: 2021-03-02T09:38:27.6207836+00:00 Connecting to amqp://localhost:5672/ SEND AMQP 3 1 0 0 SEND AMQP 3 1 0 0 SEND AMQP 3 1 0 0 Info: 2021-03-02T09:38:27.6478469+00:00 Connected to amqp://localhost:5672/. Establishing Links... RECV sasl-mechanisms(sasl-server-mechanisms:[ANONYMOUS,AMQPLAIN,PLAIN]) RECV AMQP 0 1 0 0 RECV AMQP 0 1 0 0 SEND AMQP 0 1.0.0 SEND (ch=0) begin(remote-channel:0,next-outgoing-id:4294967293,incoming-window:2048,outgoing-window:2048,handle-max:63) RECV (ch=0) attach(name:/exchange/Heller,handle:0,role:True,snd-settle-mode:Unsettled,rcv-settle-mode:First,source:source(durable:0,timeout:0,dynamic:False),target:target(address:/exchange/Heller,durable:0,timeout:0,dynamic:False),incomplete-unsettled:False,initial-delivery-count:0,max-message-size:0) SEND (ch=0) attach(name:/exchange/Heller,handle:0,role:False,snd-settle-mode:Unsettled,rcv-settle-mode:First,source:source(durable:0,timeout:0,dynamic:False),target:target(address:/exchange/Heller,durable:0,timeout:0,dynamic:False),incomplete-unsettled:False,initial-delivery-count:0,max-message-size:0) RECV (ch=0) begin(remote-channel:0,next-outgoing-id:0,incoming-window:65535,outgoing-window:65535,handle-max:63) RECV (ch=0) flow(next-in-id:4294967293,in-window:65535,next-out-id:0,out-window:65535,handle:0,delivery-count:0,link-credit:65536,available:0,drain:False,echo:False) RECV sasl-outcome(code:Ok) Debug: 2021-03-02T09:38:27.6548654+00:00 sender-/exchange/Heller Enqueuing 1 messages. RECV (ch=0) open(container-id:rabbit@MyWorkStation,max-frame-size:250000,channel-max:0,idle-time-out:60000,properties:[cluster_name:rabbit@MyWorkStation,copyright:Copyright (c) 2007-2021 VMware, Inc. or its affiliates.,information:Licensed under the MPL 2.0. Website: https://rabbitmq.com,platform:Erlang/OTP 23.2.6,product:RabbitMQ,version:3.8.12]) Debug: 2021-03-02T09:38:27.7792208+00:00 sender-/exchange/Heller Triggering Processing... Debug: 2021-03-02T09:38:31.9063537+00:00 sender-/exchange/Heller Attempting to process queued messages... Debug: 2021-03-02T09:38:33.7618217+00:00 GZIP Compressed Message(s) of Size 346 bytes to 250 bytes Debug: 2021-03-02T09:38:33.7628243+00:00 GZIP Compressed Message(s) of Size 395 bytes to 283 bytes SEND AMQP 3 1 0 0 RECV sasl-mechanisms(sasl-server-mechanisms:[ANONYMOUS]) SEND sasl-init(mechanism:ANONYMOUS,initial-response:...) RECV sasl-outcome(code:Ok) RECV AMQP 0 1 0 0 RECV (ch=0) begin(remote-channel:0,next-outgoing-id:0,incoming-window:2048,outgoing-window:2048,handle-max:63) RECV (ch=0) open(container-id:ContainerHost-4f7aacdec80a4807bca6d630e283aad4,host-name:10.162.14.104,max-frame-size:262144,channel-max:255,idle-time-out:2147483647) SEND (ch=0) attach(name:request-receiver,handle:0,role:True,snd-settle-mode:Unsettled,rcv-settle-mode:First,source:source(address:Heller.Reflow.1707-Line,durable:0,timeout:0,dynamic:False),target:target(address:CGControls.Heller.RecipeExtractor,durable:0,timeout:0,dynamic:False),incomplete-unsettled:False,initial-delivery-count:0,max-message-size:0) SEND (ch=0) begin(remote-channel:0,next-outgoing-id:4294967293,incoming-window:2048,outgoing-window:2048,handle-max:63) SEND (ch=0) flow(next-in-id:0,in-window:2048,next-out-id:4294967293,out-window:2048,handle:0,delivery-count:0,link-credit:300,available:0,drain:False,echo:False) SEND AMQP 0 1.0.0 SEND (ch=0) attach(name:CGControls.Heller.RecipeExtractor,handle:1,role:False,snd-settle-mode:Unsettled,rcv-settle-mode:First,source:source(durable:0,timeout:0,dynamic:False),target:target(address:Heller.Reflow.1707-Line,durable:0,timeout:0,dynamic:False),incomplete-unsettled:False,initial-delivery-count:0,max-message-size:0) SEND (ch=0) open(container-id:AMQPNetLite-201dc026,host-name:10.162.14.104,max-frame-size:262144,channel-max:255,idle-time-out:2147483647) RECV (ch=0) attach(name:request-receiver,handle:0,role:False,snd-settle-mode:Unsettled,rcv-settle-mode:First,source:source(address:Heller.Reflow.1707-Line,durable:0,timeout:0,dynamic:False),target:target(address:CGControls.Heller.RecipeExtractor,durable:0,timeout:0,dynamic:False),incomplete-unsettled:False,initial-delivery-count:0,max-message-size:0) RECV (ch=0) attach(name:request-receiver,handle:0,role:False,snd-settle-mode:Unsettled,rcv-settle-mode:First,source:source(address:Heller.Reflow.1707-Line,durable:0,timeout:0,dynamic:False),target:target(address:CGControls.Heller.RecipeExtractor,durable:0,timeout:0,dynamic:False),incomplete-unsettled:False,initial-delivery-count:0,max-message-size:0) RECV (ch=0) attach(name:CGControls.Heller.RecipeExtractor,handle:1,role:True,snd-settle-mode:Unsettled,rcv-settle-mode:First,source:source(durable:0,timeout:0,dynamic:False),target:target(address:Heller.Reflow.1707-Line,durable:0,timeout:0,dynamic:False),incomplete-unsettled:False,initial-delivery-count:0,max-message-size:0) SEND (ch=0) transfer(handle:0,delivery-id:0,delivery-tag:00000001,message-format:0,settled:False,more:False,rcv-settle-mode:First,resume:False,aborted:False,batchable:False) payload 554 SEND (ch=0) transfer(handle:1,delivery-id:0,delivery-tag:00000001,message-format:0,settled:False,more:False,rcv-settle-mode:First,resume:False,aborted:False,batchable:False) payload 553 RECV (ch=0) disposition(role:True,first:0,last:0,settled:True,state:accepted(),batchable:False) Debug: 2021-03-02T09:38:33.8395512+00:00 sender-/exchange/Heller 1 messages transmitted. 0 messages remaining in spool. RECV (ch=0) disposition(role:True,first:0,last:0,settled:True,state:accepted(),batchable:False) RECV (ch=0) close(error:error(condition:amqp:internal-error,description:Unexpected character encountered while parsing value: . Path '', line 0, position 0.)) SEND (ch=0) close() Error: 2021-03-02T09:38:33.8505540+00:00 Unexpected character encountered while parsing value: . Path '', line 0, position 0. Error: 2021-03-02T09:38:33.8575720+00:00 at Amqp.ReceiverLink.ReceiveInternal(MessageCallback callback, Int32 timeout) in C:\Users\mqt\repo\amqpnetlite.rel\src\ReceiverLink.cs:line 472 at Amqp.ReceiverLink.Receive(TimeSpan timeout) in C:\Users\mqt\repo\amqpnetlite.rel\src\ReceiverLink.cs:line 235 at CFX.Transport.AmqpCFXEndpoint.d__138.MoveNext() SEND (ch=0) detach(handle:0,closed:True) RECV (ch=0) detach(handle:0,closed:False)

LanceUppercut commented 3 years ago

Resolved the issue. Heller CFX node and my .NET node using different versions of the CFX dll.