moeru-ai/airi · error · Error
Aliyun NLS credentials are incomplete.
Error message
Aliyun NLS credentials are incomplete.
What it means
Thrown by the Aliyun NLS provider's createProvider() when any of accessKeyId, accessKeySecret, or appKey is empty after trimming. The provider cannot construct a realtime transcription client without all three credentials, so it fails fast at provider construction rather than at the first WebSocket attempt.
Source
Thrown at packages/stage-ui/src/libs/providers/providers/aliyun-nls/index.ts:50
description: 'nls-console.aliyun.com',
descriptionLocalize: ({ t }) => t('settings.pages.providers.provider.aliyun-nls.description'),
tasks: ['speech-to-text', 'automatic-speech-recognition', 'asr', 'stt', 'streaming-transcription'],
icon: 'i-lobe-icons:alibabacloud',
capabilities: {
transcription: {
protocol: 'websocket',
generateOutput: false,
streamOutput: true,
streamInput: true,
},
},
createProviderConfig: () => aliyunNlsConfigSchema,
createProvider(config) {
const accessKeyId = config.accessKeyId.trim()
const accessKeySecret = config.accessKeySecret.trim()
const appKey = config.appKey.trim()
if (!accessKeyId || !accessKeySecret || !appKey)
throw new Error('Aliyun NLS credentials are incomplete.')
const provider = createAliyunNLSProvider(accessKeyId, accessKeySecret, appKey, {
region: config.region ?? 'cn-shanghai',
})
return {
transcription: (model: string, extraOptions?: AliyunRealtimeSpeechExtraOptions) => provider.speech(model, {
...extraOptions,
sessionOptions: {
format: 'pcm',
sample_rate: 16000,
enable_punctuation_prediction: true,
enable_intermediate_result: true,
enable_words: true,
...extraOptions?.sessionOptions,
},
}),
} as TranscriptionProviderWithExtraOptions<string, AliyunRealtimeSpeechExtraOptions>View on GitHub (pinned to 27111382b4)
Solutions
- Open the Aliyun NLS provider settings and fill accessKeyId, accessKeySecret, and appKey with the values from the Aliyun console.
- Trim whitespace when pasting keys; re-save and re-select the provider.
- Mark all three fields required in the settings UI so the provider cannot be selected with incomplete credentials.
Example fix
// before
createProvider({ accessKeyId: ' ', accessKeySecret: 'secret', appKey: 'key' })
// after
createProvider({ accessKeyId: 'LTAI...', accessKeySecret: '...', appKey: '...' }) Defensive patterns
Strategy: validation
Validate before calling
function hasAliyunCredentials(config: { accessKeyId: string, accessKeySecret: string, appKey: string }): boolean {
return [config.accessKeyId, config.accessKeySecret, config.appKey]
.every(v => v.trim().length > 0)
}
// before createProvider:
if (!hasAliyunCredentials(config)) {
// mark provider incomplete; do not call createProvider
} Type guard
function isCompleteAliyunConfig(config: unknown): config is { accessKeyId: string, accessKeySecret: string, appKey: string } {
if (!config || typeof config !== 'object') return false
const c = config as Record<string, unknown>
return ['accessKeyId', 'accessKeySecret', 'appKey'].every(k => typeof c[k] === 'string' && (c[k] as string).trim().length > 0)
} Try / catch
try {
const provider = providerAliyunNls.createProvider(config)
}
catch (err) {
if (err instanceof Error && err.message === 'Aliyun NLS credentials are incomplete.') {
// prompt user to fill all three credential fields
}
else throw err
} Prevention
- Mark accessKeyId, accessKeySecret, and appKey required in the settings UI.
- Do not allow selecting the Aliyun NLS provider until all three are non-empty.
- Trim values on save to avoid whitespace-only failures.
When it happens
Trigger: createProvider(config) runs with one or more of config.accessKeyId / config.accessKeySecret / config.appKey blank or whitespace-only. The user saved an Aliyun NLS provider entry without filling all credential fields, or a config import omitted them.
Common situations: User left a credential field empty in settings. Config restored from a backup that did not include secrets. Whitespace pasted with the key. Provider selected before credentials were fully entered.
Related errors
- Vision provider/model not configured
- Failed to create token: ${JSON.stringify(response) || 'Unkno
- Missing model for Gemini TTS
- Failed to create Aliyun NLS token: ${response.Message || 'un
- Replicate provider is not configured. Missing API Key.
AI-assisted analysis of moeru-ai/airi@27111382b4 (2026-08-12).
Data as JSON: /api/errors/55935c71a4de2b77.
Report an issue: GitHub.