Error creating a new copilot
WKaiH123 opened this issue · comments
Can you run make logs
and share the error that happens when you try to create a copilot?
Can you try to run make restart
? and then give it another try?
I encountered a similar issue, looking into it
2023-12-19 17:46:54 return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
2023-12-19 17:46:54 File "/app/routes/copilot/copilot_controller.py", line 41, in create_new_copilot
2023-12-19 17:46:54 user = get_user_by_email(get_username_from_request(request))
At the same time the above is happening, the logs are outputting these lines:
llm-server_1 | 192.168.80.8 - - [20/Dec/2023 02:30:06] "GET /healthcheck HTTP/1.1" 200 -
llm-server_1 | 192.168.80.8 - - [20/Dec/2023 02:30:17] "GET /healthcheck HTTP/1.1" 200 -
llm-server_1 | 192.168.80.8 - - [20/Dec/2023 02:30:27] "GET /healthcheck HTTP/1.1" 200 -
llm-server_1 | 192.168.80.8 - - [20/Dec/2023 02:30:37] "GET /healthcheck HTTP/1.1" 200 -
It seems it is an error trying to contact localhost
.
POST http://localhost:8888/backend/copilot/ net::ERR_CONNECTION_REFUSED
GET http://localhost:8888/backend/copilot/ net::ERR_CONNECTION_REFUSED
In my case, while I am running a developer/local version, I am doing so on a server. The client (a laptop) I am using to access the server is trying to connect to the localhost (laptop).
If I make the GET request to the server, then I get a proper result []
(instead of the ERR_CONNECTION_REFUSED):
$ curl -i http://my-open-chat-ai-server:8888/backend/copilot
HTTP/1.1 200 OK
Server: nginx/1.25.3
Content-Type: application/json
Content-Length: 3
Connection: keep-alive
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: *
Access-Control-Allow-Headers: *
Access-Control-Expose-Headers: Content-Length,Content-Range
[]
Can you please let me know what command I need to restart nginx once?
Thanks so much.
$ docker compose restart nginx
WARN[0000] The "TARGET" variable is not set. Defaulting to a blank string.
[+] Restarting 1/1
✔ Container opencopilot_nginx_1 Started
Still the same error, but this is a new message in the logs:
dashboard_1 | ⨯ Error: 'sharp' is required to be installed in standalone mode for the image optimization to function correctly. Read more at: https://nextjs.org/docs/messages/sharp-missing-in-production
- "The client (a laptop) I am using to access the server is trying to connect to the localhost (laptop)."
If i undertand correctly, you use the ip of the server and not localhost, when calling the api on the server ?
Also @ah7255703 can you check the issue with sharp?
I went ahead and updated vi ./dashboard/data/base-url.ts
from:
export const baseUrl = 'http://localhost:8888'
to
export const baseUrl = 'http://my-open-chat-ai-server:8888'
The error in the console of my browser has been resolved.
@tpmccallum Hi, after I modified the base-url.ts file, I still didn't solve the problem. How did you solve it?
Problem solved, thank you very much!