nextcloud / context_chat_backend

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

[bug]: ClientException while context-chat-backend is intalled #31

Closed anolting closed 1 month ago

anolting commented 3 months ago

Describe the bug I tried to installed the context-chat-backend from External Apps - Office and Text section. During the installation process the Nextcloud interface throws popup messages that there are eexceptions occured during the intall process.

To Reproduce Steps to reproduce the behavior:

  1. Go to External Apps - Office and Text section
  2. Click on Deploy and Configure
  3. Go to Nextcloud Protocol page
  4. See error message": "Failed to create container", "userAgent": "--", "version": "28.0.3.2", "exception": { "Exception": "GuzzleHttp\Exception\ClientException", "Message": "Client error: POST http://nextcloud-aio-docker-socket-proxy:2375/v1.41/containers/create?name=nc_app_context_chat_backend resulted in a 404 Not Found response:\n{\"message\":\"No such image: ghcr.io/nextcloud/context_chat_backend:2.0.1\"

Expected behavior Backend installation should be finish without any exception and allow usage afterwards.

Server logs (if applicable)

``` { "reqId": "S4Tbj4BZoctwow3RyisC", "level": 3, "time": "2024-03-30T10:18:40+00:00", "remoteAddr": "", "user": "--", "app": "app_api", "method": "", "url": "--", "message": "Failed to create container", "userAgent": "--", "version": "28.0.3.2", "exception": { "Exception": "GuzzleHttp\\Exception\\ClientException", "Message": "Client error: `POST http://nextcloud-aio-docker-socket-proxy:2375/v1.41/containers/create?name=nc_app_context_chat_backend` resulted in a `404 Not Found` response:\n{\"message\":\"No such image: ghcr.io/nextcloud/context_chat_backend:2.0.1\"}\n\n", "Code": 404, "Trace": [ { "file": "/var/www/html/3rdparty/guzzlehttp/guzzle/src/Middleware.php", "line": 69, "function": "create", "class": "GuzzleHttp\\Exception\\RequestException", "type": "::", "args": [ "*** sensitive parameters replaced ***" ] }, { "file": "/var/www/html/3rdparty/guzzlehttp/promises/src/Promise.php", "line": 204, "function": "GuzzleHttp\\{closure}", "class": "GuzzleHttp\\Middleware", "type": "::", "args": [ "*** sensitive parameters replaced ***" ] }, { "file": "/var/www/html/3rdparty/guzzlehttp/promises/src/Promise.php", "line": 153, "function": "callHandler", "class": "GuzzleHttp\\Promise\\Promise", "type": "::", "args": [ 1, "*** sensitive parameters replaced ***", "*** sensitive parameters replaced ***" ] }, { "file": "/var/www/html/3rdparty/guzzlehttp/promises/src/TaskQueue.php", "line": 48, "function": "GuzzleHttp\\Promise\\{closure}", "class": "GuzzleHttp\\Promise\\Promise", "type": "::", "args": [ "*** sensitive parameters replaced ***" ] }, { "file": "/var/www/html/3rdparty/guzzlehttp/promises/src/Promise.php", "line": 248, "function": "run", "class": "GuzzleHttp\\Promise\\TaskQueue", "type": "->", "args": [ true ] }, { "file": "/var/www/html/3rdparty/guzzlehttp/promises/src/Promise.php", "line": 224, "function": "invokeWaitFn", "class": "GuzzleHttp\\Promise\\Promise", "type": "->", "args": [] }, { "file": "/var/www/html/3rdparty/guzzlehttp/promises/src/Promise.php", "line": 269, "function": "waitIfPending", "class": "GuzzleHttp\\Promise\\Promise", "type": "->", "args": [] }, { "file": "/var/www/html/3rdparty/guzzlehttp/promises/src/Promise.php", "line": 226, "function": "invokeWaitList", "class": "GuzzleHttp\\Promise\\Promise", "type": "->", "args": [] }, { "file": "/var/www/html/3rdparty/guzzlehttp/promises/src/Promise.php", "line": 62, "function": "waitIfPending", "class": "GuzzleHttp\\Promise\\Promise", "type": "->", "args": [] }, { "file": "/var/www/html/3rdparty/guzzlehttp/guzzle/src/Client.php", "line": 187, "function": "wait", "class": "GuzzleHttp\\Promise\\Promise", "type": "->", "args": [] }, { "file": "/var/www/html/3rdparty/guzzlehttp/guzzle/src/ClientTrait.php", "line": 95, "function": "request", "class": "GuzzleHttp\\Client", "type": "->", "args": [ "POST", "http://nextcloud-aio-docker-socket-proxy:2375/v1.41/containers/create?name=nc_app_context_chat_backend", [ [ "ghcr.io/nextcloud/context_chat_backend:2.0.1", "context_chat_backend", [ "nextcloud-aio", [ [ "volume", "nc_app_context_chat_backend_data", "/nc_app_context_chat_backend_data", false ] ], [ "unless-stopped" ] ], [ "AA_VERSION=2.3.2", "APP_SECRET=<>", "APP_ID=context_chat_backend", "APP_DISPLAY_NAME=Context Chat Backend", "APP_VERSION=2.0.1", "And 4 more entries, set log level to debug to see all entries" ], [ [ [ [ "Encoding skipped as the maximum nesting level was reached" ] ] ] ] ], true ] ] }, { "file": "/var/www/html/custom_apps/app_api/lib/DeployActions/DockerActions.php", "line": 139, "function": "post", "class": "GuzzleHttp\\Client", "type": "->", "args": [ "http://nextcloud-aio-docker-socket-proxy:2375/v1.41/containers/create?name=nc_app_context_chat_backend", [ [ "ghcr.io/nextcloud/context_chat_backend:2.0.1", "context_chat_backend", [ "nextcloud-aio", [ [ "volume", "nc_app_context_chat_backend_data", "/nc_app_context_chat_backend_data", false ] ], [ "unless-stopped" ] ], [ "AA_VERSION=2.3.2", "APP_SECRET=G6MzJ4Rz6jmiIJtsaMcOMcyg9bWOroPMJSUbyeRrZwoDBdd/9EzUTa0iBsOFDF3yscFpeMbSMK5zv3GjEm3iHzspMgh2KpNQK/31dfHZVfLfqqvA6tJWTlux0m27IJ48", "APP_ID=context_chat_backend", "APP_DISPLAY_NAME=Context Chat Backend", "APP_VERSION=2.0.1", "And 4 more entries, set log level to debug to see all entries" ], [ [ [ [ "Encoding skipped as the maximum nesting level was reached" ] ] ] ] ] ] ] }, { "file": "/var/www/html/custom_apps/app_api/lib/DeployActions/DockerActions.php", "line": 75, "function": "createContainer", "class": "OCA\\AppAPI\\DeployActions\\DockerActions", "type": "->", "args": [ "*** sensitive parameters replaced ***" ] }, { "file": "/var/www/html/custom_apps/app_api/lib/Command/ExApp/Register.php", "line": 178, "function": "deployExApp", "class": "OCA\\AppAPI\\DeployActions\\DockerActions", "type": "->", "args": [ [ "OCA\\AppAPI\\Db\\ExApp", 1 ], [ "OCA\\AppAPI\\Db\\DaemonConfig", 1 ], [ "*** sensitive parameters replaced ***", "*** sensitive parameters replaced ***" ] ] }, { "file": "/var/www/html/3rdparty/symfony/console/Command/Command.php", "line": 298, "function": "execute", "class": "OCA\\AppAPI\\Command\\ExApp\\Register", "type": "->", "args": [ [ "Symfony\\Component\\Console\\Input\\ArgvInput" ], [ "Symfony\\Component\\Console\\Output\\ConsoleOutput" ] ] }, { "file": "/var/www/html/3rdparty/symfony/console/Application.php", "line": 1040, "function": "run", "class": "Symfony\\Component\\Console\\Command\\Command", "type": "->", "args": [ [ "Symfony\\Component\\Console\\Input\\ArgvInput" ], [ "Symfony\\Component\\Console\\Output\\ConsoleOutput" ] ] }, { "file": "/var/www/html/3rdparty/symfony/console/Application.php", "line": 301, "function": "doRunCommand", "class": "Symfony\\Component\\Console\\Application", "type": "->", "args": [ [ "OCA\\AppAPI\\Command\\ExApp\\Register" ], [ "Symfony\\Component\\Console\\Input\\ArgvInput" ], [ "Symfony\\Component\\Console\\Output\\ConsoleOutput" ] ] }, { "file": "/var/www/html/3rdparty/symfony/console/Application.php", "line": 171, "function": "doRun", "class": "Symfony\\Component\\Console\\Application", "type": "->", "args": [ [ "Symfony\\Component\\Console\\Input\\ArgvInput" ], [ "Symfony\\Component\\Console\\Output\\ConsoleOutput" ] ] }, { "file": "/var/www/html/lib/private/Console/Application.php", "line": 213, "function": "run", "class": "Symfony\\Component\\Console\\Application", "type": "->", "args": [ [ "Symfony\\Component\\Console\\Input\\ArgvInput" ], [ "Symfony\\Component\\Console\\Output\\ConsoleOutput" ] ] }, { "file": "/var/www/html/console.php", "line": 100, "function": "run", "class": "OC\\Console\\Application", "type": "->", "args": [] } ], "File": "/var/www/html/3rdparty/guzzlehttp/guzzle/src/Exception/RequestException.php", "Line": 113, "message": "Failed to create container", "exception": [], "CustomMessage": "Failed to create container" }, "id": "6607e706cae93" } ```

