mattermost / mattermost-plugin-ai

Mattermost Copilot plugin supporting multiple LLMs
https://mattermost.com/copilot
Apache License 2.0
132 stars 24 forks source link

Bug: crash with mattermost-server 9.0.0 and LocalAI backend #79

Closed phreaker0 closed 11 months ago

phreaker0 commented 11 months ago

Steps to reproduce the behavior

  1. Install mattermost-plugin-ai v.0.4.0 on mattermost-server 9.0.0
  2. Ask @ai a question
  3. No response
  4. crash error in the console

--

  1. Install mattermost-plugin-ai v.0.3.2 on mattermost-server 9.0.0
  2. Ask @ai a question
  3. Started with empty response
  4. LocalAI is doing something (high cpu usage for several seconds)
  5. LocalAI is apparently done
  6. Empty response from ai bot stays, no error in the server logs

Expected behavior

ai bot responds to my question after querying LocalAI backend

Screenshots (optional)

v0.3.2: 2023-10-05_09-34_1

Version and Platform

Additional context

Logs for v0.3.2:

Oct 05 08:59:01 chat mattermost[63827]: {"timestamp":"2023-10-05 08:59:01.347 +02:00","level":"error","msg":"Unable to get team for context","caller":"app/plugin_api.go:980","plugin_id":"mattermost-ai","error":"not found"} Oct 05 08:59:01 chat mattermost[63827]: {"timestamp":"2023-10-05 08:59:01.353 +02:00","level":"error","msg":"failed to get github plugin status","caller":"app/plugin_api.go:980","plugin_id":"mattermost-ai","error":"not found"}

Configuration for v0.3.2:

OpenAI Compatible API url: http://192.168.133.25:8080 OpenAI Compatible model: gpt4all-j

AI Large Language Model service: Open AI Compatible AI to generate images: Open AI Compatible

Logs for v0.4.0:

Oct 05 09:06:15 chat mattermost[67410]: {"timestamp":"2023-10-05 09:06:15.669 +02:00","level":"error","msg":"Unable to get team for context","caller":"app/plugin_api.go:980","plugin_id":"mattermost-ai","error":"not found"} Oct 05 09:06:15 chat mattermost[67410]: {"timestamp":"2023-10-05 09:06:15.672 +02:00","level":"error","msg":"failed to get github plugin status","caller":"app/plugin_api.go:980","plugin_id":"mattermost-ai","error":"not found"} Oct 05 09:06:15 chat mattermost[67410]: {"timestamp":"2023-10-05 09:06:15.685 +02:00","level":"error","msg":"plugin process exited","caller":"plugin/hclog_adapter.go:79","plugin_id":"mattermost-ai","wrapped_extras":"pathplugins/mattermost-ai/server/dist/plugin-linux-amd64pid67651errorexit status 2"} Oct 05 09:06:15 chat mattermost[67410]: {"timestamp":"2023-10-05 09:06:15.685 +02:00","level":"error","msg":"RPC call MessageHasBeenPosted to plugin failed.","caller":"plugin/client_rpc_generated.go:241","plugin_id":"mattermost-ai","error":"unexpected EOF"} Oct 05 09:06:16 chat mattermost[67410]: {"timestamp":"2023-10-05 09:06:16.961 +02:00","level":"warn","msg":"Health check failed for plugin","caller":"plugin/health_check.go:59","id":"mattermost-ai","error":"plugin RPC connection is not responding"} Oct 05 09:06:16 chat mattermost[67410]: {"timestamp":"2023-10-05 09:06:16.961 +02:00","level":"warn","msg":"error closing client during Kill","caller":"plugin/hclog_adapter.go:70","plugin_id":"mattermost-ai","wrapped_extras":"errconnection is shut down"} Oct 05 09:06:16 chat mattermost[67410]: {"timestamp":"2023-10-05 09:06:16.961 +02:00","level":"warn","msg":"plugin failed to exit gracefully","caller":"plugin/hclog_adapter.go:72","plugin_id":"mattermost-ai"}

Configuration for v0.4.0:

