juks / iso-8583-socket-queue

ISO 8583 gateway
MIT License
194 stars 111 forks source link

Socket is not connected yet #32

Closed sihameed closed 6 years ago

sihameed commented 6 years ago

Hi Igor,

Need your help again :-). In my previous question, i only test the sign-on message only, and sign-on/echo message is working fine. But when i sent the transaction, SQ doesn't give any response.

SQ command: node socketQueue.js --upstreamHost=127.0.0.1 --upstreamPort=333 --listenHttpPort=8080 --vv --logFile=log.txt --lengthHeaderType=hex --overrides=1:bitmap-hex:8,39:fixed-n:2 --hostConfig upg

http post data: { "0": "0100", "3": "182000", "4":"000002500000", "11": "398621", "12": "193006", "13": "0116", "22": "018", "32": "005", "37": "000317155212", "41": "00000882", "43": "Internet", "48": "1010 000000025000", "49": "360", "98":"087882837160" }

SQ log:

http:::ffff:127.0.0.1:41164
================================================================================================
     Message Type Indicator [0].......................0100
     Bitmap [1].......................................b038040108a180000000000040000000
     Processing Code [3]..............................182000
     Amount, Transaction [4]..........................000002500000
     System Trace Audit Number [11]...................398621
     Time, Local Transaction [12].....................000000193006
     Date, Local Transaction [13].....................0116
     Pos Entry Mode [22]..............................018 (Card Data Input Mode: <Manual>)
     Acquiring Institution Ident Code [32]............005
     Retrieval Reference Number [37]..................000317155212
     Card Acceptor Terminal Identification [41].......00000882
     Merchant Location [43]...........................Internet
     Additional Data [48].............................1010  000000025000
     Currency code, transaction [49]..................360
     Payee [98].......................................087882837160

================================================================================================

2018-06-08 09:48:50 - info: Writing to queue http:::ffff:127.0.0.1:41164 [0]                         
2018-06-08 09:48:50 - info: New queue item 16                         
2018-06-08 09:48:50 - info: Processing queue [pending 1 / total 1]                         
2018-06-08 09:48:50 - verbose: Queue keys dump: 16                         
2018-06-08 09:48:50 - info: Upstreaming data for http:::ffff:127.0.0.1:41164                         
2018-06-08 09:48:50 - verbose: [..0100b0...]                         
2018-06-08 09:48:50 - info: Upstream <end>                         
2018-06-08 09:48:50 - info: Upstream <close>                         
2018-06-08 09:48:50 - info: Dropping all active clients                         
2018-06-08 09:48:50 - info: Connecting to upstream server 127.0.0.1:333                         
2018-06-08 09:48:50 - info: Processing queue [pending 0 / total 1]                         
2018-06-08 09:48:50 - verbose: Queue keys dump: 16                         
2018-06-08 09:48:50 - info: Socket is not connected yet...                         
2018-06-08 09:48:50 - info: Connected to upstream 127.0.0.1:333!                         
2018-06-08 09:48:50 - info: Processing queue [pending 0 / total 1]                         
2018-06-08 09:48:50 - verbose: Queue keys dump: 16                         
2018-06-08 09:48:50 - info: Client http:::ffff:127.0.0.1:41164 <close> event                         
2018-06-08 09:48:50 - verbose: Releasing terminal 00000882 with the key 16                         
2018-06-08 09:48:50 - info: Warning: client http:::ffff:127.0.0.1:41164 [queue id 16] terminated activity                         
2018-06-08 09:48:50 - info: Processing queue [pending 0 / total 0]                         
2018-06-08 09:48:50 - info: The queue is empty 

Note: I add new MTI 0100 in the packager "upg"

Why SQ printed out "Socket is not connected yet.."? Can we set SQ send echo message regularly into host?

Please help...

sihameed commented 6 years ago

Hi Igor,

I just found exception in our host when receive the message.

Below host exception when i trigger transaction:

