nextcloud / context_chat_backend

GNU Affero General Public License v3.0
5 stars 5 forks source link

An error occurred during the request. Can't continue. Failed to enable ExApp #35

Closed xavierg1909 closed 3 months ago

xavierg1909 commented 6 months ago

Describe the bug The error occurs by enabling the Context Chat Backend

To Reproduce Steps to reproduce the behavior:

  1. Go to Exapp
  2. Search Context Chat Backend App
  3. Click on Enable
  4. See error: Failed to enable ExApp

Expected behavior App enable

Server logs (if applicable)

``` [_nc_app_context_chat_backend_logs (4).txt](https://github.com/nextcloud/context_chat_backend/files/14907895/_nc_app_context_chat_backend_logs.4.txt)

Context Chat Backend logs (if applicable, from the docker container)

<paste logs here or attach a file>

Screenshots ContextChatError

Setup Details (please complete the following information):

Additional context Add any other context about the problem here.

kyteinsky commented 6 months ago

Hello, this seems like a different error than the one reported in #36. Do you mind posting the server logs?

gregoryca commented 5 months ago

I have the same error, my nextcloud logs report the following:

Client error: `POST http://localhost:2375/v1.41/containers/create?name=nc_app_context_chat_backend` resulted in a `404 Not Found` response: {"message":"No such image: ghcr.io/nextcloud/context_chat_backend:2.1.1"}
Failed to create container 

If i look in the docker-socket container, i have the following error:

H_POST

    # ACL to restrict container creation, that it has HostConfig.Privileged not set
    acl no_privileged_flag req.body -m reg -i "\"HostConfig\":\s?{[^}]*\"Privileged\""
    # ACL to allow mount volume with strict pattern for name: nc_app_[a-zA-Z0-9_.-]+_data
    acl nc_app_volume_data_only req.body -m reg -i "\"Mounts\":\s?\[\s?{[^}]*\"Source\":\s?\"nc_app_[a-zA-Z0-9_.-]+_data\""
    http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/containers/create } nc_app_container_name !no_privileged_flag nc_app_volume_data_only METH_POST
    # end of container create

    # volume create: POST volumes/create
    # restrict name
    acl nc_app_volume_data req.body -m reg -i "\"Name\":\s?\"nc_app_[a-zA-Z0-9_.-]+_data\""
    # do not allow to use "device" word e.g., "--opt device=:/path/to/dir"
    acl volume_no_device req.body -m reg -i "\"device\""
    http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/volumes/create } nc_app_volume_data !volume_no_device METH_POST
    # volume rm: DELETE volumes/%s
    http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/volumes/nc_app_[a-zA-Z0-9_.-]+_data } METH_DELETE
    # image pull: POST images/create?fromImage=%s
    http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/images/create } METH_POST
    http-request deny
    use_backend bk_docker_engine

backend bk_docker_engine
    mode http
    server dockersocket /var/run/docker.sock
<134>May  5 09:12:28 haproxy[13]: 127.0.0.1:55450 [05/May/2024:09:12:27.830] docker_engine bk_docker_engine/dockersocket 0/0/0/342/342 500 309 - - ---- 1/1/0/0/0 0/0 "POST /v1.41/images/create?fromImage=ghcr.io%2Fnextcloud%2Fcontext_chat_backend-cpu%3A2.1.1 HTTP/1.1"
<134>May  5 09:23:53 haproxy[13]: 127.0.0.1:55462 [05/May/2024:09:12:28.175] docker_engine bk_docker_engine/dockersocket 0/0/0/555/685166 200 2272361 - - ---- 1/1/0/0/0 0/0 "POST /v1.41/images/create?fromImage=ghcr.io%2Fnextcloud%2Fcontext_chat_backend%3A2.1.1 HTTP/1.1"
<134>May  5 09:23:53 haproxy[13]: 127.0.0.1:38664 [05/May/2024:09:23:53.354] docker_engine bk_docker_engine/dockersocket 0/0/0/38/38 404 256 - - ---- 1/1/0/0/0 0/0 "GET /v1.41/containers/nc_app_context_chat_backend/json HTTP/1.1"
<134>May  5 09:23:53 haproxy[13]: 127.0.0.1:38664 [05/May/2024:09:23:53.398] docker_engine bk_docker_engine/dockersocket 0/0/0/24/24 201 418 - - ---- 1/1/0/0/0 0/0 "POST /v1.41/volumes/create HTTP/1.1"
<134>May  5 09:23:53 haproxy[13]: 127.0.0.1:38664 [05/May/2024:09:23:53.423] docker_engine bk_docker_engine/dockersocket 0/0/0/9/9 404 269 - - ---- 1/1/0/0/0 0/0 "POST /v1.41/containers/create?name=nc_app_context_chat_backend HTTP/1.1"

My docker compose file of the container looks like this:

nextcloud-appapi-dsp:
    environment:
        - NC_HAPROXY_PASSWORD=REDACTED
    volumes:
        - /var/run/docker.sock:/var/run/docker.sock
    container_name: nextcloud-appapi-dsp
    hostname: nextcloud-appapi-dsp
    restart: unless-stopped
    privileged: true
    image: ghcr.io/cloud-py-api/nextcloud-appapi-dsp:release
    network_mode: host
gregoryca commented 4 months ago

pretty much the same issue here. logs report that the container couldn't be made.

kyteinsky commented 4 months ago

hello @gregoryca, can you check if the image can be downloaded via the docker cli from the same machine/container as the docker socket proxy so we can be sure of the origin of the issue, if it's from the docker side or AppAPI side?

docker image pull ghcr.io/nextcloud/context_chat_backend:2.1.1
github-actions[bot] commented 3 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.