{"record":{"id":"2d7888511df53a4b","repo":"OtterMind/Chat2DB","slug":"largecellvalue-tokenrequired","errorCode":"largeCellValue.tokenRequired","errorMessage":"largeCellValue.tokenRequired","messagePattern":"largeCellValue\\.tokenRequired","errorType":"validation","errorClass":"BusinessException","httpStatus":null,"severity":"error","filePath":"chat2db-community-server/chat2db-community-domain/chat2db-community-domain-core/src/main/java/ai/chat2db/community/domain/core/impl/db/DbLargeValueTokenServiceImpl.java","lineNumber":79,"sourceCode":"                    continue;\n                }\n                Map<String, Object> primaryKey = getPrimaryKeyValues(primaryKeyHeaders, row);\n                if (primaryKey.isEmpty()) {\n                    cell.setUnsupportedReason(UNSUPPORTED_REASON_KEY);\n                    continue;\n                }\n                LargeValueToken token = createToken(dataSourceId, databaseName, schemaName, tableName,\n                        columnName, primaryKey, cell);\n                tokenCache.put(token.getId(), token);\n                cell.setLargeValueId(token.getId());\n            }\n        }\n    }\n\n    @Override\n    public LargeValueToken requireValid(String id) {\n        if (StringUtils.isBlank(id)) {\n            throw new BusinessException(\"largeCellValue.tokenRequired\");\n        }\n        LargeValueToken token = tokenCache.get(id);\n        if (token == null) {\n            throw new BusinessException(\"largeCellValue.tokenExpired\");\n        }\n        if (Instant.now().isAfter(token.getExpiresAt())) {\n            tokenCache.remove(id);\n            throw new BusinessException(\"largeCellValue.tokenExpired\");\n        }\n        validateOwner(token);\n        return token;\n    }\n\n    private void cleanupExpired() {\n        Instant now = Instant.now();\n        tokenCache.entrySet().removeIf(entry -> now.isAfter(entry.getValue().getExpiresAt()));\n    }\n","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/OtterMind/Chat2DB/blob/5ee1e990e73fbcae1969dc554be254fedb3ab888/chat2db-community-server/chat2db-community-domain/chat2db-community-domain-core/src/main/java/ai/chat2db/community/domain/core/impl/db/DbLargeValueTokenServiceImpl.java#L61-L97","documentation":"Thrown by DbLargeValueTokenServiceImpl.requireValid when the supplied token id is blank. Large cell values (>display threshold) are fetched by an opaque LargeValueToken id issued when the result set is rendered; a blank id means the caller never had or lost the reference. Resolves to 'Large value reference is required'. This is an input-contract check before cache lookup.","triggerScenarios":"The large-value detail/fetch endpoint called with a missing/empty largeValueId query param; a frontend that opened a large cell but failed to persist the issued token id before requesting the body.","commonSituations":"Deep link to a large cell without the token; a stale front-end state where the cell's largeValueId was cleared on re-render; an API client that constructed the URL manually and omitted the id.","solutions":["Always read largeValueId from the cell metadata returned during result rendering before calling the fetch endpoint.","Treat a blank id as a client-side error and prompt the user to re-open the cell rather than submitting.","Ensure the result-set render path runs the tokenization step that populates cell.largeValueId."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (StringUtils.isBlank(cell.getLargeValueId())) {\n    // do not call the large-value endpoint; re-open the cell\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Read largeValueId from rendered cell metadata before fetching.","Block the fetch UI when no token is present."],"tags":["validation","large-value","token","request-validation"],"backgroundTag":null,"analyzedSha":"5ee1e990e73fbcae1969dc554be254fedb3ab888","analyzedAt":"2026-08-14T07:05:03.077Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}