{"record":{"id":"b0b54280608934a5","repo":"qishibo/AnotherRedisDesktopManager","slug":"vue-t-message-key-no-permission-n-e-messa","errorCode":null,"errorMessage":"${vue.$t('message.key_no_permission')}\\n[${e.message}]","messagePattern":"\\$\\{vue\\.\\$t\\('message\\.key_no_permission'\\)\\}\\\\n\\[\\$\\{e\\.message\\}\\]","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/redisClient.js","lineNumber":374,"sourceCode":"\n  getFileContent(file, bookmark = '') {\n    if (!file) {\n      return undefined;\n    }\n\n    try {\n      // mac app store version, read through bookmark\n      if (bookmark) {\n        const bookmarkClose = remote.app.startAccessingSecurityScopedResource(bookmark);\n      }\n\n      const content = fs.readFileSync(file);\n      (typeof bookmarkClose === 'function') && bookmarkClose();\n\n      return content;\n    } catch (e) {\n      // force alert\n      alert(`${vue.$t('message.key_no_permission')}\\n[${e.message}]`);\n      vue.$bus.$emit('closeConnection');\n\n      return undefined;\n    }\n  },\n};\n","sourceCodeStart":356,"sourceCodeEnd":381,"githubUrl":"https://github.com/qishibo/AnotherRedisDesktopManager/blob/c149855106628babcdfb7675a8e7ba9434d2492a/src/redisClient.js#L356-L381","documentation":"getFileContent (src/redisClient.js) wraps fs.readFileSync in try/catch and converts any read failure - EACCES, ENOENT, sandbox denial - into a forced alert with the localized 'no permission' text, then emits closeConnection. On the Mac App Store build the file must also be reachable through a security-scoped bookmark (startAccessingSecurityScopedResource); without a valid bookmark the sandbox denies the read and lands here.","triggerScenarios":"Mac App Store (sandboxed) build reading a file whose security-scoped bookmark is missing or stale; file deleted or moved between selection and read; OS-level permission (macOS TCC, directory ACL) denying the app; path loaded from an old config that no longer resolves.","commonSituations":"MAS version of the app after a file was moved/renamed; user picked a file in a protected location (Desktop/Documents under TCC); file permissions changed after the connection was created.","solutions":["Re-select the file through the app's file dialog so a fresh security-scoped bookmark is stored, then retry.","Verify the file still exists and is readable ('ls -l path', fix with chmod if needed).","Use the non-MAS build (direct download or built from source), which is not sandboxed and reads paths directly."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const fs = require('fs');\n\nfunction canRead(file) {\n  try {\n    fs.accessSync(file, fs.constants.R_OK);\n    return true;\n  } catch {\n    return false;\n  }\n}\nif (!file || !canRead(file)) skipAndWarn(); // avoids the forced alert","typeGuard":null,"tryCatchPattern":"try {\n  const content = getFileContent(file, bookmark);\n} catch (e) {\n  // alert already forced by getFileContent; here just clean up state without re-alerting\n}","preventionTips":["On the Mac App Store build always pick files through the app's dialog so a security-scoped bookmark is stored.","Check fs.accessSync(path, R_OK) before calling read APIs when the path came from stored config rather than a fresh dialog.","Prefer the non-sandboxed build for workflows that read arbitrary paths."],"tags":["mac-sandbox","file-permission","electron","security-scoped-bookmark"],"backgroundTag":"file-permission-denied","analyzedSha":"c149855106628babcdfb7675a8e7ba9434d2492a","analyzedAt":"2026-08-22T09:06:28.613Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}