Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pdu command length error #230

Open
ijoe7 opened this issue May 7, 2023 · 2 comments
Open

Pdu command length error #230

ijoe7 opened this issue May 7, 2023 · 2 comments

Comments

@ijoe7
Copy link

ijoe7 commented May 7, 2023

Hello I have this issue while connecting to a server:

App running on Port: 5000
2023-05-07T19:21:15.811Z - cli - 878563 - server.connected - connected to server - {"secure":false} - [172.31.34.175]
2023-05-07T19:21:15.812Z - cli - 878563 - pdu.command.out - bind_transceiver - {"command":"bind_transceiver","command_length":0,"command_id":9,"command_status":0,"sequence_number":1,"system_id":"****","password":"****","system_type":"","interface_version":80,"addr_ton":0,"addr_npi":0,"address_range":""} - [172.31.34.175]
2023-05-07T19:21:15.813Z - cli - 878563 - socket.data.out -  - {"bytes":37} - [172.31.34.175]
2023-05-07T19:21:15.815Z - cli - 878563 - socket.data.in -  - {"bytes":309} - [172.31.34.175]
2023-05-07T19:21:15.815Z - cli - 878563 - pdu.command.error - PDU length was too large (1213486160, maximum is 16384). - {} - [172.31.34.175]
SMPP session error: Error: PDU length was too large (1213486160, maximum is 16384).
    at PDU.commandLength (/usr/src/app/node_modules/smpp/lib/pdu.js:50:9)
    at Session._extractPDUs (/usr/src/app/node_modules/smpp/lib/smpp.js:188:32)

I don't know if you know what could be causing this, because I have tried rewriting the code but I keep getting the same issue.

@ijoe7
Copy link
Author

ijoe7 commented May 7, 2023

An update on the error:

2023-05-07T20:35:00.767Z - cli - 901491 - server.connected - connected to server - {"secure":false} - [172.31.34.175]
2023-05-07T20:35:00.767Z - cli - 901491 - pdu.command.out - bind_transceiver - {"command":"bind_transceiver","command_length":0,"command_id":9,"command_status":0,"sequence_number":1,"system_id":"****","password":"****","system_type":"","interface_version":80,"addr_ton":0,"addr_npi":0,"address_range":""} - [172.31.34.175]
2023-05-07T20:35:00.768Z - cli - 901491 - socket.data.out -  - {"bytes":37} - [172.31.34.175]
2023-05-07T20:35:00.770Z - cli - 901491 - socket.data.in -  - {"bytes":309} - [172.31.34.175]
2023-05-07T20:35:00.771Z - cli - 901491 - pdu.command.error - PDU length was too large (1213486160, maximum is 16384). - {} - [172.31.34.175]
SMPP session error: Error: PDU length was too large (1213486160, maximum is 16384).
    at PDU.commandLength (/usr/src/app/node_modules/smpp/lib/pdu.js:50:9)
    at Session._extractPDUs (/usr/src/app/node_modules/smpp/lib/smpp.js:188:32)
DB connected...
2023-05-07T20:35:10.770Z - cli - 901491 - pdu.command.out - enquire_link - {"command":"enquire_link","command_length":0,"command_id":21,"command_status":0,"sequence_number":2} - [172.31.34.175]
2023-05-07T20:35:10.770Z - cli - 901491 - socket.data.out -  - {"bytes":16} - [172.31.34.175]
2023-05-07T20:35:20.778Z - cli - 901491 - pdu.command.out - enquire_link - {"command":"enquire_link","command_length":0,"command_id":21,"command_status":0,"sequence_number":3} - [172.31.34.175]
2023-05-07T20:35:20.779Z - cli - 901491 - socket.data.error -  - {"error":"Cannot write command enquire_link to socket","errorType":"socket_write_error"} - [172.31.34.175]
2023-05-07T20:35:20.780Z - cli - 901491 - socket.error - write EPIPE - {"errno":-32,"code":"EPIPE","syscall":"write"} - [172.31.34.175]
SMPP session error: Error: write EPIPE
    at afterWriteDispatched (node:internal/stream_base_commons:160:15)
    at writeGeneric (node:internal/stream_base_commons:151:3) {
  errno: -32,
  code: 'EPIPE',
  syscall: 'write'
}
2023-05-07T20:35:20.783Z - cli - 901491 - server.disconnected - disconnected from server -  - [172.31.34.175]
SMPP session closed

@franckck
Copy link

franckck commented Jan 4, 2024

Hello @ijoe7

To solve this error : 2023-05-07T19:21:15.815Z - cli - 878563 - pdu.command.error - PDU length was too large (1213486160, maximum is 16384). - {} - [172.31.34.175]

Update PDU maximum length global variable in your main application file like that :
const smpp = require('smpp');
smpp.PDU.maxLength = 1213486165

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants