Operations
Troubleshooting
Common debugging paths for City, client, token, and env.
client returns 401
Check:
- whether the request includes
Authorization: Bearer <user_token> - whether the token has expired
- whether City has
DOWNCITY_FEDERATION_TOKEN_SIGNING_KEYconfigured - whether the token was issued by the current City
- whether
city_idmatches the city embedded in the token
client returns 403
Check:
- whether the
city_idin the request matches the city bound to the currentuser_token - whether the city bound to the token has been paused
- whether the target city was
activewhen the admin side issued the token
client returns 404
Check:
- whether the HTTP route is correct
- whether the target service has been registered in City
- whether the target city existed when the admin side issued the token
model not found or handler not hit
Check:
- whether the client-provided
modelhas been registered throughProvider.model()+AIService.use() - whether the target model includes the required action for the current pathway, such as
text,stream, orimage - whether the current pathway has a default model, such as
default: trueordefault: ["text"] - whether
client.ai.listModels()can see the model
These cases usually return 422.
City returns 500
Check:
- whether City has both
DOWNCITY_FEDERATION_TOKEN_SIGNING_KEYandDOWNCITY_FEDERATION_ADMIN_SECRET_KEY - whether the target service has a registered handler
- whether the handler or provider call threw an error without
statusCode - whether the
onErrorhook recorded the original error
provider call failed
Check:
- whether the matching key exists in City
.env - whether the handler reads the correct
ctx.envfield - whether model
metamatches the current provider calling style
usage not recorded
Check:
- whether the
afterhook is registered on the target service, or whethernew UsageService()is enabled - whether the record logic depends on an output field that the handler did not return
- whether the logging service swallowed an exception