Setup Details (please complete the following information):

Additional context There is the local firewall up and running and managed using ufw. Communication is blocked execpt for traefik proxy and some service ports. For Docker, Containers and local services addtionally protection by using crowdsec has been added.

ufw status numbered
Status: active

     To                         Action      From
     --                         ------      ----
[ 1] OpenSSH                    ALLOW IN    Anywhere                   # Allow Incoming SSH Connections
[ 2] 587/tcp                    ALLOW IN    Anywhere
[ 3] 80/tcp                     ALLOW IN    Anywhere
[ 4] 443                        ALLOW IN    Anywhere
[ 5] 993/tcp                    ALLOW IN    Anywhere
[ 6] 53                         ALLOW IN    Anywhere
[ 7] 51820/udp                  ALLOW IN    Anywhere                   # Allow Incoming Wireguard Connections
[ 8] 3478                       ALLOW IN    Anywhere                   # Allow Incoming Nextcloud STUN Server Connections
[ 9] *.*.*.* 11000 on br-a1cc21fe3448 ALLOW IN    Anywhere                   # Allow Incoming Connections From crowdsec To Nextcloud Apache LB
[10] OpenSSH (v6)               ALLOW IN    Anywhere (v6)              # Allow Incoming SSH Connections
[11] 587/tcp (v6)               ALLOW IN    Anywhere (v6)
[12] 80/tcp (v6)                ALLOW IN    Anywhere (v6)
[13] 443 (v6)                   ALLOW IN    Anywhere (v6)
[14] 993/tcp (v6)               ALLOW IN    Anywhere (v6)
[15] 53 (v6)                    ALLOW IN    Anywhere (v6)
[16] 51820/udp (v6)             ALLOW IN    Anywhere (v6)              # Allow Incoming Wireguard Connections
[17] 3478 (v6)                  ALLOW IN    Anywhere (v6)              # Allow Incoming Nextcloud STUN Server Connections
[18] *.*.*.* 11000 on br-a1cc21fe3448 ALLOW IN    Anywhere (v6)              # Allow Incoming Connections From crowdsec To Nextcloud Apache LB
kyteinsky commented 3 months ago

