FlowiseAI/Flowise · warning · Error
Error fetching model list
Error message
Error fetching model list
What it means
Thrown by getRawModelFile() when the configured MODEL_LIST_CONFIG_JSON is a valid URL, the HTTP request completes, but the response status is not 200 or the data is empty. The model list is fetched to populate provider/model dropdowns; a non-200 (e.g. 404, 500, redirect) or empty body triggers this. The error is thrown inside a try block whose catch (line 54) falls back to the local models.json, so callers of getRawModelFile normally never see it.
Source
Thrown at packages/components/src/modelLoader.ts:45
return false
}
return url.protocol === 'http:' || url.protocol === 'https:'
}
/**
* Load the raw model file from either a URL or a local file
* If any of the loading fails, fallback to the default models.json file on disk
*/
const getRawModelFile = async () => {
const modelFile =
process.env.MODEL_LIST_CONFIG_JSON ?? 'https://raw.githubusercontent.com/FlowiseAI/Flowise/main/packages/components/models.json'
try {
if (isValidUrl(modelFile)) {
const resp = await axios.get(modelFile)
if (resp.status === 200 && resp.data) {
return resp.data
} else {
throw new Error('Error fetching model list')
}
} else if (fs.existsSync(modelFile)) {
const models = await fs.promises.readFile(modelFile, 'utf8')
if (models) {
return JSON.parse(models)
}
}
throw new Error('Model file does not exist or is empty')
} catch (e) {
const models = await fs.promises.readFile(getModelsJSONPath(), 'utf8')
if (models) {
return JSON.parse(models)
}
return {}
}
}
const getModelConfig = async (category: MODEL_TYPE, name: string) => {View on GitHub (pinned to abe4a8601a)
Solutions
- Verify the URL is reachable from the runtime: curl -I the MODEL_LIST_CONFIG_JSON value.
- If the URL is wrong, update MODEL_LIST_CONFIG_JSON to a correct one or unset it to use the default.
- For offline/air-gapped deployments, set MODEL_LIST_CONFIG_JSON to a local file path instead of a URL (this takes the fs.existsSync branch).
- Rely on the fallback: ensure the bundled models.json on disk is present and valid so the catch at line 54 succeeds.
Example fix
# before export MODEL_LIST_CONFIG_JSON='https://example.com/wrong-path/models.json' # after # option 1: fix the URL export MODEL_LIST_CONFIG_JSON='https://raw.githubusercontent.com/FlowiseAI/Flowise/main/packages/components/models.json' # option 2: use a local file (skips HTTP entirely) export MODEL_LIST_CONFIG_JSON='/opt/app/config/models.json'
Defensive patterns
Strategy: fallback
Validate before calling
// Health-check the model-list URL at startup
async function checkModelListUrl(url: string): Promise<boolean> {
try {
const r = await fetch(url)
return r.status === 200 && (await r.text()).length > 0
} catch {
return false
}
}
if (!(await checkModelListUrl(process.env.MODEL_LIST_CONFIG_JSON ?? ''))) {
console.warn('Model list URL unreachable; relying on bundled fallback')
} Try / catch
// getRawModelFile already falls back internally; guard getModels callers
try {
return await getModels(category, name)
} catch (e) {
if (String(e).startsWith('Error: getModels')) return []
throw e
} Prevention
- For air-gapped deployments, set MODEL_LIST_CONFIG_JSON to a local file path.
- Ensure the bundled models.json is present and valid as a fallback.
- Monitor reachability of the model-list URL from the runtime.
When it happens
Trigger: MODEL_LIST_CONFIG_JSON points at a URL that returns 404/500/302 (axios follows some redirects but a final non-200 hits line 45), or returns 200 with an empty body. The throw at line 45 is caught immediately at line 54 and the function falls back to reading models.json from disk.
Common situations: The default GitHub raw URL is unreachable (corporate proxy, GitHub outage, rate limit returning 429 treated as non-200). A custom MODEL_LIST_CONFIG_JSON URL was misconfigured (typo, wrong branch, moved file). The endpoint returns 200 but empty due to a server bug. Network egress blocked.
Related errors
- Model file does not exist or is empty
- ${errorMessage}
- HTTP error! status: ${response.status}
- Failed to fetch ${url}: ${error}
- Failed to post ${url}: ${error}
AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12).
Data as JSON: /api/errors/1df7c6fe5340e4a1.
Report an issue: GitHub.