When a Looker extension receives responses containing Unicode characters (especially non-Latin characters like Japanese or Chinese) from a backend API, issues occur with the Looker extension proxy.
POST https://{YOUR_ORG_SUBDOMAIN}.cloud.looker.com/api/internal/extension/external_api_proxy/{YOUR_PROJECT_NAME}::{YOUR_EXTENSION_NAME}
500 Internal Server Error
{error: "Uh oh! Something went wrong."}This problem occurs when using the serverProxy method to make requests from the extension to a backend API that returns multibyte Unicode characters.
To solve this problem, we've adopted the following approach:
- Base64 encode response data from the backend
- Decode the Base64 data in the frontend for display
This repository is a minimal configuration sample to reproduce the issue. It provides three API endpoints:
/api/english- Returns English text (works normally)/api/japanese- Returns Japanese text directly (issues occur)/api/japanese-base64- Returns Base64 encoded Japanese text (the solution)
- Google Cloud account
- Google Cloud CLI installation (Installation guide)
- Node.js and npm
- Administrator access to a Looker instance
# Navigate to the backend directory
cd backend
# Build Docker image and upload to container registry
gcloud builds submit --tag gcr.io/[PROJECT_ID]/looker-unicode-backend .
# Deploy to Cloud Run service
gcloud run deploy looker-unicode-backend \
--image gcr.io/[PROJECT_ID]/looker-unicode-backend \
--platform managed \
--region us-central1 \
--allow-unauthenticatedAfter deployment completes, the service URL will be displayed. Make note of this URL:
Service [looker-unicode-backend] revision [looker-unicode-backend-00001-xxx] has been deployed and is serving 100 percent of traffic.
Service URL: https://looker-unicode-backend-[random-string].run.app
# Navigate to the frontend directory
cd frontend
# Create .env file
echo "API_SERVER_URL=https://looker-unicode-backend-[random-string].run.app" > .env# Install dependencies
npm install
# Production build
npm run buildThis will generate a bundle.js file in the root directory of the repository.
To deploy the Looker extension, follow the steps in the official documentation. The basic steps are as follows:
- Log in to your Looker instance and create a new LookML project
- Create a
manifest.lkmlfile with the following content:
project_name: "${YOUR_LOOKER_PROJECT_NAME}" # your looker project name
application: looker-unicode-issue {
label: "Looker Unicode Issue"
file: "bundle.js"
entitlements: {
core_api_methods: ["run_inline_query", "me", "all_connections"]
external_api_urls: ["https://${YOUR_CLOUD_RUN_URL}.run.app"] # your backend (cloud run) url
}
}- Upload the
bundle.jsfile (generated during the build) to your Looker project - Validate the LookML, commit changes, and deploy to production
- Enable the extension and access it from the Looker main menu by selecting "Extensions" → "Looker Unicode Issue"
For detailed instructions, refer to the Looker official documentation "Building a Looker extension".