Molunerfinn/PicGo · error

Failed to select provider config

Error message

Failed to select provider config

What it means

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.

Source

Thrown at src/renderer/adapters/providers.ts:31

  async changeCurrentUploader (type: string, configName?: string) {
    const result = await invokeRPC<string>(IRPCActionType.CHANGE_CURRENT_UPLOADER, type, configName)
    if (!result.success) {
      throw new Error(result.error || 'Failed to change current uploader')
    }
    return result.data
  },
  async getProviderConfigList (type: string) {
    const result = await invokeRPC<IUploaderConfigItem>(IRPCActionType.GET_PICBED_CONFIG_LIST, type)
    if (!result.success) {
      throw new Error(result.error || 'Failed to load provider configs')
    }

    return result.data
  },
  async selectProviderConfig (type: string, configName: string) {
    const result = await invokeRPC<string>(IRPCActionType.SELECT_UPLOADER, type, configName)
    if (!result.success) {
      throw new Error(result.error || 'Failed to select provider config')
    }

    return result.data
  },
  async deleteProviderConfig (type: string, configName: string) {
    const result = await invokeRPC<IUploaderConfigItem>(IRPCActionType.DELETE_PICBED_CONFIG, type, configName)
    if (!result.success) {
      throw new Error(result.error || 'Failed to delete provider config')
    }

    return result.data
  },
  async copyProviderConfig (type: string, configName: string, newConfigName: string) {
    const result = await invokeRPC<IUploaderConfigItem>(IRPCActionType.COPY_UPLOADER_CONFIG, type, configName, newConfigName)
    if (!result.success) {
      throw new Error(result.error || 'Failed to copy provider config')
    }

View on GitHub (pinned to 07ec7068a5)

Solutions

  1. Refresh the config list (getProviderConfigList) and retry with a currently existing _configName
  2. Confirm the type/configName pair matches an entry in the PicGo config (uploader.<type>.configList)
  3. Check the main-process error returned in result.error for the precise reason (e.g. config not found)
  4. Reopen the settings window to resync renderer state with the main process

Example fix

// before
await selectProviderConfig(type, staleName)
// after
const { configList } = await getProviderConfigList(type)
if (configList.some(c => c._configName === name)) await selectProviderConfig(type, name)
Defensive patterns

Strategy: validation

Validate before calling

const { configList } = await getProviderConfigList(type)
const exists = configList.some(c => c._configName === configName)
if (!exists) throw new Error(`config "${configName}" not found for ${type}`)

Type guard

function configExists(list: IUploaderConfigItem[], name: string): boolean { return list.some(c => typeof c._configName === 'string' && c._configName === name) }

Try / catch

try {
  await selectProviderConfig(type, configName)
} catch (e) {
  logger.warn('[picbed] select failed, resyncing', e)
  await refreshConfigList(type) // reload fresh list before retry
  showNotification($T('TIPS_SELECT_CONFIG_FAILED'))
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of Molunerfinn/PicGo@07ec7068a5 (2026-08-30). Data as JSON: /api/errors/cd3c9e7937ab3b9f. Report an issue: GitHub.