calendar: 190006 "wrong unit for app tenant" on US-unit Lark tenant

Open
#2,866 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
go
Domain
api, backend

Research direction

The report names calendar commands and the raw /open-apis/calendar/v4/calendars request, but no source files or tests. Start by tracing how the lark brand selects the Open API host for calendar calls and compare it with the working Docs or Drive requests. Done means calendar requests on a US-unit tenant succeed for both user and bot identities, with coverage for the host selection behavior.

Written by the indexing model from the issue text.

Description

bug domain/calendar domain/core

Related: #2835 (same error on a Japan-region tenant). Filing separately because this happens on a US-unit tenant, so it doesn't look region-specific to Japan.

Summary

On a Lark (international) tenant hosted in the US unit (*.usttp.larksuite.com), every calendar call fails with error 190006 "wrong unit for app tenant", for both user and bot identities. The same app and token work for Docs, Drive and IM.

Environment

  • lark-cli 1.0.98 (npm), Windows 11, Git Bash
  • App created with --brand lark; config show → "brand": "lark"
  • User identity: token valid, DPoP (dpopMode: preferred)
  • Bot identity: ready
  • User token scopes include all calendar scopes: calendar:calendar:read, calendar:calendar.event:create, calendar:calendar.event:read, calendar:calendar.event:update, calendar:calendar.free_busy:read, etc.

Steps to reproduce

Command Identity Result
lark-cli calendar +freebusy --start 2026-10-29 user 190006
lark-cli calendar +freebusy --start 2026-10-29 --user-id <other user> user 190006
lark-cli calendar +agenda --start 2026-10-29 --end 2026-10-29 user 190006
lark-cli calendar calendars primary user 190006
lark-cli api GET /open-apis/calendar/v4/calendars user 190006
lark-cli calendar +freebusy --start 2026-10-29 --user-id <self> bot 190006

Actual result

{"ok": false, "error": {"type": "api", "subtype": "unknown", "code": 190006, "message": "wrong unit for app tenant"}}

Log IDs:

  • 20261029133455A4483A5B2F39E8A14B8F (+freebusy, user)
  • 20261029133504AB0C4CA237348F9E9BFE (calendars primary, user)
  • 20261029133523241F3E9E8107699E4661 (+freebusy, bot)
  • 20261029133614649D9ACC7EFA3F9D628F (raw GET /open-apis/calendar/v4/calendars, user)

Expected result

Calendar data is returned, the same way other domains work on this tenant.

What works on the same tenant

docs +search, docs +fetch, Drive comment listing, IM. Credentials and scopes appear correct.

Notes

  • The bot (tenant token) fails the same way as the DPoP user token, so DPoP doesn't look like the cause.
  • The lark brand seems to send all services to https://open.larksuite.com, and config set only supports dpop. Calendar may need a unit-specific Open API host for tenants outside the default unit.
  • Request: a config option to set the Open API host (globally or per service), or auto-detect the tenant's unit.
Dominant language
Go
Stars
18.2k
Forks
1.4k
Avg merge
1d 3h
Merged PRs (30d)
18

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from larksuite/cli

All issues in larksuite/cli

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.