-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello, cant connect with NextCloud #3608
Comments
It seems I have the same issue since first started setting up LocalAI AIO docker on CPU few weeks ago. So far I've managed to narrow down the issue to 504 Gateway Timeout - nextcloud log: {
"reqId": "Zu2K5dJu08_G0CoBPxYoHwAAAAQ",
"level": 3,
"time": "2024-09-20T14:48:31+00:00",
"remoteAddr": "192.168.x.xx",
"app": "index",
"method": "GET",
"url": "/apps/assistant/chat/generate?sessionId=15",
"message":"{\"Exception\":\"OCP\\\\TextProcessing\\\\Exception\\\\TaskFailureException\",\"Message\":\"LanguageModel call using provider LocalAI failed: OpenA
I/LocalAI request failed: API request error: Server error: `POST http: //localai.lan/v1/completions` resulted in a `504 Gateway Time-out` response:\\n<html>\\r\\n<head><title>504 Gateway Time-out</title></h
ead>\\r\\n<body>\\r\\n<center><h1>504 Gateway Time-out</h1></center>\\r\\n<hr><c (truncated...)\\n\",\"Code\":0,\"Trace\":[{\"file\":\"/var/www/html/nextcloud/apps/assistant/lib/Controller/ChattyLLMControl
ler.php\",\"line\":444,\"function\":\"runTask\",\"class\":\"OC\\\\TextProcessing\\\\Manager\",\"type\":\"->\"},{\"file\":\"/var/www/html/nextcloud/apps/assistant/lib/Controller/ChattyLLMController.php\",\"
line\":278,\"function\":\"queryLLM\",\"class\":\"OCA\\\\Assistant\\\\Controller\\\\ChattyLLMController\",\"type\":\"->\"},{\"file\":\"/var/www/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php\",
\"line\":232,\"function\":\"generateForSession\",\"class\":\"OCA\\\\Assistant\\\\Controller\\\\ChattyLLMController\",\"type\":\"->\"},{\"file\":\"/var/www/html/nextcloud/lib/private/AppFramework/Http/Dispa
tcher.php\",\"line\":138,\"function\":\"executeController\",\"class\":\"OC\\\\AppFramework\\\\Http\\\\Dispatcher\",\"type\":\"->\"},{\"file\":\"/var/www/html/nextcloud/lib/private/AppFramework/App.php\",\"
line\":184,\"function\":\"dispatch\",\"class\":\"OC\\\\AppFramework\\\\Http\\\\Dispatcher\",\"type\":\"->\"},{\"file\":\"/var/www/html/nextcloud/lib/private/Route/Router.php\",\"line\":331,\"function\":\"m
ain\",\"class\":\"OC\\\\AppFramework\\\\App\",\"type\":\"::\"},{\"file\":\"/var/www/html/nextcloud/lib/base.php\",\"line\":1058,\"function\":\"match\",\"class\":\"OC\\\\Route\\\\Router\",\"type\":\"->\"},{
\"file\":\"/var/www/html/nextcloud/index.php\",\"line\":49,\"function\":\"handleRequest\",\"class\":\"OC\",\"type\":\"::\"}],\"File\":\"/var/www/html/nextcloud/lib/private/TextProcessing/Manager.php\",\"Li
ne\":145,\"Previous\":{\"Exception\":\"RuntimeException\",\"Message\":\"OpenAI/LocalAI request failed: API request error: Server error: `POST http://localai.lan/v1/completions` resulted in a `504 Gateway T
ime-out` response:\\n<html>\\r\\n<head><title>504 Gateway Time-out</title></head>\\r\\n<body>\\r\\n<center><h1>504 Gateway Time-out</h1></center>\\r\\n<hr><c (truncated...)\\n\",\"Code\":0,\"Trace\":[{\"fi
le\":\"/var/www/html/nextcloud/lib/public/TextProcessing/Task.php\",\"line\":103,\"function\":\"process\",\"class\":\"OCA\\\\OpenAi\\\\TextProcessing\\\\FreePromptProvider\",\"type\":\"->\"},{\"file\":\"/v
ar/www/html/nextcloud/lib/private/TextProcessing/Manager.php\",\"line\":136,\"function\":\"visitProvider\",\"class\":\"OCP\\\\TextProcessing\\\\Task\",\"type\":\"->\"},{\"file\":\"/var/www/html/nextcloud/a
pps/assistant/lib/Controller/ChattyLLMController.php\",\"line\":444,\"function\":\"runTask\",\"class\":\"OC\\\\TextProcessing\\\\Manager\",\"type\":\"->\"},{\"file\":\"/var/www/html/nextcloud/apps/assistan
t/lib/Controller/ChattyLLMController.php\",\"line\":278,\"function\":\"queryLLM\",\"class\":\"OCA\\\\Assistant\\\\Controller\\\\ChattyLLMController\",\"type\":\"->\"},{\"file\":\"/var/www/html/nextcloud/li
b/private/AppFramework/Http/Dispatcher.php\",\"line\":232,\"function\":\"generateForSession\",\"class\":\"OCA\\\\Assistant\\\\Controller\\\\ChattyLLMController\",\"type\":\"->\"},{\"file\":\"/var/www/html/
nextcloud/lib/private/AppFramework/Http/Dispatcher.php\",\"line\":138,\"function\":\"executeController\",\"class\":\"OC\\\\AppFramework\\\\Http\\\\Dispatcher\",\"type\":\"->\"},{\"file\":\"/var/www/html/ne
xtcloud/lib/private/AppFramework/App.php\",\"line\":184,\"function\":\"dispatch\",\"class\":\"OC\\\\AppFramework\\\\Http\\\\Dispatcher\",\"type\":\"->\"},{\"file\":\"/var/www/html/nextcloud/lib/private/Rou
te/Router.php\",\"line\":331,\"function\":\"main\",\"class\":\"OC\\\\AppFramework\\\\App\",\"type\":\"::\"},{\"file\":\"/var/www/html/nextcloud/lib/base.php\",\"line\":1058,\"function\":\"match\",\"class\"
:\"OC\\\\Route\\\\Router\",\"type\":\"->\"},{\"file\":\"/var/www/html/nextcloud/index.php\",\"line\":49,\"function\":\"handleRequest\",\"class\":\"OC\",\"type\":\"::\"}],\"File\":\"/var/www/html/nextcloud/
apps/integration_openai/lib/TextProcessing/FreePromptProvider.php\",\"Line\":46},\"message\":\"LanguageModel call using provider LocalAI failed: OpenAI/LocalAI request failed: API request error: Server err
or: `POST http: //localai.lan/v1/completions` resulted in a `504 Gateway Time-out` response:\\n<html>\\r\\n<head><title>504 Gateway Time-out</title></head>\\r\\n<body>\\r\\n<center><h1>504 Gateway Time-out<
/h1></center>\\r\\n<hr><c (truncated...)\\n\",\"exception\":{},\"CustomMessage\":\"LanguageModel call using provider LocalAI failed: OpenAI/LocalAI request failed: API request error: Server error: `POST ht
tp: //localai.lan/v1/completions` resulted in a `504 Gateway Time-out` response:\\n<html>\\r\\n<head><title>504 Gateway Time-out</title></head>\\r\\n<body>\\r\\n<center><h1>504 Gateway Time-out</h1></center
>\\r\\n<hr><c (truncated...)\\n\"}",
"userAgent": "Mozilla/5.0 (X11; Linux x86_64; rv:130.0) Gecko/20100101 Firefox/130.0",
"version": "29.0.7.1"
} This happens when LocalAI instance is behind Nginx Proxy Manager using local domain name. When I use IP there is no obvious error, but LocalAI docker logs shows that response is eventually generated. I've managed to solve that by increasing timeout on Nextcloud VM in
So now text prompts work, but for some reason response is very long and AI is chatting with 'me' on it's own. I suspect it might be something with prompt in Nextcloud. But now if I change back to domain name I'm getting 504 Gateway timeout again, so will have to dig in to Nginx config - any ideas? |
@rabner thanks for your help bro, I increased the timeouts like you told me on the .user.ini but still getting same error
Its totally NextCloud problem, going to close the issue in few days just to check if someone can suggest a solution too. |
I have setting up LocalAI working fine, and NextCloud even detect the models list of LocalAI but when I use any of the features to talk with the LLM it doesnt fetch anything, it get the follow error
The text was updated successfully, but these errors were encountered: