{"record":{"id":"cd3c9e7937ab3b9f","repo":"Molunerfinn/PicGo","slug":"failed-to-select-provider-config","errorCode":null,"errorMessage":"Failed to select provider config","messagePattern":"Failed to select provider config","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/renderer/adapters/providers.ts","lineNumber":31,"sourceCode":"  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\n    return result.data\n  },\n  async copyProviderConfig (type: string, configName: string, newConfigName: string) {\n    const result = await invokeRPC<IUploaderConfigItem>(IRPCActionType.COPY_UPLOADER_CONFIG, type, configName, newConfigName)\n    if (!result.success) {\n      throw new Error(result.error || 'Failed to copy provider config')\n    }\n","sourceCodeStart":13,"sourceCodeEnd":49,"githubUrl":"https://github.com/Molunerfinn/PicGo/blob/07ec7068a5512344da093d49a8408fa63ba3421e/src/renderer/adapters/providers.ts#L13-L49","documentation":"selectProviderConfig sends IRPCActionType.SELECT_UPLOADER to switch the active uploader config for a picbed type; when the RPC returns success=false it throws this error. The main handler (src/main/events/rpc/routes/config.ts:87) calls picgo.uploaderConfig.use(type, configName), which throws if the config name does not exist or the type is unknown. The error surfaces in the selectedId flow when activating a provider config.","triggerScenarios":"Calling providersAdapter.selectProviderConfig(type, configName) with a configName that is not in the uploader's config list, an unregistered type, or after the config was renamed/deleted in another window so the name is stale.","commonSituations":"Selecting a config from a cached list while another settings window renamed it; typos or whitespace in configName; config deleted concurrently; PicGo config reloaded between listing and selection.","solutions":["Refresh the config list (getProviderConfigList) and retry with a currently existing _configName","Confirm the type/configName pair matches an entry in the PicGo config (uploader.<type>.configList)","Check the main-process error returned in result.error for the precise reason (e.g. config not found)","Reopen the settings window to resync renderer state with the main process"],"exampleFix":"// before\nawait selectProviderConfig(type, staleName)\n// after\nconst { configList } = await getProviderConfigList(type)\nif (configList.some(c => c._configName === name)) await selectProviderConfig(type, name)","handlingStrategy":"validation","validationCode":"const { configList } = await getProviderConfigList(type)\nconst exists = configList.some(c => c._configName === configName)\nif (!exists) throw new Error(`config \"${configName}\" not found for ${type}`)","typeGuard":"function configExists(list: IUploaderConfigItem[], name: string): boolean { return list.some(c => typeof c._configName === 'string' && c._configName === name) }","tryCatchPattern":"try {\n  await selectProviderConfig(type, configName)\n} catch (e) {\n  logger.warn('[picbed] select failed, resyncing', e)\n  await refreshConfigList(type) // reload fresh list before retry\n  showNotification($T('TIPS_SELECT_CONFIG_FAILED'))\n}","preventionTips":["Re-fetch the config list right before selecting instead of using long-cached names","Trim config names and avoid whitespace-only variants","Resync state when notifyAppConfigUpdated events arrive from main","Handle concurrent edits from multiple settings windows"],"tags":["ipc","rpc","config","state-sync"],"backgroundTag":"rpc-failed-result","analyzedSha":"07ec7068a5512344da093d49a8408fa63ba3421e","analyzedAt":"2026-08-30T01:45:22.289Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}