Below is the account list command that works fine locally but fails on the tenant. I have played around with page size and it makes no difference. Connection error happens right after the first res.send( …) command. As you can see from error logs below code it only takes 2 sec to go thru the first loop so definitely not a timeout issue.
Connector aggregation stops with error right after ConnectionErorr occurs @ [2023-07-27T09:21:49.277-05:00], even thought as you can see in the logs aggregation continues.
.stdAccountList(async (context: Context, input: StdAccountListInput, res: Response<StdAccountListOutput>)=> {
const resultsCount = await myClient.getAllUsersCount()
let offset = 0
const pageSize = 10
logger.info(`stdAccountList resultsCount = ${resultsCount}`)
while (offset < resultsCount) {
logger.info(`offset ${offset}`)
myClient.getAllUsersPaging(offset, pageSize).then((users) => {
users.forEach(user => {
logger.info(`processing ${user.firstName} account`)
res.keepAlive()
res.send({
identity: user.externalId ? user.externalId : '',
uuid: user.id ? user.id.toString() : '',
attributes: {
firstName: user.firstName ? user.firstName : '',
lastName: user.lastName ? user.lastName : '',
email: user.emails ? (user.emails.length > 0 ? user.emails[0].address : '') : '',
}
})
})
}).catch(logger.error)
offset += pageSize
}
})
sail conn logs tail
[2023-07-27T09:21:11.282-05:00] INFO | updateTag ▶︎ updated connector tag latest to version: 16
[2023-07-27T09:21:47.030-05:00] INFO | invokeCommand ▶︎ Command execution started : std:account:list, for connector version 16.
[2023-07-27T09:21:47.150-05:00] INFO | invokeCommand ▶︎ Command invocation complete : std:account:list, for connector version: 16. Elapsed time 120.336264ms
[2023-07-27T09:21:47.737-05:00] INFO | connectorMessage ▶︎ {"commandType":"std:account:list","invocationId":"","message":"-------------------------------------------AxiosWrapper created\n","version":16}
[2023-07-27T09:21:47.847-05:00] INFO | connectorMessage ▶︎ {"commandType":"std:account:list","invocationId":"","message":"stdAccountList resultsCount = 1023","version":16}
[2023-07-27T09:21:47.847-05:00] INFO | connectorMessage ▶︎ {"commandType":"std:account:list","invocationId":"","message":"-------------------------------------------AxiosWrapper created\n","version":16}
[2023-07-27T09:21:47.850-05:00] INFO | connectorMessage ▶︎ {"commandType":"std:account:list","invocationId":"","message":"offset 0","version":16}
[2023-07-27T09:21:49.263-05:00] INFO | connectorMessage ▶︎ {"commandType":"std:account:list","invocationId":"","message":"processing Joe account","version":16}
[2023-07-27T09:21:49.264-05:00] INFO | commandResponse ▶︎ {"commandType":"std:account:list","completed":false,"elapsed":2104,"invocationId":"","message":"command response processed. output_count=0 keep_alive_count=1 state_count=0","requestId":"e0a2ed05-54c1-4244-8c05-84ae9819d265","version":null}
[2023-07-27T09:21:49.267-05:00] INFO | connectorMessage ▶︎ {"commandType":"std:account:list","invocationId":"","message":"processing Andrew account","version":16}
[2023-07-27T09:21:49.267-05:00] INFO | connectorMessage ▶︎ {"commandType":"std:account:list","invocationId":"","message":"processing Jane account","version":16}
[2023-07-27T09:21:49.267-05:00] INFO | connectorMessage ▶︎ {"commandType":"std:account:list","invocationId":"","message":"processing Lidya account","version":16}
[2023-07-27T09:21:49.267-05:00] INFO | connectorMessage ▶︎ {"commandType":"std:account:list","invocationId":"","message":"processing Corina account","version":16}
[2023-07-27T09:21:49.267-05:00] INFO | connectorMessage ▶︎ {"commandType":"std:account:list","invocationId":"","message":"processing Alex account","version":16}
[2023-07-27T09:21:49.267-05:00] INFO | connectorMessage ▶︎ {"commandType":"std:account:list","invocationId":"","message":"processing Don account","version":16}
[2023-07-27T09:21:49.267-05:00] INFO | connectorMessage ▶︎ {"commandType":"std:account:list","invocationId":"","message":"processing Michelle account","version":16}
[2023-07-27T09:21:49.267-05:00] INFO | connectorMessage ▶︎ {"commandType":"std:account:list","invocationId":"","message":"processing Caroline account","version":16}
[2023-07-27T09:21:49.267-05:00] INFO | connectorMessage ▶︎ {"commandType":"std:account:list","invocationId":"","message":"processing Prod Test account","version":16}
[2023-07-27T09:21:49.277-05:00] INFO | commandOutcome ▶︎ {"commandType":"std:account:list","completed":true,"elapsed":2118,"error":"[ConnectorError] error receiving response from connector: stream client connection is broken (connector process may have crashed)","invocationId":"","message":"command failed","requestId":"e0a2ed05-54c1-4244-8c05-84ae9819d265","version":null}
[2023-07-27T09:22:17.861-05:00] INFO | connectorMessage ▶︎ {"commandType":"std:account:list","invocationId":"","message":"offset 10","version":16}
[2023-07-27T09:22:17.862-05:00] INFO | connectorMessage ▶︎ {"commandType":"std:account:list","invocationId":"","message":"-------------------------------------------AxiosWrapper created\n","version":16}
[2023-07-27T09:22:22.360-05:00] INFO | connectorMessage ▶︎ {"commandType":"std:account:list","invocationId":"","message":"processing Jim account","version":16}
[2023-07-27T09:22:22.361-05:00] INFO | connectorMessage ▶︎ {"commandType":"std:account:list","invocationId":"","message":"processing David account","version":16}
[2023-07-27T09:22:22.361-05:00] INFO | connectorMessage ▶︎ {"commandType":"std:account:list","invocationId":"","message":"processing Prasad account","version":16}
[2023-07-27T09:22:22.361-05:00] INFO | connectorMessage ▶︎ {"commandType":"std:account:list","invocationId":"","message":"processing William account","version":16}
[2023-07-27T09:22:22.361-05:00] INFO | connectorMessage ▶︎ {"commandType":"std:account:list","invocationId":"","message":"processing Josh account","version":16}
[2023-07-27T09:22:22.361-05:00] INFO | connectorMessage ▶︎ {"commandType":"std:account:list","invocationId":"","message":"processing Jacob account","version":16}
[2023-07-27T09:22:22.361-05:00] INFO | connectorMessage ▶︎ {"commandType":"std:account:list","invocationId":"","message":"processing Charlie account","version":16}
[2023-07-27T09:22:22.361-05:00] INFO | connectorMessage ▶︎ {"commandType":"std:account:list","invocationId":"","message":"processing Clare account","version":16}
[2023-07-27T09:22:22.361-05:00] INFO | connectorMessage ▶︎ {"commandType":"std:account:list","invocationId":"","message":"processing Jack account","version":16}
[2023-07-27T09:22:22.361-05:00] INFO | connectorMessage ▶︎ {"commandType":"std:account:list","invocationId":"","message":"processing James account","version":16}