langgenius/dify · warning · NoAudioUploadedError

no_audio_uploaded

no_audio_uploaded

Error message

Please upload your audio.

What it means

Raised as NoAudioUploadedError (error_code no_audio_uploaded, HTTP 400) at audio.py:73 when AudioService.transcript_asr raises NoAudioUploadedServiceError. The endpoint reads request.files["file"] and the service validates that audio was actually provided; an empty/missing file triggers this. Description is 'Please upload your audio.'

Source

Thrown at api/controllers/console/explore/audio.py:73

        if app_model is None:
            raise AppUnavailableError()

        file = request.files["file"]

        try:
            response = AudioService.transcript_asr(
                app_model=app_model,
                file=file,
                session=db.session(),
                end_user=None,
            )

            return response
        except services.errors.app_model_config.AppModelConfigBrokenError:
            logger.exception("App model config broken.")
            raise AppUnavailableError()
        except NoAudioUploadedServiceError:
            raise NoAudioUploadedError()
        except AudioTooLargeServiceError as e:
            raise AudioTooLargeError(str(e))
        except UnsupportedAudioTypeServiceError:
            raise UnsupportedAudioTypeError()
        except ProviderNotSupportSpeechToTextServiceError:
            raise ProviderNotSupportSpeechToTextError()
        except SpeechToTextDisabledServiceError:
            raise SpeechToTextDisabledError()
        except ProviderTokenNotInitError as ex:
            raise ProviderNotInitializeError(ex.description)
        except QuotaExceededError:
            raise ProviderQuotaExceededError()
        except ModelCurrentlyNotSupportError:
            raise ProviderModelCurrentlyNotSupportError()
        except InvokeError as e:
            raise CompletionRequestError(e.description)
        except ValueError as e:
            raise e

View on GitHub (pinned to ef8544b173)

Solutions

  1. Ensure the upload uses multipart/form-data with a field named exactly 'file'.
  2. Require a non-empty file on the client before enabling submit.
  3. Verify the file survives the HTTP layer (check Content-Length > 0).
  4. Use the same field name the endpoint expects ('file'), not 'audio' or 'upload'.

Example fix

// before
const fd = new FormData(); fd.append('audio', blob);  // wrong field -> 400 no_audio_uploaded
// after
const fd = new FormData(); fd.append('file', blob, 'voice.mp3');
Defensive patterns

Strategy: validation

Validate before calling

function buildAudioFormData(file) {
  if (!file || file.size === 0) throw new Error('no_audio_uploaded');
  const fd = new FormData();
  fd.append('file', file, file.name || 'audio.mp3');
  return fd;
}

Type guard

function isNonEmptyAudioFile(file) { return !!file && typeof file.size === 'number' && file.size > 0; }

Try / catch

try { await fetch(`/installed-apps/${id}/audio-to-text`, { method:'POST', body: buildAudioFormData(file) }); } catch (e) { if (e.code === 'no_audio_uploaded') requireFileSelection(); else throw e; }

Prevention

When it happens

Trigger: POST /installed-apps/<id>/audio-to-text with a multipart body that has no 'file' part, an empty file part, or a file that fails the service's presence check. transcript_asr raises NoAudioUploadedServiceError, mapped to NoAudioUploadedError.

Common situations: Frontend submit before the user selected a file; wrong form field name (not 'file'); file picker cleared before upload; multipart boundary malformed so the part is dropped.

Related errors


AI-assisted analysis of langgenius/dify@ef8544b173 (2026-08-12). Data as JSON: /api/errors/78857e0f6b8b5f9e. Report an issue: GitHub.