{"record":{"id":"78857e0f6b8b5f9e","repo":"langgenius/dify","slug":"no-audio-uploaded-78857e","errorCode":"no_audio_uploaded","errorMessage":"Please upload your audio.","messagePattern":"Please upload your audio\\.","errorType":"error_code","errorClass":"NoAudioUploadedError","httpStatus":400,"severity":"warning","filePath":"api/controllers/console/explore/audio.py","lineNumber":73,"sourceCode":"        if app_model is None:\n            raise AppUnavailableError()\n\n        file = request.files[\"file\"]\n\n        try:\n            response = AudioService.transcript_asr(\n                app_model=app_model,\n                file=file,\n                session=db.session(),\n                end_user=None,\n            )\n\n            return response\n        except services.errors.app_model_config.AppModelConfigBrokenError:\n            logger.exception(\"App model config broken.\")\n            raise AppUnavailableError()\n        except NoAudioUploadedServiceError:\n            raise NoAudioUploadedError()\n        except AudioTooLargeServiceError as e:\n            raise AudioTooLargeError(str(e))\n        except UnsupportedAudioTypeServiceError:\n            raise UnsupportedAudioTypeError()\n        except ProviderNotSupportSpeechToTextServiceError:\n            raise ProviderNotSupportSpeechToTextError()\n        except SpeechToTextDisabledServiceError:\n            raise SpeechToTextDisabledError()\n        except ProviderTokenNotInitError as ex:\n            raise ProviderNotInitializeError(ex.description)\n        except QuotaExceededError:\n            raise ProviderQuotaExceededError()\n        except ModelCurrentlyNotSupportError:\n            raise ProviderModelCurrentlyNotSupportError()\n        except InvokeError as e:\n            raise CompletionRequestError(e.description)\n        except ValueError as e:\n            raise e","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/langgenius/dify/blob/ef8544b173fd6cd7a8e71df2cab576e52bebbfbc/api/controllers/console/explore/audio.py#L55-L91","documentation":"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.'","triggerScenarios":"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.","commonSituations":"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.","solutions":["Ensure the upload uses multipart/form-data with a field named exactly 'file'.","Require a non-empty file on the client before enabling submit.","Verify the file survives the HTTP layer (check Content-Length > 0).","Use the same field name the endpoint expects ('file'), not 'audio' or 'upload'."],"exampleFix":"// before\nconst fd = new FormData(); fd.append('audio', blob);  // wrong field -> 400 no_audio_uploaded\n// after\nconst fd = new FormData(); fd.append('file', blob, 'voice.mp3');","handlingStrategy":"validation","validationCode":"function buildAudioFormData(file) {\n  if (!file || file.size === 0) throw new Error('no_audio_uploaded');\n  const fd = new FormData();\n  fd.append('file', file, file.name || 'audio.mp3');\n  return fd;\n}","typeGuard":"function isNonEmptyAudioFile(file) { return !!file && typeof file.size === 'number' && file.size > 0; }","tryCatchPattern":"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; }","preventionTips":["Disable submit until a non-empty file is selected.","Use the field name 'file' in multipart/form-data.","Verify Content-Length > 0 before sending."],"tags":["explore","audio","upload","validation","http-400"],"backgroundTag":null,"analyzedSha":"ef8544b173fd6cd7a8e71df2cab576e52bebbfbc","analyzedAt":"2026-08-12T05:15:17.394Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}