gptscript-ai / desktop

MIT License
19 stars 13 forks source link

Knowledge- Not able to add files using "Sync from Notion" option. #516

Closed sangee2004 closed 6 days ago

sangee2004 commented 1 week ago

Electron build - d27f9f6f

Steps to reproduce the problem:

  1. Create an assistant
  2. Add knowledge file using "Sync from Notion" option.
  3. Once the notion oauth workflow is completed , i see the following page presented and dont see any files from Notion getting synced here Screenshot 2024-09-13 at 5 35 13 PM

Following errors are seen in logs:

2024-09-14T00:18:44.772Z [server] [ERROR] Error: ENOENT: no such file or directory, open '/Users/sangeethahariharan/Library/Application Support/acorn/Acorn/workspace/knowledge/integrations/notion/metadata.json'
    at Object.openSync (node:fs:573:18)
    at Object.func [as openSync] (node:electron/js2c/node_init:2:2559)
    at Object.readFileSync (node:fs:452:35)
    at t.readFileSync (node:electron/js2c/node_init:2:10245)
    at d (/Users/sangeethahariharan/acorn/desktop/electron-dist/mac-arm64/Acorn.app/Contents/Resources/app.asar/.next/server/app/edit/page.js:1:279689)
    at i (/Users/sangeethahariharan/acorn/desktop/electron-dist/mac-arm64/Acorn.app/Contents/Resources/app.asar/.next/server/app/edit/page.js:1:11971)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async /Users/sangeethahariharan/acorn/desktop/electron-dist/mac-arm64/Acorn.app/Contents/Resources/app.asar/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:16:408
    at async rP (/Users/sangeethahariharan/acorn/desktop/electron-dist/mac-arm64/Acorn.app/Contents/Resources/app.asar/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:15:8043)
    at async r5 (/Users/sangeethahariharan/acorn/desktop/electron-dist/mac-arm64/Acorn.app/Contents/Resources/app.asar/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:18:1139) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/Users/sangeethahariharan/Library/Application Support/acorn/Acorn/workspace/knowledge/integrations/notion/metadata.json',
  digest: '218773927'
}
2024-09-14T00:18:44.774Z [client] [ERROR] Uncaught (in promise) Error: An error occurred in the Server Components render. The specific message is omitted in production builds to avoid leaking sensitive details. A digest property is included on this error instance which may provide additional details about the nature of the error.

Note - Tried with these changes to point to the latest commit of knowledge-notion-integration and it still gave the same error. I also tried testing with clearing all the cache to make sure I get the latest version of the tool. This does not help as well.

rm -rf ~/Library/Application\ Support/acorn
rm -rf ~/Library/Application\ Support/gptscript
rm -rf ~/Library/Caches/gptscript
diff --git a/actions/knowledge/tool.ts b/actions/knowledge/tool.ts
index cb4d73d..c19add1 100644
--- a/actions/knowledge/tool.ts
+++ b/actions/knowledge/tool.ts
@@ -20,7 +20,7 @@ export async function runSyncTool(

   let toolUrl = '';
   if (tool === 'notion') {
-    toolUrl = 'github.com/gptscript-ai/knowledge-notion-integration';
+    toolUrl = 'github.com/gptscript-ai/knowledge-notion-integration@fc908c7';
   } else if (tool === 'onedrive') {
     toolUrl = 'github.com/gptscript-ai/knowledge-onedrive-integration';
   }
sangee2004 commented 6 days ago

This issue is not seen when testing with the latest version of the knowledge-notion-integration tool.