Hello,

Context Chat PHP Version <<unknown, version bundled in container>>

you need to install this app: https://apps.nextcloud.com/apps/context_chat

No such image: ghcr.io/nextcloud/context_chat_backend:2.0.1

Can you post the output to: docker images | grep context_chat_backend ?

If it's not present, it may be a cache issue or a network issue. Can you try pulling the image manually?

docker pull ghcr.io/nextcloud/context_chat_backend:2.0.1

Then try to install it again from the External Apps page.

anolting commented 3 months ago

HI context chat app is installed using NC Apps page. For you information this is a dockerized AIO installation. Which container is it that wants to download the context chat backend? In our setup none of the containers is allowed to get access and initiate a route to the internet -except the ones who need to be routed. I will try to pull the container at the host and see if it is found by the installer on External Apps page. Best Alex

kyteinsky commented 3 months ago

Which container is it that wants to download the context chat backend?

The main nextcloud container. Precisely the app_api app.

In our setup none of the containers is allowed to get access and initiate a route to the internet -except the ones who need to be routed.

This might be the issue.

github-actions[bot] commented 2 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.

anolting commented 2 months ago

Hello @kyteinsky I've setup the installation using another VM again. On this installation I'm able to disable the firewall and noticing the same issue. I will update this issue later with more details about the setup, running containers and error messages, Best Alex