Name: localai AI Service: OpenAI Compatible API URL: http://192.168.133.25:8080 Default Model: gpt4all-j

AI Large Language Model service: localai

crspeller commented 11 months ago

@phreaker0 Thanks for the report. Could you turn on DEBUG level logging for the MM server and try again? It should then log a crash that should give us a clue as to what is going on here.

phreaker0 commented 11 months ago

@crspeller i turned on debug logging. Unfortunately the AI bot account was deactivated because the plugin crashed too often. I don't know how to enable the bot account again as it's managed by the plugin and it seems the plugin doesn't enable it on restart so I can't directly write a message to the AI bot account but I did the following:

Clicked on the "React for me" action for a random message

{"timestamp":"2023-10-07 13:27:40.044 +02:00","level":"error","msg":"Unable to get team for context","caller":"app/plugin_api.go:980","plugin_id":"mattermost-ai","error":"not found"} {"timestamp":"2023-10-07 13:27:40.050 +02:00","level":"error","msg":"failed to get github plugin status","caller":"app/plugin_api.go:980","plugin_id":"mattermost-ai","error":"not found"} {"timestamp":"2023-10-07 13:27:40.051 +02:00","level":"debug","msg":"","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:27:40.051 +02:00","level":"debug","msg":"","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:27:40.051 +02:00","level":"debug","msg":"\u001b[31m2023/10/07 13:27:40 [Recovery] 2023/10/07 - 13:27:40 panic recovered:","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:27:40.051 +02:00","level":"debug","msg":"POST /plugins/mattermost-ai/post/esqmk5dbmfg9xygeih3ubm6b9e/react HTTP/1.1","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:27:40.051 +02:00","level":"debug","msg":"Host: chat.REDACTED","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:27:40.051 +02:00","level":"debug","msg":"Accept: /","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:27:40.051 +02:00","level":"debug","msg":"Accept-Encoding: gzip, deflate, br","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:27:40.051 +02:00","level":"debug","msg":"Accept-Language: de","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:27:40.051 +02:00","level":"debug","msg":"Content-Length: 0","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:27:40.051 +02:00","level":"debug","msg":"Cookie: rl_user_id=REDACTED; rl_user_id=REDACTED; rl_user_id=REDACTED; rl_anonymous_id=REDACTED; MMUSERID=REDACTED; MMCSRF=REDACTED","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:27:40.051 +02:00","level":"debug","msg":"Mattermost-User-Id: jqnsngomdibmxqfqmrohd7mqdo","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:27:40.051 +02:00","level":"debug","msg":"Origin: https://chat.REDACTED","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:27:40.051 +02:00","level":"debug","msg":"Sec-Ch-Ua: \"Not)A;Brand\";v=\"24\", \"Chromium\";v=\"116\"","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:27:40.051 +02:00","level":"debug","msg":"Sec-Ch-Ua-Mobile: ?0","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:27:40.051 +02:00","level":"debug","msg":"Sec-Ch-Ua-Platform: \"Linux\"","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:27:40.051 +02:00","level":"debug","msg":"Sec-Fetch-Dest: empty","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:27:40.051 +02:00","level":"debug","msg":"Sec-Fetch-Mode: cors","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:27:40.051 +02:00","level":"debug","msg":"Sec-Fetch-Site: same-origin","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:27:40.051 +02:00","level":"debug","msg":"User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.5845.188 Electron/26.2.1 Safari/537.36 Mattermost/5.5.1","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:27:40.051 +02:00","level":"debug","msg":"X-Csrf-Token: ei8esgjejbfh5mjoxgys8pg5ey","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:27:40.051 +02:00","level":"debug","msg":"X-Forwarded-For: REDACTED","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:27:40.051 +02:00","level":"debug","msg":"X-Forwarded-Proto: https","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:27:40.051 +02:00","level":"debug","msg":"X-Frame-Options: SAMEORIGIN","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:27:40.051 +02:00","level":"debug","msg":"X-Real-Ip: REDACTED","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:27:40.051 +02:00","level":"debug","msg":"X-Requested-With: XMLHttpRequest","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:27:40.051 +02:00","level":"debug","msg":"","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:27:40.051 +02:00","level":"debug","msg":"","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:27:40.051 +02:00","level":"debug","msg":"runtime error: invalid memory address or nil pointer dereference","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:27:40.051 +02:00","level":"debug","msg":"runtime/panic.go:261 (0x44f297)","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:27:40.051 +02:00","level":"debug","msg":"runtime/signal_unix.go:861 (0x44f265)","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:27:40.051 +02:00","level":"debug","msg":"github.com/mattermost/mattermost-plugin-ai/server/service.go:172 (0xc76d43)","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:27:40.051 +02:00","level":"debug","msg":"github.com/mattermost/mattermost-plugin-ai/server/api_post.go:77 (0xc6cb33)","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:27:40.051 +02:00","level":"debug","msg":"github.com/gin-gonic/gin@v1.7.7/context.go:168 (0xc6b15e)","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:27:40.051 +02:00","level":"debug","msg":"github.com/mattermost/mattermost-plugin-ai/server/api.go:49 (0xc6b148)","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:27:40.051 +02:00","level":"debug","msg":"github.com/gin-gonic/gin@v1.7.7/context.go:168 (0x934b39)","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:27:40.051 +02:00","level":"debug","msg":"github.com/gin-gonic/gin@v1.7.7/recovery.go:99 (0x934b27)","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:27:40.051 +02:00","level":"debug","msg":"github.com/gin-gonic/gin@v1.7.7/context.go:168 (0x933d1d)","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:27:40.051 +02:00","level":"debug","msg":"github.com/gin-gonic/gin@v1.7.7/logger.go:241 (0x933cec)","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:27:40.051 +02:00","level":"debug","msg":"github.com/gin-gonic/gin@v1.7.7/context.go:168 (0x932e3a)","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:27:40.051 +02:00","level":"debug","msg":"github.com/gin-gonic/gin@v1.7.7/gin.go:555 (0x932acd)","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:27:40.051 +02:00","level":"debug","msg":"github.com/gin-gonic/gin@v1.7.7/gin.go:511 (0x932611)","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:27:40.051 +02:00","level":"debug","msg":"github.com/mattermost/mattermost-plugin-ai/server/api.go:45 (0xc6b0c4)","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:27:40.051 +02:00","level":"debug","msg":"github.com/mattermost/mattermost/server/public@v0.0.8/plugin/client_rpc.go:453 (0xb953f7)","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:27:40.051 +02:00","level":"debug","msg":"reflect/value.go:596 (0x4c5726)","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:27:40.051 +02:00","level":"debug","msg":"reflect/value.go:380 (0x4c47f8)","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:27:40.051 +02:00","level":"debug","msg":"net/rpc/server.go:382 (0x7c1273)","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:27:40.051 +02:00","level":"debug","msg":"runtime/asm_amd64.s:1650 (0x46b660)","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:27:40.051 +02:00","level":"debug","msg":"\u001b[0m","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"}