<log realm="ON2.channel/127.0.0.1:41306" at="Fri Jun 08 11:18:01 WIB 2018.316" lifespan="321026ms">
  <receive>
    <iso-exception>
      org.jpos.iso.IFA_LLLCHAR: Problem unpacking field 48 (java.lang.ArrayIndexOutOfBoundsException: 181) unpacking field=48, consumed=146
      org.jpos.iso.ISOException: org.jpos.iso.IFA_LLLCHAR: Problem unpacking field 48 (java.lang.ArrayIndexOutOfBoundsException: 181) unpacking field=48, consumed=146
    at org.jpos.iso.ISOBasePackager.unpack(ISOBasePackager.java:261)
    at org.jpos.iso.ISOMsg.unpack(ISOMsg.java:478)
    at org.jpos.iso.BaseChannel.unpack(BaseChannel.java:963)
    at org.jpos.iso.BaseChannel.receive(BaseChannel.java:690)
    at org.jpos.iso.ISOServer$Session.run(ISOServer.java:130)
    at org.jpos.util.ThreadPool$PooledThread.run(ThreadPool.java:71)
    </iso-exception>
    --- data ---
    0000  30 31 30 30 62 30 33 38  30 34 30 31 30 38 61 31  0100b038040108a1
0010  38 30 30 30 30 30 30 30  30 30 30 30 34 30 30 30  8000000000004000
0020  30 30 30 30 31 38 32 30  30 30 30 30 30 30 30 32  0000182000000002
0030  35 30 30 30 30 30 33 39  38 36 32 31 30 30 30 30  5000003986210000
0040  30 30 31 39 33 30 30 36  30 31 31 36 30 31 38 30  0019300601160180
0050  33 30 30 35 30 30 30 33  31 37 31 35 35 32 31 32  3005000317155212
0060  30 30 30 30 30 30 31 31  30 30 30 30 30 30 30 30  0000001100000000
0070  30 30 30 30 30 30 30 30  30 30 30 30 30 30 30 30  0000000000000000
0080  30 30 30 30 30 30 30 30  49 6E 74 65 72 6E 65 74  00000000Internet
0090  30 31 37 31 30 31 30 20  30 30 30 30 30 30 30 32  0171010 00000002
00a0  35 30 30 30 33 36 30 31  32 30 38 37 38 38 32 38  5000360120878828
00b0  33 37 31 36 30                                    37160

  </receive>
</log>
<log realm="ON2-server.server.session/127.0.0.1" at="Fri Jun 08 11:18:01 WIB 2018.317">
  <session-error>
    <iso-exception>
      org.jpos.iso.IFA_LLLCHAR: Problem unpacking field 48 (java.lang.ArrayIndexOutOfBoundsException: 181) unpacking field=48, consumed=146
      org.jpos.iso.ISOException: org.jpos.iso.IFA_LLLCHAR: Problem unpacking field 48 (java.lang.ArrayIndexOutOfBoundsException: 181) unpacking field=48, consumed=146
    at org.jpos.iso.ISOBasePackager.unpack(ISOBasePackager.java:261)
    at org.jpos.iso.ISOMsg.unpack(ISOMsg.java:478)
    at org.jpos.iso.BaseChannel.unpack(BaseChannel.java:963)
    at org.jpos.iso.BaseChannel.receive(BaseChannel.java:690)
    at org.jpos.iso.ISOServer$Session.run(ISOServer.java:130)
    at org.jpos.util.ThreadPool$PooledThread.run(ThreadPool.java:71)
    </iso-exception>
  </session-error>
</log>

Seems like there is misconfiguration from my SQ, but i still don't know what it is.

sihameed commented 6 years ago

Hi Igor.

I found the error, i have wrong setting and wrong request. After fixing it, its running well.

Thanks

juks commented 6 years ago

OK.

"Socket is not connected yet" means there is no connection with the upstream host at the moment.