{"record":{"id":"e8a43cc3e9adab89","repo":"google-gemini/gemini-cli","slug":"extension-extension-name-cannot-be-updated-g","errorCode":null,"errorMessage":"Extension ${extension.name} cannot be updated. ${getErrorMessage(e)}. To fix this, reinstall the extension.","messagePattern":"Extension (.+?) cannot be updated\\. (.+?)\\. To fix this, reinstall the extension\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cli/src/config/extensions/update.ts","lineNumber":70,"sourceCode":"      `Extension ${extension.name} cannot be updated, type is unknown.`,\n    );\n  }\n\n  try {\n    const status = await extensionManager.verifyExtensionIntegrity(\n      extension.name,\n      installMetadata,\n    );\n\n    if (status === IntegrityDataStatus.INVALID) {\n      throw new Error('Extension integrity cannot be verified');\n    }\n  } catch (e) {\n    dispatchExtensionStateUpdate({\n      type: 'SET_STATE',\n      payload: { name: extension.name, state: ExtensionUpdateState.ERROR },\n    });\n    throw new Error(\n      `Extension ${extension.name} cannot be updated. ${getErrorMessage(e)}. To fix this, reinstall the extension.`,\n    );\n  }\n\n  if (installMetadata?.type === 'link') {\n    dispatchExtensionStateUpdate({\n      type: 'SET_STATE',\n      payload: { name: extension.name, state: ExtensionUpdateState.UP_TO_DATE },\n    });\n    throw new Error(`Extension is linked so does not need to be updated`);\n  }\n\n  if (extension.migratedTo) {\n    const migratedState = await checkForExtensionUpdate(\n      {\n        ...extension,\n        installMetadata: { ...installMetadata, source: extension.migratedTo },\n        migratedTo: undefined,","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/google-gemini/gemini-cli/blob/5024443c7217464a66e98f80d73172a26440bd8f/packages/cli/src/config/extensions/update.ts#L52-L88","documentation":"Catch-all around verifyExtensionIntegrity in checkForExtensionUpdate. Any throw from integrity verification (hash mismatch, missing files, metadata inconsistency) is wrapped with the extension name and the underlying message, plus a directive to reinstall.","triggerScenarios":"verifyExtensionIntegrity throws — typically because files referenced by the integrity record are missing or their hashes no longer match (post-update partial state, manual edits, disk corruption).","commonSituations":"A previous update was interrupted leaving half-written files; the user edited files inside the extension directory; antivirus/quarantine removed a file; cross-filesystem move changed permissions.","solutions":["Reinstall the extension to restore a consistent file set and integrity record.","If reinstall is undesirable, inspect error.cause / the verifier output to identify and restore the specific changed file.","Lock the extension directory against manual edits to prevent recurrence."],"exampleFix":"// before\ntry { await verifyExtensionIntegrity(...); } catch (e) { throw new Error('reinstall'); }\n// after\ntry { await verifyExtensionIntegrity(...); }\ncatch (e) {\n  logger.warn('integrity failed for %s: %s', extension.name, e);\n  await reinstallExtension(extension.name);\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { await checkForExtensionUpdate(ext, mgr); } catch (e) { if (/reinstall the extension/.test(String(e))) { await reinstallExtension(ext.name); } else throw e; }","preventionTips":["Avoid manual edits inside installed extension directories.","Treat an interrupted update as corrupting; reinstall before retrying."],"tags":["extensions","updates","integrity","error-wrapping"],"backgroundTag":null,"analyzedSha":"5024443c7217464a66e98f80d73172a26440bd8f","analyzedAt":"2026-08-12T06:01:53.711Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}