Mentioned AI bot account from another channel

{"timestamp":"2023-10-07 13:30:23.046 +02:00","level":"error","msg":"Unable to get team for context","caller":"app/plugin_api.go:980","plugin_id":"mattermost-ai","error":"not found"} {"timestamp":"2023-10-07 13:30:23.049 +02:00","level":"error","msg":"failed to get github plugin status","caller":"app/plugin_api.go:980","plugin_id":"mattermost-ai","error":"not found"} {"timestamp":"2023-10-07 13:30:23.052 +02:00","level":"debug","msg":"panic: runtime error: invalid memory address or nil pointer dereference","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:30:23.052 +02:00","level":"debug","msg":"[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0xc757de]","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:30:23.052 +02:00","level":"debug","msg":"","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:30:23.052 +02:00","level":"debug","msg":"goroutine 178 [running]:","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:30:23.052 +02:00","level":"debug","msg":"main.(Plugin).newConversation(0xc00069ed80, {{0xc00055c400, 0x1d}, {0xc00069c3c0, 0x14}, {0x0, 0x0}, 0xc00069a900, 0xc0003a44b0, 0x0, ...})","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:30:23.052 +02:00","level":"debug","msg":"\tgithub.com/mattermost/mattermost-plugin-ai/server/service.go:34 +0x1de","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:30:23.052 +02:00","level":"debug","msg":"main.(Plugin).processUserRequestToBot(0xc00069ed80?, {{0xc00055c400, 0x1d}, {0xc00069c3c0, 0x14}, {0x0, 0x0}, 0xc00069a900, 0xc0003a44b0, 0x0, ...})","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:30:23.052 +02:00","level":"debug","msg":"\tgithub.com/mattermost/mattermost-plugin-ai/server/service.go:21 +0x58","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:30:23.052 +02:00","level":"debug","msg":"main.(Plugin).handleMentions(0xc00037a8ba?, 0xc000691720?, 0xc00069a900, 0x2?)","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:30:23.052 +02:00","level":"debug","msg":"\tgithub.com/mattermost/mattermost-plugin-ai/server/plugin.go:229 +0xec","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:30:23.053 +02:00","level":"debug","msg":"main.(Plugin).handleMessages(0xc00069ed80, 0xc0006a69a0)","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:30:23.053 +02:00","level":"debug","msg":"\tgithub.com/mattermost/mattermost-plugin-ai/server/plugin.go:206 +0x1fe","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:30:23.053 +02:00","level":"debug","msg":"main.(Plugin).MessageHasBeenPosted(0xc00069ed80, 0xe924e0?, 0xc00069ed80?)","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:30:23.053 +02:00","level":"debug","msg":"\tgithub.com/mattermost/mattermost-plugin-ai/server/plugin.go:172 +0x1f","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:30:23.053 +02:00","level":"debug","msg":"github.com/mattermost/mattermost/server/public/plugin.(hooksRPCServer).MessageHasBeenPosted(0x2?, 0xc000247440, 0x1?)","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:30:23.053 +02:00","level":"debug","msg":"\tgithub.com/mattermost/mattermost/server/public@v0.0.8/plugin/client_rpc_generated.go:251 +0x46","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:30:23.053 +02:00","level":"debug","msg":"reflect.Value.call({0xc00060ccc0?, 0xc0000a0aa0?, 0x13?}, {0xea4b52, 0x4}, {0xc000301ef8, 0x3, 0x3?})","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:30:23.053 +02:00","level":"debug","msg":"\treflect/value.go:596 +0xce7","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:30:23.053 +02:00","level":"debug","msg":"reflect.Value.Call({0xc00060ccc0?, 0xc0000a0aa0?, 0x0?}, {0xc0001216f8?, 0x0?, 0x0?})","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:30:23.053 +02:00","level":"debug","msg":"\treflect/value.go:380 +0xb9","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:30:23.053 +02:00","level":"debug","msg":"net/rpc.(service).call(0xc000687c40, 0x0?, 0x0?, 0xc00068e290, 0xc000689080, 0x0?, {0xcdfb80?, 0xc000247440?, 0x0?}, {0xcdfbc0, ...}, ...)","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:30:23.053 +02:00","level":"debug","msg":"\tnet/rpc/server.go:382 +0x214","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:30:23.053 +02:00","level":"debug","msg":"created by net/rpc.(Server).ServeCodec in goroutine 55","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:30:23.053 +02:00","level":"debug","msg":"\tnet/rpc/server.go:479 +0x410","caller":"plugin/hclog_adapter.go:54","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:30:23.055 +02:00","level":"error","msg":"RPC call MessageHasBeenPosted to plugin failed.","caller":"plugin/client_rpc_generated.go:241","plugin_id":"mattermost-ai","error":"unexpected EOF"} {"timestamp":"2023-10-07 13:30:23.055 +02:00","level":"error","msg":"plugin process exited","caller":"plugin/hclog_adapter.go:79","plugin_id":"mattermost-ai","wrapped_extras":"pathplugins/mattermost-ai/server/dist/plugin-linux-amd64pid82650errorexit status 2"}

