SDK calls from AWS Lambda all timeout

  • 28 November 2022
  • 0 replies

I’m using the 4.0 Javascript SDK from node based AWS Lambda. I can create a Looker session and login in my JS code, and retrieve tokens, so the session works fine. However, every single call to the SDK itself (sdk.search_users, skd.create_user,,...) all timeout with no error, no docs, nothing but ETIMEOUT.

The exact same code can be extracted from my lambda and run locally on my laptop, so the code, the url and the credentials are all verified as correct. And as I mentioned the session login works in exactly the same way in both environments, so I know that a connection from lambda to Looker can be established. The issue seems to be purely related to the sdk calls. API Explorer also works perfectly.


At this point I can only think of 2 possible issues:
 - Looker itself is not accepting sdk calls from lambdas for some reason..

 - The API URL set in the Looker admin panel is wrong, but again I’ve tried multiple variants, and https://:<INSTACNE_NAME>:443, or   https://:<INSTACNE_NAME>:1999 both work locally when set as LOOKERSDK_BASE_URL, and when set in the Admin panel, so I’m at a loss as to where the issue is.


Looker support have been singulalry unhelpful - every time I’ve reached out to the chat service I get answers along the lines of “we don’t answer SDK questions here”, or a link to something completely unrelated.


Sample code attached below if it helps, any directions on this would be much appreciated.


/* eslint-disable consistent-return */
/* eslint-disable no-restricted-syntax */
const { Looker40SDK, environmentPrefix } = require('@looker/sdk');
const { NodeSession, NodeSettings } = require('@looker/sdk-node');


exports.handler = wrap(async (event) => {

if (!event?.userList) {
logger.error('No User List provided');
return null;

const settings = new NodeSettings(environmentPrefix);
const session = new NodeSession(settings);
const token = await session.login();`Session login tokens: ${JSON.stringify(token)}`);
const sdk = new Looker40SDK(session);

const sessionStatus = await sdk.authSession.isAuthenticated();`SESSION STATUS: ${JSON.stringify(sessionStatus)}`);

// Create Users
userList.forEach(async (user) => {
try {`Check for existing User ${} with email: ${}`);
const existingUsers = await sdk.search_users({
});`Existing users list: ${JSON.stringify(existingUsers)}`);

if (!existingUsers.length) {'Creating Looker user....');

const lookerUser = await sdk.ok(sdk.create_user(
body: {
first_name: user.firstName,
is_disabled: false,
last_name: user.firstName,
models_dir_validated: false
const { id: lookerId } = lookerUser;`Looker User Created for User: ${} -> ${lookerId}`);
await sdk.ok(
{ email: }
));'Email added');

await sdk.ok(
{ user_id: lookerId }));'Group attribute set');

} else {'User already exists');
} catch (error) {
logger.error(`Error creating Looker user: ${JSON.stringify(error)}`);
return {
statusCode: 503,
headers: {
body: JSON.stringify(error),
isBase64Encoded: false,

return {
statusCode: 200,
headers: {
body: 'Looker users created',
isBase64Encoded: false,


0 replies

Be the first to reply!