anolting commented 2 months ago

Hello @kyteinsky as promised here my running containers. The nextcloud/aio-docker-socket-proxy has been successfully installed by installing the context_chat application.

IMAGE STATUS PORTS NAMES nextcloud/aio-apache:latest Up 6 minutes (healthy) 80/tcp, 0.0.0.0:11000->11000/tcp, :::11000->11000/tcp nextcloud-aio-apache nextcloud/aio-notify-push:latest Up 6 minutes (healthy) nextcloud-aio-notify-push nextcloud/aio-nextcloud:latest Up 6 minutes (healthy) 9000/tcp nextcloud-aio-nextcloud nextcloud/aio-docker-socket-proxy:latest Up 7 minutes (healthy) nextcloud-aio-docker-socket-proxy nextcloud/aio-imaginary:latest Up 7 minutes (healthy) nextcloud-aio-imaginary nextcloud/aio-fulltextsearch:latest Up 7 minutes (healthy) 9200/tcp, 9300/tcp nextcloud-aio-fulltextsearch nextcloud/aio-clamav:latest Up 8 minutes (healthy) 3310/tcp, 7357/tcp nextcloud-aio-clamav nextcloud/aio-redis:latest Up 8 minutes (healthy) 6379/tcp nextcloud-aio-redis nextcloud/aio-postgresql:latest Up 8 minutes (healthy) 5432/tcp nextcloud-aio-database nextcloud/aio-talk:latest Up 8 minutes (healthy) 0.0.0.0:3478->3478/tcp, 0.0.0.0:3478->3478/udp, :::3478->3478/tcp, :::3478->3478/udp nextcloud-aio-talk nextcloud/aio-collabora:latest Up 9 minutes (healthy) 9980/tcp nextcloud-aio-collabora nextcloud-aio-collabora

But when it comes to install the context_chat_backend from external apps, the installation fails with this messages:

`

Warnung context_chat RuntimeException Error during request to ExApp (context_chat_backend): Server error: PUT http://context_chat_backend:23000/loadSources resulted in a 503 Service Unavailable response: {"error":"Context Chat is disabled, enable it from AppAPI to use it."} Temporary problem with indexing, trying again soon
Fehler context_chat Error during request to ExApp (context_chat_backend): Server error: PUT http://context_chat_backend:23000/loadSources resulted in a 503 Service Unavailable response: {"error":"Context Chat is disabled, enable it from AppAPI to use it."}
Fehler app_api ServerException Server error: PUT http://context_chat_backend:23000/loadSources resulted in a 503 Service Unavailable response: {"error":"Context Chat is disabled, enable it from AppAPI to use it."} Error during request to ExApp context_chat_backend: Server error: PUT http://context_chat_backend:23000/loadSources resulted in a 503 Service Unavailable response: {"error":"Context Chat is disabled, enable it from AppAPI to use it."}

`

This bold http endpoint seem not to be created compared to the endpoint of app_api whose were created automatically by the installer of app_api itself.

grafik

As I don't know if the marked (bold) http endpoint should be there already or not this information may help you to get an idea whats going wrong here. Best Alex

kyteinsky commented 2 months ago

Hello, thanks for updating the issue with new info. I am not sure about the error from the server logs alone though, it seems something went wrong in the context_chat_backend's container that prevented it from being enabled and available to use. If this is the same issue as before, the backend may have failed to download the model files download.nextcloud.com due to network restrictions. The exact issue can be found only after looking at the logs from the backend's docker container.

anolting commented 2 months ago

Hi @kyteinsky I will update the issue. Best Alex

github-actions[bot] commented 1 month 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.