misc

{"timestamp":"2023-10-07 13:30:46.618 +02:00","level":"warn","msg":"Health check failed for plugin","caller":"plugin/health_check.go:59","id":"mattermost-ai","error":"plugin RPC connection is not responding"} {"timestamp":"2023-10-07 13:30:46.618 +02:00","level":"debug","msg":"Restarting plugin due to failed health check","caller":"plugin/health_check.go:72","id":"mattermost-ai"} {"timestamp":"2023-10-07 13:30:46.618 +02:00","level":"warn","msg":"error closing client during Kill","caller":"plugin/hclog_adapter.go:70","plugin_id":"mattermost-ai","wrapped_extras":"errconnection is shut down"} {"timestamp":"2023-10-07 13:30:46.618 +02:00","level":"warn","msg":"plugin failed to exit gracefully","caller":"plugin/hclog_adapter.go:72","plugin_id":"mattermost-ai"} {"timestamp":"2023-10-07 13:30:47.061 +02:00","level":"debug","msg":"starting plugin","caller":"plugin/hclog_adapter.go:52","plugin_id":"mattermost-ai","wrapped_extras":"pathplugins/mattermost-ai/server/dist/plugin-linux-amd64args[plugins/mattermost-ai/server/dist/plugin-linux-amd64]"} {"timestamp":"2023-10-07 13:30:47.061 +02:00","level":"debug","msg":"plugin started","caller":"plugin/hclog_adapter.go:52","plugin_id":"mattermost-ai","wrapped_extras":"pathplugins/mattermost-ai/server/dist/plugin-linux-amd64pid82730"} {"timestamp":"2023-10-07 13:30:47.061 +02:00","level":"debug","msg":"waiting for RPC address","caller":"plugin/hclog_adapter.go:52","plugin_id":"mattermost-ai","wrapped_extras":"pathplugins/mattermost-ai/server/dist/plugin-linux-amd64"} {"timestamp":"2023-10-07 13:30:47.081 +02:00","level":"debug","msg":"using plugin","caller":"plugin/hclog_adapter.go:52","plugin_id":"mattermost-ai","wrapped_extras":"version1"} {"timestamp":"2023-10-07 13:30:47.081 +02:00","level":"debug","msg":"plugin address","caller":"plugin/hclog_adapter.go:52","plugin_id":"mattermost-ai","wrapped_extras":"address/tmp/plugin2209235927networkunixtimestamp2023-10-07T13:30:47.081+0200"} {"timestamp":"2023-10-07 13:30:47.149 +02:00","level":"debug","msg":"Plugin activated","caller":"plugin/environment.go:350","plugin_id":"mattermost-ai","version":"0.4.0"}

