[BUG]: Error ENOTDIR: not a directory, mkdir when launching AnythingLLMDesktop
How are you running AnythingLLM?
AnythingLLM desktop app
What happened?
When I try to start AnythingLLMDesktop, the application throws an error related to creating a directory inside the .asar file:
Uncaught Exception:
Error: ENOTDIR: not a directory, mkdir '/home/sieben/AnythingLLMDesktop/anythingllm-desktop/resources/app.asar/dist-electron/main/AppData'
at Object.mkdirSync (node:fs:1396:3)
at Object.<anonymous> (/home/sieben/AnythingLLMDesktop/anythingllm-desktop/resources/app.asar/dist-electron/main/index.js:71:32443)
at Module._compile (node:internal/modules/cjs/loader:1271:14)
at Object..js (node:internal/modules/cjs/loader:1326:10)
at Module.load (node:internal/modules/cjs/loader:1126:32)
at node:internal/modules/cjs/loader:967:12
at Function._load (node:electron/js2c/asar_bundle:2:13327)
at node:electron/js2c/browser_init:2:122709
at node:electron/js2c/browser_init:2:122912
at node:electron/js2c/browser_init:2:122916
The application is trying to create a directory inside the .asar archive, which is not writable due to its nature as a compressed archive.
I attempted to extract the .asar file to allow the app to run from an uncompressed source, but the issue persists. The app does not launch properly after extraction.
Are there known steps to reproduce?
I use Linux 6.10.9 with Wayland and KDE Plasma
curl -fsSL https://s3.us-west-1.amazonaws.com/public.useanything.com/latest/installer.sh | sh- ./start
- Error
On Ubuntu, we extract the AppImage because it tries to mount to tmp which is by default unwritable and cannot run the ORM for migrations. So everything should end up in $HOME/AnythingLLMDesktop
The start command should be in $HOME/AnythingLLMDesktop and its not clear if from the second item you are in the correct directory (which .start should not even run if not since that would not exist?)
It should not be writing anything inside the ASAR, for exactly as described in the issue - that log does not seem to indicate some call from code we wrote to produce that error (nor why its trying to make an AppData?)
I didn’t document this step. Of course, i switched to the AnythingLLMDesktop directory first.
cd ~
curl -fsSL https://s3.us-west-1.amazonaws.com/public.useanything.com/latest/installer.sh | sh
cd ~/AnythingLLMDesktop
./start
I just tried it again the way you described it in the documentation:
curl -fsSL https://s3.us-west-1.amazonaws.com/public.useanything.com/latest/installer.sh | sh
./AnythingLLMDesktop/start
Again the same JavaScript error occurred in the main process:
Uncaught Exception:
Error: ENOTDIR: not a directory, mkdir '/home/sieben/AnythingLLMDesktop/anythingllm-desktop/resources/app.asar/dist-electron/main/AppData'
at Object.mkdirSync (node:fs:1396:3)
at Object.<anonymous> (/home/sieben/AnythingLLMDesktop/anythingllm-desktop/resources/app.asar/dist-electron/main/index.js:71:32443)
at Module._compile (node:internal/modules/cjs/loader:1271:14)
at Object..js (node:internal/modules/cjs/loader:1326:10)
at Module.load (node:internal/modules/cjs/loader:1126:32)
at node:internal/modules/cjs/loader:967:12
at Function._load (node:electron/js2c/asar_bundle:2:13327)
at node:electron/js2c/browser_init:2:122709
at node:electron/js2c/browser_init:2:122912
at node:electron/js2c/browser_init:2:122916
It might simply be due to my system configuration. Unfortunately, all my attempts to get AnythingLLM running on my system have failed.
Since I'm now using AnythingLLM with Docker and I'm not sure if the issue is related to my specific system configuration, I'll go ahead and close this ticket. Thank you for your support!