Closed aef5748 closed 3 weeks ago
hi, can you provide the following info?
data/nextcloud.log
)occ app_api:app:list
Hi, here is nextcloud log. occ app_api:app:list
www-data@5bb352d0e68e:~/html$ php occ app_api:app:list
ExApps:
context_chat_backend (Context Chat Backend): 3.0.1 [enabled]
www-data@5bb352d0e68e:~/html$
nextcloud log: nextcloud_1.log nextcloud_2.log
context chat backend log: context_chat_log_1.txt context_chat_log_2.txt
When a problem occurs, context chat needs to be restarted before the next task can be executed.
If the "OpenAI and LocalAI integration" is installed, the following error message will appear
INFO: 172.18.0.1:33278 - "POST /query HTTP/1.1" 500 Internal Server Error
....
httpx.RemoteProtocolError: Server disconnected without sending a response.
context chat backend log: context_chat_log_3.txt
nextcloud log: nextcloud_3.log
For the first part, an additional text generation provider is necessary with the default configuration. This provider can be llm2, integration_openai, etc. I'm sorry I will update the readme. For the second part (_3 logs), openai is installed so it should work but openai itself is not working as seen from the logs because no api key has been provided for openai. The api key can be supplied in "Admin Settings -> Artificial Intelligence -> Integration OpenAI". Here, there are options to also change to local AI by providing a Service URL if you happen to have an instance.
And, as said in #73, you should also be able to use a model inside context_chat_backend using llama
or other loaders.
Please let me know if you'd like me to dive in on any of these ways.
I am still researching and understanding the part about changing the model.
When setting up LocalAI, is it necessary to set an API Key? I set it up in another environment without setting the API Key and the contextual chat still works fine.
I have set up the LocalAI environment and can operate it independently I have also set relevant parameters on Nextcloud and set the API Key, but it still does not work.
nextcloud log nextcloud_4.log
context chat log context_chat_log_4.txt
httpx.RemoteProtocolError: Server disconnected without sending a response.
seems to be a proxy issue. Can you post the logs of the docker socket proxy and the value of the env var TIMEOUT_SERVER
of the container?
See https://github.com/cloud-py-api/docker-socket-proxy?tab=readme-ov-file#slow-responding-exapps
When setting up LocalAI, is it necessary to set an API Key?
It's not if your local AI does not require it.
I set it up in another environment without setting the API Key and the contextual chat still works fine.
is there anything different in that environment where it works?
Can you post the logs of the docker socket proxy and the value of the env var TIMEOUT_SERVER of the container?
I used manual registration. During the question process, the docker socket proxy did not see any action. This is the log and env of the docker socket proxy socket_proxy_env.txt socket_proxy_log.txt
is there anything different in that environment where it works? Only add the company's proxy, but I am currently using a test network without going through the company's proxy.
My docker environment is set up on a bridged network called nextcloud, but I see that the network parameter of the daemon is host. Does it matter?
I also tried changing the network to nextcloud, but got the same error message
php occ app_api:daemon:register --net nextcloud --compute_device cuda --haproxy_password nextcloud "manual_install" "Manual install" "manual-install" http 192.168.2.6 http://192.168.2.6:3000
No, it is not an issue with the docker socket proxy since the connection happens and context_chat_backend receives the query. The error happens when we check up on the status of a scheduled text2text task. It is a network error seems to be caused by use of already closed connection from a connection pool (https://github.com/encode/httpx/discussions/2056).
Please do the following:
/home/sw/Nextcloud/container/context/context_chat_backend
and apply the patch attached (nice that you mounted them, makes it easier to debug). The diff can be applied like this: git apply catch_remote_proc_err.txt
in a directory where context_chat_backend/
folder can be found.Also, you should mount the config file at /app/persistent_storage/config.yaml
otherwise it uses the default one.
The error happens when we check up on the status of a scheduled text2text task. It is a network error seems to be caused by use of already closed connection from a connection pool (encode/httpx#2056).
we can check the correctness of this statement by adding 3 attempts to send a request everywhere in such places:
response = nc.ocs("POST", "/ocs/v1.php/taskprocessing/schedule", ...)
personally I don't think it's httpx
failure, but if it really is, we'll just change implementation of "nc.ocs" a little bit.
We check for the status in a loop so that should allow us more than enough time to see it. Modified the patch to also print the request no.
Checkout the master branch at /home/sw/Nextcloud/container/context/context_chat_backend and apply the patch attached (nice that you mounted them, makes it easier to debug). The diff can be applied like this: git apply catch_remote_proc_err.txt in a directory where context_chat_backend/ folder can be found.
Have downloaded the update as above and used the context_chat_backend v3.1.0 Then update the following apps of Nextcloud:
AppAPI=3.2.1
Nextcloud Assistant=2.1.1
Nextcloud Assistant Context Chat=3.1.0
OpenAI and LocalAI integration=3.1.2
Error messages still occur Here are Nextcloud and Context Chat Backend logs: nextcloud.log context_chat_log.txt
Extract and post logs from Nextcloud's apache server, maybe the container logs should be it
I found the apache log in the /var/log/apache2 directory, but they were all empty files.
Can you tell me how long does it take before it errors out?
An error will occur within 1 minute after the context chat backend receives it.
10/14 Update I tried it again and found that the following steps can work, but the results will not be returned to Nextcloud.
2 id=9 status='STATUS_SCHEDULED' output=None
ctrl+c
on nextcloud to interrupt the original php occ corn.php
, and then restart the next php occ corn.php
TRACE: 172.18.0.1:36526 - HTTP connection lost
15 id=9 status='STATUS_SCHEDULED' output=None
16 id=9 status='STATUS_RUNNING' output=None
TRACE: 172.18.0.1:36526 - ASGI [33] Completed
I don’t understand why the context chat backend needs to use LocalAi to generate text since it already has its own model. Can you briefly explain it? Thank you
I would like to ask an additional question, what should the owner of all files be set to? I tried setting up two accounts, root and 1000 for testin
Hi, try to setup 4 background workers like described here: https://docs.nextcloud.com/server/latest/admin_manual/ai/overview.html#improve-ai-task-pickup-speed This should solve the issue. What is happening is that the first task of context chat is executed by cron.php but then one more task is scheduled by context chat with task type "text2text". This needs to be picked by another cron process (either 5 mins later or with another php cron.php). When you closed the first manual cron process, it picked the second and generated an output but the first process was not there to deliver the result to the server. I'm sorry the documentation is being updated at the moment.
Thanks for your help, it's work.
Hi,
My previous installation worked normally, but when I re-installed it on another computer, it appeared that I could register but could not ask questions. The settings are all the same, I don’t know what happened. Could you help me to check it?
The versions used are as follows:
When asking a question, the following error message will pop up:
detail log context_chat_3.0.2_issue_external_20240925.txt
docker-compose
``` version: '3.7' networks: nextcloud: name: nextcloud driver: bridge services: db: image: postgres:12-alpine container_name: Nextcloud-DB restart: always volumes: - /home/sw/Nextcloud/container/30/db:/var/lib/postgresql/data environment: - POSTGRES_DB=nextcloud - POSTGRES_USER=nextcloud - POSTGRES_PASSWORD=nextcloud - TZ=Asia/Taipei networks: - nextcloud app: image: nextcloud:30.0.0-apache container_name: Nextcloud restart: always ports: - 3000:80 depends_on: - db - appapi - backend volumes: - /home/sw/Nextcloud/container/30/web:/var/www/html - /etc/localtime:/etc/localtime:ro environment: - POSTGRES_DB=nextcloud - POSTGRES_HOST=db - POSTGRES_USER=nextcloud - POSTGRES_PASSWORD=nextcloud networks: - nextcloud appapi: image: ghcr.io/cloud-py-api/nextcloud-appapi-dsp:v1.3.2 container_name: nextcloud-appapi-dsp hostname: nextcloud-appapi-dsp restart: unless-stopped privileged: true volumes: - /var/run/docker.sock:/var/run/docker.sock:ro environment: - NC_HAPROXY_PASSWORD=nextcloud - TIMEOUT_SERVER=1800s - TIMEOUT_CONNECT=300s - TIMEOUT_CLIENT=300s networks: - nextcloud backend: image: ghcr.io/nextcloud/context_chat_backend:3.0.2 container_name: context_chat_backend restart: always privileged: true volumes: - /var/run/docker.sock:/var/run/docker.sock:ro - /home/sw/Nextcloud/container/content/config.yaml:/app/config.yaml - /home/sw/Nextcloud/container/context/persistent_storage:/app/persistent_storage - /home/sw/Nextcloud/container/context/context_chat_backend:/app/context_chat_backend ports: - 10034:10034 environment: - AA_VERSION=2.7.0 - APP_VERSION=3.0.2 - APP_SECRET=12345 - APP_ID=context_chat_backend - APP_DISPLAY_NAME=Context Chat Backend - APP_HOST=0.0.0.0 - APP_PORT=10034 - APP_PERSISTENT_STORAGE=persistent_storage - NEXTCLOUD_URL=http://192.168.2.6:3000 # - TRANSFORMERS_OFFLINE=1 networks: - nextcloud deploy: resources: reservations: devices: - driver: nvidia count: 1 capabilities: [gpu] ```