veksha / cuda_codeium

Codeium addon for CudaText text editor
MIT License
5 stars 5 forks source link

Can't start Codeium local server because of port issue #8

Closed NEK-RA closed 1 year ago

NEK-RA commented 1 year ago

Hi. Environment: Ubuntu (KDE Neon if it matters), arch amd64. Cudatext version: latest - 1.194.0 Plugin version: both from Cudatext manager (which takes from sourceforge and I guess may be a bit outdated) and installation from git (like 30 mins before, so seems to be actual plugin version as well)

Logged in succesfully. Faced error by failing to get any completions, but haven't faced any error messages. Next try was with chat - with this I've got next message:

ERROR: GetChatMessage failed. Error: Failed to parse: http://127.0.0.1:None/exa.language_server_pb.LanguageServerService/GetChatMessage

Which seems like a trouble with gathering port.

I've checked init.py for plugin and added few prints to find_port function. The result is next: files = os.listdir(self.manager_dir) (Line 217) has empty list, while self.manager_dir contains path like /tmp/codeium_swscy6t7 and this folder is empty, so it seems to be the reason of None port mentioned in error message above.

This thing also causes infinite loop on my device (in all tries to use plugin), which leads to freezes with closing. I haven't tried to fix it by hardcoding port, so wondering why is there such kind of choosing port πŸ€”

veksha commented 1 year ago

hi. thanks for reporting. made changes that will fix the freeze: 7693451

also plugin will tell you if it can't find port and will ask to check executable (path will be printed). please try to execute that binary in terminal and check output. for some reason server creates directory (/tmp/codeium_swscy6t7), but not populating it with files. we need to find out why. directory is created by plugin. for some reason server does not start.

veksha commented 1 year ago

wondering why is there such kind of choosing port

server tries random free port. hardcoding it is not good idea, i think.

NEK-RA commented 1 year ago

for some reason server does not start.

yes, somewhy got segfault when tried to run server manually

hardcoding it is not good idea

agree :)

upd:

after re-downloading server it seems to start correctly manually

but still can't launch server from plugin: port can't be found message appears

however now in /tmp there is codeium folder with some content:

- child_random_port_<long number here> (folder)
- locks (folder)
- server_outputs (folder)
- number file (i.e. 42435)

each manual press of "Log in" creates one more codeium folder in /tmp πŸ€”

upd 2: It now seems to work in general I press "Log in" at the start, see the message that port is not found. Status at bottom of window says that server shutdowned. However next requests to chat and completeion works properly

veksha commented 1 year ago

try change in the code: if n > 5: to if n > 25:

veksha commented 1 year ago

it waits for port file to appear ~1.5 sec if n >5 and ~7.5 if n>25 i will change it.

NEK-RA commented 1 year ago

Great, thanks! Could I ask here one offtop question?

veksha commented 1 year ago

yes, somewhy got segfault when tried to run server manually after re-downloading server it seems to start correctly manually

interesting why this failed

Great, thanks! Could I ask here one offtop question?

sure!

NEK-RA commented 1 year ago

sure!

Is there any way to re-bind shortcut from Alt+\? If yes, where can I do it?

Probably for questions about "codeium chat" part it's better to open another issue? Or may be you can enable discussions in repo, so there won't be "just question" issues πŸ€”

veksha commented 1 year ago

Is there any way to re-bind shortcut from Alt+\? If yes, where can I do it?

plugin is not binding automatically. you should do it manually by pressing F9 in Command Palette. stated in wiki here: https://wiki.freepascal.org/CudaText#Command_Palette

Is there any way to re-bind shortcut from Alt+\? If yes, where can I do it?

Probably for questions about "codeium chat" part it's better to open another issue? Or may be you can enable discussions in repo, so there won't be "just question" issues πŸ€”

enabled discussions .