jespino commented 11 months ago

I think the problem here is the admin console is using openai-compatible and the server code is using openaicompatible to identify the type of integration. You can solve it locally going to your mattermost server config.json file and modififying it manually and restarting the server. I going to put in place a PR to solve that problem. Thanks for reporting it.

phreaker0 commented 11 months ago

@jespino thank you, this works. But for me the AI bot account is still deactivated because of the past crashes, should I file a dedicated issue for this?

crspeller commented 11 months ago

@phreaker0 It's strange that the bot account would be disabled. I don't think there is a mechanism to disable bot accounts for plugin crashes.

If you mean the plugin you can activate it from the system console on the plugins page.

If the actual bot account disabled for some reason you can use mmctl to activate it with mmctl user activate ai

phreaker0 commented 11 months ago

@crspeller thanks, the mmctl command worked for enabling the bot account. Didn't think about the CLI because it wasn't possible in the System console.

Twilek-de commented 10 months ago

@crspeller thanks, the mmctl command worked for enabling the bot account. Didn't think about the CLI because it wasn't possible in the System console.

Does it work for you now? I have the same problem, that I am getting empty replies even after adjusting the "openaicompatible" config. When using curl directly the localai LLM works.

phreaker0 commented 10 months ago

@crspeller thanks, the mmctl command worked for enabling the bot account. Didn't think about the CLI because it wasn't possible in the System console.

Does it work for you now? I have the same problem, that I am getting empty replies even after adjusting the "openaicompatible" config. When using curl directly the localai LLM works.

Unfortunately no, I still need to figure that one out.