The following code will sometimes, return ECONNRESET:
const params = {
model: ...,
view: ...,
fields: [...],
};
const query = await sdk.ok(sdk.create_query(params));
const runParams = {
query_id: query.id,
limit: 1
}
const result = await sdk.ok(sdk.run_query(runParams)) // <-- ECONNRESET
The thing is, there doesn't seem to be an obvious pattern to the problem and Looker API doesn't provide any clues.
Because each invocation in our system is distinct, we don't use an .ini file or env vars, and instead authenticate with Looker on the fly for each request, like this:
const settings = new ApiSettings({
base_url: request.looker_base_url,
});
settings.readConfig = () => {
const cfg = {
base_url: request.looker_base_url,
client_id: request.looker_client_id,
client_secret: request.looker_client_secret,
verify_ssl: true,
timeout: 120,
};
return cfg;
};
const sdk = LookerNodeSDK.init40(settings);
Does anyone have advice on what the issue might be?