Molunerfinn/PicGo · error

Failed to refresh plugin config schema

Error message

Failed to refresh plugin config schema

What it means

refreshConfigSchema invokes the REFRESH_CONFIG_SCHEMA RPC and expects a success envelope. When result.success is false it throws with result.error, defaulting to 'Failed to refresh plugin config schema'. This means the main process could not rebuild the plugin's config form schema (plugin reload failed, plugin crashed, or the main-side handler reported an error).

Source

Thrown at src/renderer/adapters/plugins.ts:88

  },
  uninstallPlugin (fullName: string) {
    return invokeRPC<string>(IRPCActionType.UNINSTALL_PLUGIN, fullName)
  },
  updatePlugin (fullName: string) {
    return invokeRPC<string>(IRPCActionType.UPDATE_PLUGIN, fullName)
  },
  togglePluginEnabled (fullName: string, enabled: boolean) {
    return invokeRPC<string>(
      enabled
        ? IRPCActionType.ENABLE_PLUGIN
        : IRPCActionType.DISABLE_PLUGIN,
      fullName
    )
  },
  async refreshConfigSchema (payload: IRefreshConfigSchemaArgs): Promise<ProviderPluginConfig[]> {
    const result = await invokeRPC<unknown[]>(IRPCActionType.REFRESH_CONFIG_SCHEMA, payload)
    if (!result.success) {
      throw new Error(result.error || 'Failed to refresh plugin config schema')
    }
    return normalizePluginConfigSchema(result.data)
  },
  async saveTransformer (transformer: string) {
    await saveConfig({
      'picBed.transformer': transformer
    })
  },
  async fetchPluginReadme (fullName: string, options?: { installed?: boolean }) {
    // For installed plugins (including locally imported ones not on npm),
    // read README from disk via the main process — jsdelivr 404s on
    // unpublished plugins. Non-installed plugins (e.g. search results) fall
    // back to the CDN.
    if (options?.installed) {
      const result = await invokeRPC<string>(
        IRPCActionType.GET_INSTALLED_PLUGIN_README,
        fullName
      )

View on GitHub (pinned to 07ec7068a5)

Solutions

  1. Read result.error from the RPC response/logs for the underlying cause (the thrown message may contain it)
  2. Reload or reinstall the plugin so its config schema generation succeeds
  3. Check the plugin's dist output and config() export after an update
  4. Restart the app to reset the plugin host if the plugin is wedged

Example fix

// before
const schema = await refreshConfigSchema({ fullName }) // throws on success:false
// after
try {
  const schema = await refreshConfigSchema({ fullName })
} catch (e) {
  await reloadPlugin(fullName)
  const schema = await refreshConfigSchema({ fullName })
}
Defensive patterns

Strategy: try-catch

Validate before calling

const installed = await getInstalledPluginList()
if (!installed.some(p => p.fullName === payload.fullName)) {
  throw new Error('Plugin not installed: ' + payload.fullName)
}

Type guard

function rpcOk(result) {
  return !!result && result.success === true && Array.isArray(result.data)
}

Try / catch

try {
  return await refreshConfigSchema(payload)
} catch (e) {
  logger.warn('schema refresh failed', e)
  await reloadPlugin(payload.fullName)
  return await refreshConfigSchema(payload)
}

Prevention

When it happens

Trigger: Calling refreshConfigSchema (via fetchSchema/resolvedSchema) after a plugin update/reload where the plugin's config method throws or is missing, or when the RPC handler itself fails and returns success:false with an empty error string.

Common situations: Plugin upgraded to a version whose config() signature changed; plugin not built correctly (missing dist); Node module resolution failure in the main process; plugin hangs or throws during config generation.

Related errors


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