{"record":{"id":"123edad2762e7505","repo":"Molunerfinn/PicGo","slug":"failed-to-load-provider-configs","errorCode":null,"errorMessage":"Failed to load provider configs","messagePattern":"Failed to load provider configs","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/renderer/adapters/providers.ts","lineNumber":23,"sourceCode":"import { ipc } from '@/utils/bridge'\n\nexport interface ProviderSchemaResult {\n  config: IPicGoPluginConfig[]\n  name: string\n}\n\nexport const providersAdapter = {\n  async changeCurrentUploader (type: string, configName?: string) {\n    const result = await invokeRPC<string>(IRPCActionType.CHANGE_CURRENT_UPLOADER, type, configName)\n    if (!result.success) {\n      throw new Error(result.error || 'Failed to change current uploader')\n    }\n    return result.data\n  },\n  async getProviderConfigList (type: string) {\n    const result = await invokeRPC<IUploaderConfigItem>(IRPCActionType.GET_PICBED_CONFIG_LIST, type)\n    if (!result.success) {\n      throw new Error(result.error || 'Failed to load provider configs')\n    }\n\n    return result.data\n  },\n  async selectProviderConfig (type: string, configName: string) {\n    const result = await invokeRPC<string>(IRPCActionType.SELECT_UPLOADER, type, configName)\n    if (!result.success) {\n      throw new Error(result.error || 'Failed to select provider config')\n    }\n\n    return result.data\n  },\n  async deleteProviderConfig (type: string, configName: string) {\n    const result = await invokeRPC<IUploaderConfigItem>(IRPCActionType.DELETE_PICBED_CONFIG, type, configName)\n    if (!result.success) {\n      throw new Error(result.error || 'Failed to delete provider config')\n    }\n","sourceCodeStart":5,"sourceCodeEnd":41,"githubUrl":"https://github.com/Molunerfinn/PicGo/blob/07ec7068a5512344da093d49a8408fa63ba3421e/src/renderer/adapters/providers.ts#L5-L41","documentation":"getProviderConfigList calls the main process via invokeRPC(IRPCActionType.GET_PICBED_CONFIG_LIST) and throws when the RPC result reports failure with no detailed error message. On the main side (src/main/events/rpc/routes/config.ts:40) the handler calls picgo.uploaderConfig.getConfigList(type)/getActiveConfig(type); any exception there is caught and returned as a failed RPC envelope, which the renderer converts into this error. It means the uploader/picbed config list for the given type could not be read from the persisted PicGo config.","triggerScenarios":"Calling providersAdapter.getProviderConfigList(type) when the main-process handler throws (e.g. picgo config file unreadable/corrupt so uploaderConfig access fails), or when result.success is false with an empty error string so only the fallback message is shown.","commonSituations":"PicGo config file corrupted or locked, uploader type string that has no registered config entries, main process state not fully initialized after an update/migration, or a stale renderer talking to a restarted main process.","solutions":["Check the main-process logs for the underlying exception thrown by picgo.uploaderConfig.getConfigList and fix that root cause","Validate/repair the PicGo config file (backup, then remove or fix the corrupted uploader section)","Pass a valid registered uploader type (e.g. 'smms', 'aliyun') rather than an arbitrary string","Retry after reloading the settings window so the renderer re-syncs with the main process"],"exampleFix":"// before\nconst list = await getProviderConfigList(unknownType)\n// after\nif (!type || typeof type !== 'string') throw new Error('uploader type is required')\nconst list = await getProviderConfigList(type)","handlingStrategy":"try-catch","validationCode":"if (typeof type !== 'string' || !type.trim()) throw new Error('uploader type is required')","typeGuard":"function isValidType(t: unknown): t is string { return typeof t === 'string' && t.trim().length > 0 }","tryCatchPattern":"let configList\ntry {\n  configList = await getProviderConfigList(type)\n} catch (e) {\n  logger.error('[picbed] failed to load config list', e)\n  showNotification($T('TIPS_LOAD_CONFIG_FAILED'))\n  configList = { configList: [], defaultId: '' } // graceful fallback\n}","preventionTips":["Always pass a valid registered uploader type","Catch and display result.error details instead of swallowing them","Refresh the list after any main-process config change (notifyAppConfigUpdated)","Back up the PicGo config file; repair rather than hand-edit when corrupt"],"tags":["ipc","rpc","config","picgo"],"backgroundTag":"rpc-failed-result","analyzedSha":"07ec7068a5512344da093d49a8408fa63ba3421e","analyzedAt":"2026-08-30T01:45:22.289Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}