withcatai / catai

Run AI ✨ assistant locally! with simple API for Node.js 🚀
https://withcatai.github.io/catai/
MIT License
456 stars 30 forks source link

CatAI crashes when quitting a browser or when starting CatAI when a browser is already open. #29

Closed TheSystemGuy1337 closed 1 year ago

TheSystemGuy1337 commented 1 year ago

Please refer to the troubleshooting before opening an issue. You might find the solution there.

Describe the bug CatAI really doesn't like having the browser be open when you start it. If you attempt to start CatAI with the browser open, it prints this out to the terminal

..................../home/thesystemguy/.nvm/versions/node/v20.2.0/lib/node_modules/catai/node_modules/openurl/openurl.js:39 throw error; ^

Error: Gtk-Message: 00:49:11.085: Failed to load module "xapp-gtk3-module" [2:2:0711/004911.245184:ERROR:nacl_fork_delegate_linux.cc(313)] Bad NaCl helper startup ack (0 bytes) Gtk-Message: 00:49:11.272: Failed to load module "xapp-gtk3-module"

at Socket.<anonymous> (/home/thesystemguy/.nvm/versions/node/v20.2.0/lib/node_modules/catai/node_modules/openurl/openurl.js:35:25)
at Socket.emit (node:events:525:35)
at endReadableNT (node:internal/streams/readable:1359:12)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

Node.js v18.16.0 at file:///home/thesystemguy/.nvm/versions/node/v20.2.0/lib/node_modules/catai/scripts/cli.js:69:27 exit code: 1

A reinstallation nor reboot does not fix this issue. This issue cropped up after Google Chrome broke and Firefox assumed itself as the default browser and I changed the settings.

Screenshots n/a

Desktop (please complete the following information): OS: Linux Mint 21.1 Cinnamon, Linux 5.15.0-76-generic Browser: Google Chrome CatAI version 0.3.12 Node.js version v18.16.0 CPU: AMD Ryzen 5 5600H with Radeon Graphics RAM: 30.7 GiB (512 MiB reserved to graphics chipset)

ido-pluto commented 1 year ago

You can disable the open in browser feature vis environment variable, check the config. I will try to see if there is a workaround to prevent CatAI from crashing after failing to open the browser.

TheSystemGuy1337 commented 1 year ago

Disarmed and this issue vanished. Also CatAI really doesn't like TTY launch, make the program ignore the x server so it can launch in TTY mode (If I press CRTL+F1 to enter TTY)

On Tue, Jul 11, 2023 at 1:11 AM Ido S. @.***> wrote:

You can disable the open in browser feature vis environment variable, check the config. I will try to see if there is a workaround to prevent CatAI from crashing after failing to open the browser.

— Reply to this email directly, view it on GitHub https://github.com/ido-pluto/catai/issues/29#issuecomment-1630200468, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOSUENKCNNX7MG7IFXYBLJTXPTVABANCNFSM6AAAAAA2FPFBN4 . You are receiving this because you authored the thread.Message ID: @.***>

ido-pluto commented 1 year ago

Supposed to work on the latest version, is the problem fixed?

npm install -g catai@1.0.2
TheSystemGuy1337 commented 1 year ago

Updated. Now it's completely broken.

catai@1.0.2 start
node src/index.js --production true --ui catai

Segmentation fault (core dumped)

I updated to Linux Mint 21.2

TheSystemGuy1337 commented 1 year ago

Trying to run catai update works, but yields same result.

fatal runtime error: Rust cannot catch foreign exceptions Aborted (core dumped) fatal runtime error: Rust cannot catch foreign exceptions Aborted (core dumped) at file:///home/thesystemguy/.nvm/versions/node/v20.2.0/lib/node_modules/catai/scripts/cli.js:69:27 exit code: 134 (Process aborted)

TheSystemGuy1337 commented 1 year ago

Reinstalling does this llama.cpp: loading model from /home/thesystemguy/catai fatal runtime error: Rust cannot catch foreign exceptions Aborted (core dumped) llama.cpp: loading model from /home/thesystemguy/catai fatal runtime error: Rust cannot catch foreign exceptions Aborted (core dumped) at file:///home/thesystemguy/.nvm/versions/node/v20.2.0/lib/node_modules/catai/scripts/cli.js:69:27 exit code: 134 (Process aborted)

ido-pluto commented 1 year ago

I did upgrade the node-llama version (this is the binding to the model)

TheSystemGuy1337 commented 1 year ago

That isn’t helpful. The problem is now CatAI keeps having a segmentation fault and dumping its core. See previous messages for help with debugging.On Jul 19, 2023, at 3:53 AM, Ido S. @.***> wrote: I did upgrade the node-llama version (this is the binding to the model)

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

ido-pluto commented 1 year ago

CatAI now uses a custom lib - develop by the CatAI team. Can you try to update and use one of the models listed in catai ls?

TheSystemGuy1337 commented 1 year ago

The install failed, mainly as you didn't specify sudo.

Even after that small blunder and having to upgrade NodeJS from 18 to 20 using insane command line nonsense, it bloody works now.