Skip to content
This repository has been archived by the owner on Nov 13, 2024. It is now read-only.

CLI Chat wont start #166

Closed
2 tasks done
press74 opened this issue Nov 10, 2023 · 7 comments · Fixed by #170
Closed
2 tasks done

CLI Chat wont start #166

press74 opened this issue Nov 10, 2023 · 7 comments · Fixed by #170
Labels
bug Something isn't working

Comments

@press74
Copy link

press74 commented Nov 10, 2023

Is this a new bug?

  • I believe this is a new bug
  • I have searched the existing issues, and I could not find an existing issue for this bug

Current Behavior

Start canopy, switch to new terminal to run "canopy chat" and it says that canopy isnt running

Expected Behavior

Canopy chat starts

Steps To Reproduce

Win environment
Occurs inside and outside virtual environment

Relevant log output

Starting Canopy server on 0.0.0.0:8000
INFO:     Started server process [6148]
INFO:     Waiting for application startup.
2023-11-09 20:47:46,231 - MainProcess - canopy_server.app [INFO    ]:  Did not find config file. Initializing engines with default configuration
INFO:     Application startup complete.
INFO:     Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)

At same time:
Error: Canopy server is not running on http://0.0.0.0:8000.
please run `canopy start`

Environment

- Win:
- python3

Additional Context

I am not a coder, just hobbyist, so likely I am just missing something

@press74 press74 added the bug Something isn't working label Nov 10, 2023
@danielcmm
Copy link

Try canopy start --host 127.0.0.1

@igiloh-pinecone
Copy link
Contributor

igiloh-pinecone commented Nov 10, 2023

Hi @press74, thanks for reporting this problem!
It appears that http:0.0.0.0:8000 indeed doesn't resolve correctly on windows. Can you please try

canopy chat --chat-server-url http://localhost:8000/

or maybe

canopy chat --chat-server-url http://127.0.0.1:8000/

like @danielcmm has suggested?

We will fix it in the next version of Canopy, so it will automatically work on Windows.

@press74
Copy link
Author

press74 commented Nov 10, 2023

thank you so much for the quick response. Chat is now connecting, but I am getting the error below. is there a random \ in the code somewhere when using CLI in the terminal? Works fine using the localhost in the browser as you can see from the last line.

INFO: 127.0.0.1:62130 - "GET /health HTTP/1.1" 200 OK
INFO: 127.0.0.1:62142 - "POST /%5Ccontext/chat/completions HTTP/1.1" 404 Not Found
INFO: 127.0.0.1:62271 - "GET /docs HTTP/1.1" 200 OK
INFO: 127.0.0.1:62272 - "GET /docs HTTP/1.1" 200 OK
INFO: 127.0.0.1:62297 - "GET /docs HTTP/1.1" 200 OK
INFO: 127.0.0.1:62297 - "GET /openapi.json HTTP/1.1" 200 OK
INFO: 127.0.0.1:62298 - "POST /context/chat/completions HTTP/1.1" 200 OK

@ss-syndev
Copy link

ss-syndev commented Nov 10, 2023

@igiloh-pinecone

I've experienced this issue as well and wanted to mention the error message when trying to run 'canopy stop' while experiencing the issues detailed above.

Traceback (most recent call last):
File "C:\Python39\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Python39\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "C:\Python39\Scripts\canopy.exe_main
.py", line 7, in
File "C:\Python39\lib\site-packages\click\core.py", line 1130, in call
return self.main(*args, **kwargs)
File "C:\Python39\lib\site-packages\click\core.py", line 1055, in main
rv = self.invoke(ctx)
File "C:\Python39\lib\site-packages\click\core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "C:\Python39\Python39\lib\site-packages\click\core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "C:\Python39\lib\site-packages\click\core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "C:\WorkStuffs\python\Python39\Python39\lib\site-packages\canopy_cli\cli.py", line 581, in stop
res = subprocess.run(["pgrep", "-f", "gunicorn canopy_server.app:app"],
File "C:\Python39\lib\subprocess.py", line 505, in run
with Popen(*popenargs, **kwargs) as process:
File "C:\Python39\lib\subprocess.py", line 951, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Python39\lib\subprocess.py", line 1420, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified

If it's unrelated then there may be an issue with using pgrep on Win.

@igiloh-pinecone
Copy link
Contributor

thank you so much for the quick response. Chat is now connecting, but I am getting the error below. is there a random \ in the code somewhere when using CLI in the terminal? Works fine using the localhost in the browser as you can see from the last line.

INFO: 127.0.0.1:62130 - "GET /health HTTP/1.1" 200 OK INFO: 127.0.0.1:62142 - "POST /%5Ccontext/chat/completions HTTP/1.1" 404 Not Found INFO: 127.0.0.1:62271 - "GET /docs HTTP/1.1" 200 OK INFO: 127.0.0.1:62272 - "GET /docs HTTP/1.1" 200 OK INFO: 127.0.0.1:62297 - "GET /docs HTTP/1.1" 200 OK INFO: 127.0.0.1:62297 - "GET /openapi.json HTTP/1.1" 200 OK INFO: 127.0.0.1:62298 - "POST /context/chat/completions HTTP/1.1" 200 OK

@press74, thanks for the feedback!
You are right, I had a mistake in my previous comment, it was missing a trailing / (edited now for future readers).
Please try this command, it should work:

canopy chat --chat-server-url http://localhost:8000/

I just tested on Windows10 and verified its working.

We will be releasing an official fix very soon.

@igiloh-pinecone
Copy link
Contributor

@igiloh-pinecone

I've experienced this issue as well and wanted to mention the error message when trying to run 'canopy stop' while experiencing the issues detailed above.

@ss-syndev , thank you very much for reporting this!
That's actually a separate issue, happening specifically for canopy stop on windows.
Please free to open a separate issue to track that bug. We will publish a fix for both issues ASAP.

@igiloh-pinecone
Copy link
Contributor

Thank you @press74 @ss-syndev for reporting these problems!
Both were fixed in the latest release (V0.1.4) which is already available.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants