← スキル一覧に戻る
1.
2.
3.
4.

gallery-sync-troubleshooting
by canyouseeus
THE LOST+UNFOUNDS - Modern web application
⭐ 0🍴 0📅 2026年1月23日
SKILL.md
name: Gallery Sync Troubleshooting description: How to diagnose and fix Google Drive gallery sync issues in production and local
Gallery Sync Troubleshooting
Quick Test Commands
Production:
curl -s "https://www.thelostandunfounds.com/api/gallery/sync?slug=last-night"
Local:
curl -s "http://localhost:3001/api/gallery/sync?slug=last-night"
Common Errors & Fixes
1. DECODER routines::unsupported
Cause: Private key newlines are not properly parsed from Vercel env vars.
Fix: Ensure key parsing in api/gallery/[...path].ts uses:
let GOOGLE_KEY = (rawKey || '')
.replace(/\\n/g, '\n') // Handle literal \n strings
.replace(/"/g, '')
.trim();
Re-upload key from local:
source .env.local && echo "$GOOGLE_SERVICE_ACCOUNT_PRIVATE_KEY" | npx vercel env add GOOGLE_SERVICE_ACCOUNT_PRIVATE_KEY production --force
2. invalid_grant: account not found
Cause: Service account email doesn't match the private key.
Fix:
echo 'the-gallery-agent@the-lost-and-unf-1737406545588.iam.gserviceaccount.com' | npx vercel env add GOOGLE_SERVICE_ACCOUNT_EMAIL production --force
3. Missing credentials
Cause: Environment variables not set in Vercel.
Verify with:
npx vercel env ls production
Required vars:
GOOGLE_SERVICE_ACCOUNT_EMAILGOOGLE_SERVICE_ACCOUNT_PRIVATE_KEYSUPABASE_URLSUPABASE_SERVICE_ROLE_KEY
4. Library not found or No Google Drive folder ID
Cause: Library doesn't exist in DB or missing google_drive_folder_id.
Check in Supabase:
SELECT slug, google_drive_folder_id FROM photo_libraries;
After Updating Env Vars
Always trigger a redeploy:
git commit --allow-empty -m "Trigger redeploy" && git push origin main
Key Files
- Production API:
api/gallery/[...path].ts(inlinedsyncGalleryPhotos) - Local Server:
local-server.js→/api/gallery/synchandler - Original Utils:
lib/api-handlers/_photo-sync-utils.ts
スコア
総合スコア
50/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
○LICENSE
ライセンスが設定されている
0/10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
レビュー
💬
レビュー機能は近日公開予定です