Looker Studio Custom Connector: “There was an error caused by this connector” when creating metrics

I’m developing a custom connector for Looker Studio (formerly Google Data Studio) to fetch data from a REST API. I’ve successfully deployed the connector and can see the schema, but I’m encountering an error when trying to create metrics in Looker Studio.

Error Message:
When attempting to create a metric, I receive this generic error:
“There was an error caused by this connector.”
Detailed Error Response:

{"dataResponse":[{"dataSubset":[{"requestId":"95f0f810-4706142-20240730","jobRequestUrl":[]}],"errorStatus":{"code":14,"reason":55,"reasonStr":"APPS_SCRIPT_ERROR_EXECUTION_FAILED","uniqueErrorCode":"a807a35b","category":5,"errorCategoryStr":"DATASET_CONFIGURATION","errorDetails":{"appsScriptErrorDetails":{"connectorMessage":{"type":3,"userMessage":"There was an error caused by this connector."}}}}}]}

function getData(request) {
  try {
    var endpoint = request.configParams.apiEndpoint;
    
    console.log('Fetching data from endpoint:', endpoint);
    console.log('Requested fields:', JSON.stringify(request.fields));
    
    var data = fetchData(endpoint);
    console.log('Fetched data:', JSON.stringify(data).slice(0, 500) + '...');
    
    var formattedData = formatData(data, request.fields);
    console.log('Formatted data:', JSON.stringify(formattedData).slice(0, 500) + '...');
    
    var result = { schema: request.fields, rows: formattedData };
    console.log('Returning result:', JSON.stringify(result).slice(0, 500) + '...');
    
    return result;
  } catch (error) {
    console.error('Error in getData:', error);
    throwConnectorError('Detailed error in getData: ' + error.message);
  }
}

function fetchData(endpoint) {
  // ... implementation details ...
}

function formatData(data, requestedFields) {
  // ... implementation details ...
}

function throwConnectorError(message) {
  DataStudioApp.createCommunityConnector()
    .newUserError()
    .setDebugText(message)
    .setText('There was an error in the connector. Please check the deployment logs for more details.')
    .throwException();
}

Added detailed logging throughout the getData, fetchData, and formatData functions.
Implemented error handling with try-catch blocks.
Verified that the API endpoint is accessible and returning data as expected.
Double-checked that the schema defined in getSchema matches the structure of the API response.
Ensured all fields used in Looker Studio are present in the API response.

Questions:

How can I get more detailed error information from Looker Studio or Apps Script to diagnose this issue?
Are there any common pitfalls or gotchas when implementing custom connectors that might cause this type of error?
Is there a way to debug the connector in real-time as Looker Studio is querying it?

Any insights or suggestions on how to resolve this error would be greatly appreciated. Thank you!
Tags: google-data-studio looker-studio google-apps-script api rest custom-connector

New contributor

Amit Jadhav is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật