{"record":{"id":"273a674c1098962c","repo":"apache/superset","slug":"an-error-occurred-while-accessing-the-value","errorCode":null,"errorMessage":"An error occurred while accessing the value.","messagePattern":"An error occurred while accessing the value\\.","errorType":"exception","errorClass":"DashboardPermalinkGetFailedError","httpStatus":500,"severity":"error","filePath":"superset/commands/dashboard/permalink/get.py","lineNumber":57,"sourceCode":"    def __init__(self, key: str):\n        self.key = key\n\n    def run(self) -> Optional[DashboardPermalinkValue]:\n        self.validate()\n        try:\n            key = decode_permalink_id(self.key, salt=self.salt)\n            value = KeyValueDAO.get_value(self.resource, key, self.codec)\n            if value:\n                DashboardDAO.get_by_id_or_slug(value[\"dashboardId\"])\n                return value\n            return None\n        except (\n            DashboardNotFoundError,\n            KeyValueCodecDecodeException,\n            KeyValueGetFailedError,\n            KeyValueParseKeyError,\n        ) as ex:\n            raise DashboardPermalinkGetFailedError(message=ex.message) from ex\n        except SQLAlchemyError as ex:\n            logger.exception(\"Error running get command\")\n            raise DashboardPermalinkGetFailedError() from ex\n\n    def validate(self) -> None:\n        pass\n","sourceCodeStart":39,"sourceCodeEnd":64,"githubUrl":"https://github.com/apache/superset/blob/f4587218dd19d046c3e4d00063e7d27f8a2ed354/superset/commands/dashboard/permalink/get.py#L39-L64","documentation":"DashboardPermalinkGetFailedError raised by GetDashboardPermalinkCommand.run when resolving a permalink key fails at the key-value layer. The except clause at get.py:57 catches DashboardNotFoundError, KeyValueCodecDecodeException, KeyValueGetFailedError and KeyValueParseKeyError, and re-raises with the underlying message ('An error occurred while accessing the value.' is the KeyValue error default). It means the permalink key could not be decoded or its stored value could not be read from the KV store.","triggerScenarios":"GET /api/v1/dashboard/permalink/<key> where <key> is malformed, truncated, or was signed with a different salt (e.g. SECRET_KEY / PERMALINK_SALT changed between create and get); the KV entry expired or was purged (expiring permalink entries); the KV backend (metadata DB table key_value or Redis) rejected the read (KeyValueGetFailedError).","commonSituations":"Rotating SECRET_KEY on an existing deployment invalidates all stored permalinks (decode_permalink_id uses a SECRET_KEY-derived salt); copying a permalink URL with the key clipped; flushing Redis if a Redis KV backend was configured; version upgrades that changed permalink entry TTLs.","solutions":["Generate a new permalink and share that — if the key no longer decodes against the current salt the data is unrecoverable by design.","If SECRET_KEY was rotated recently, either restore the old key or accept that old permalinks are lost (they are not migrated).","Verify the permalink key is complete and URL-safe (no truncation, no stray characters) before calling the API.","Check the KV store health: for the default metadata-DB backend inspect the key_value table; for Redis check connectivity and eviction policy (maxmemory-policy allkeys-lru can evict permalinks).","Reproduce decode directly: decode_permalink_id(key, salt=...) to distinguish a salt mismatch from a store read failure."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"from superset.dashboards.permalink.exceptions import DashboardPermalinkGetFailedError\nfrom superset.key_value.utils import decode_permalink_id\n\ndef permalink_key_plausible(key: str) -> bool:\n    try:\n        decode_permalink_id(key)  # raises on malformed/foreign-salt keys\n        return True\n    except Exception:\n        return False","typeGuard":null,"tryCatchPattern":"from superset.dashboards.permalink.exceptions import DashboardPermalinkGetFailedError\n\ntry:\n    value = GetDashboardPermalinkCommand(key).run()\nexcept DashboardPermalinkGetFailedError:\n    # permalink is dead (bad key / rotated SECRET_KEY / purged KV entry)\n    value = None  # fall back to the dashboard's default state","preventionTips":["Never rotate SECRET_KEY without deciding what happens to stored permalinks — they are salted with it and will all fail after rotation.","Share permalinks only as generated by the UI/API; never hand-edit the key.","If using a Redis KV backend, avoid allkeys-* eviction policies so permalinks are not silently evicted.","Treat missing permalinks as non-fatal: render the dashboard without the permalink state."],"tags":["dashboard","permalink","key-value","secret-key"],"backgroundTag":null,"analyzedSha":"f4587218dd19d046c3e4d00063e7d27f8a2ed354","analyzedAt":"2026-08-14T22:39:27.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}