nil pointer dereference #37

Closed
opened 2024-11-03 22:39:14 +00:00 by skobkin · 0 comments
Owner
telegram-llm-bot  | 2024/11/03 22:36:46 INFO history-message-save chat=-*redacted* from_id=*redacted* from_name=Alexey text="@*redacted* Ты живой?"                                                              
telegram-llm-bot  | 2024/11/03 22:36:46 INFO stats-middleware: counting message chat type in stats type=supergroup                                                                                                   
telegram-llm-bot  | 2024/11/03 22:36:46 INFO /any-message type=mention
telegram-llm-bot  | 2024/11/03 22:36:46 INFO /mention chat=-*redacted*                                                                                                                                            
telegram-llm-bot  | panic: runtime error: invalid memory address or nil pointer dereference
telegram-llm-bot  | [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x80d959]                                                                                       
telegram-llm-bot  |                                                                                                                                                                                                  
telegram-llm-bot  | goroutine 54 [running]:
telegram-llm-bot  | telegram-ollama-reply-bot/llm.chatMessageToText({{0xc000284848, 0x6}, {0xc000284872, 0x7}, {0xc000284941, 0x395}, 0x0, 0x0, 0x0})                                                                
telegram-llm-bot  |     /build/llm/request_context.go:104 +0x99
telegram-llm-bot  | telegram-ollama-reply-bot/llm.chatMessageToOpenAiChatCompletionMessage({{0xc000284848, 0x6}, {0xc000284872, 0x7}, {0xc000284941, 0x395}, 0x0, 0x0, 0x0})                                         
telegram-llm-bot  |     /build/llm/request_context.go:90 +0x126                                                                                                                                                      
telegram-llm-bot  | telegram-ollama-reply-bot/llm.(*LlmConnector).HandleChatMessage(0xc00007c1e8, {{0xc0009e03c8, 0x6}, {0xc0009e03f2, 0x7}, {0xc0009e04c1, 0x1f}, 0x0, 0x0, 0x0}, ...)                              
telegram-llm-bot  |     /build/llm/llm.go:54 +0x6c5
telegram-llm-bot  | telegram-ollama-reply-bot/bot.(*Bot).processMention(0xc00039c280, 0xc0009b4008)                                                                                                                  
telegram-llm-bot  |     /build/bot/bot.go:149 +0x2e5                                                                                                                                                                 
telegram-llm-bot  | telegram-ollama-reply-bot/bot.(*Bot).textMessageHandler(0xc00039c280, 0xc000638140?, {0x30e5bd7, 0xc0009b4008, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...})                                               
telegram-llm-bot  |     /build/bot/bot.go:122 +0x40a                                                                                                                                                                 
telegram-llm-bot  | github.com/mymmrac/telego/telegohandler.(*HandlerGroup).processUpdateWithMiddlewares(0xc0000e9980, 0xc000432540, {0x30e5bd7, 0xc0009b4008, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...}, ...)              
telegram-llm-bot  |     /go/pkg/mod/github.com/mymmrac/telego@v0.29.1/telegohandler/handler_group.go:98 +0x4bd                                                                                                       
telegram-llm-bot  | github.com/mymmrac/telego/telegohandler.(*HandlerGroup).processUpdateWithMiddlewares.func1.1()                                                                                                   
telegram-llm-bot  |     /go/pkg/mod/github.com/mymmrac/telego@v0.29.1/telegohandler/handler_group.go:76 +0x92                                                                                                        
telegram-llm-bot  | sync.(*Once).doSlow(0x0?, 0x0?)                                                                                                                                                                  
telegram-llm-bot  |     /usr/local/go/src/sync/once.go:76 +0xb4                                                                                                                                                      
telegram-llm-bot  | sync.(*Once).Do(...)                                                                                                                                                                             
telegram-llm-bot  |     /usr/local/go/src/sync/once.go:67                                                                                                                                                            
telegram-llm-bot  | github.com/mymmrac/telego/telegohandler.(*HandlerGroup).processUpdateWithMiddlewares.func1(0xc00021c000?, {0x30e5bd7, 0xc0009b4008, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...})                     
telegram-llm-bot  |     /go/pkg/mod/github.com/mymmrac/telego@v0.29.1/telegohandler/handler_group.go:75 +0x89                                                                                                        
telegram-llm-bot  | telegram-ollama-reply-bot/bot.(*Bot).chatTypeStatsCounter(0xc00039c280, 0xc000432540, {0x30e5bd7, 0xc0009b4008, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...}, ...)                                         
telegram-llm-bot  |     /build/bot/middleware.go:31 +0x39c                                                                                                                                                           
telegram-llm-bot  | github.com/mymmrac/telego/telegohandler.(*HandlerGroup).processUpdateWithMiddlewares(0xc0000e9980, 0xc000432540, {0x30e5bd7, 0xc0009b4008, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...}, ...)
telegram-llm-bot  |     /go/pkg/mod/github.com/mymmrac/telego@v0.29.1/telegohandler/handler_group.go:74 +0x283                                                                                                       
telegram-llm-bot  | github.com/mymmrac/telego/telegohandler.(*HandlerGroup).processUpdateWithMiddlewares.func1.1()                                                                                                   
telegram-llm-bot  |     /go/pkg/mod/github.com/mymmrac/telego@v0.29.1/telegohandler/handler_group.go:76 +0x92                                                                                                        
telegram-llm-bot  | sync.(*Once).doSlow(0x8487c0?, 0xc0011c1100?)                                                                                                                                                    
telegram-llm-bot  |     /usr/local/go/src/sync/once.go:76 +0xb4                                                                                                                                                      
telegram-llm-bot  | sync.(*Once).Do(...)
telegram-llm-bot  |     /usr/local/go/src/sync/once.go:67                                                                                                                                                            
telegram-llm-bot  | github.com/mymmrac/telego/telegohandler.(*HandlerGroup).processUpdateWithMiddlewares.func1(0x0?, {0x30e5bd7, 0xc0009b4008, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...})                              
telegram-llm-bot  |     /go/pkg/mod/github.com/mymmrac/telego@v0.29.1/telegohandler/handler_group.go:75 +0x89                                                                                                        
telegram-llm-bot  | telegram-ollama-reply-bot/bot.(*Bot).chatHistory(0xc00039c280, 0xc000432540, {0x30e5bd7, 0xc0009b4008, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...}, ...)                                                  
telegram-llm-bot  |     /build/bot/middleware.go:49 +0x13d                                                                                                                                                           
telegram-llm-bot  | github.com/mymmrac/telego/telegohandler.(*HandlerGroup).processUpdateWithMiddlewares(0xc0000e9980, 0xc000432540, {0x30e5bd7, 0xc0009b4008, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...}, ...)              
telegram-llm-bot  |     /go/pkg/mod/github.com/mymmrac/telego@v0.29.1/telegohandler/handler_group.go:74 +0x283                                                                                                       
telegram-llm-bot  | github.com/mymmrac/telego/telegohandler.(*HandlerGroup).processUpdate(0xc0000e9980, 0x0?, {0x30e5bd7, 0xc0009b4008, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...})                                          
telegram-llm-bot  |     /go/pkg/mod/github.com/mymmrac/telego@v0.29.1/telegohandler/handler_group.go:50 +0x9e                                                                                                        
telegram-llm-bot  | github.com/mymmrac/telego/telegohandler.(*BotHandler).Start.func1()                                                                                                                              
telegram-llm-bot  |     /go/pkg/mod/github.com/mymmrac/telego@v0.29.1/telegohandler/bot_handler.go:109 +0x1e5                                                                                                        
telegram-llm-bot  | created by github.com/mymmrac/telego/telegohandler.(*BotHandler).Start in goroutine 1                                                                                                            
telegram-llm-bot  |     /go/pkg/mod/github.com/mymmrac/telego@v0.29.1/telegohandler/bot_handler.go:98 +0x15b                                                                                                         

``` telegram-llm-bot | 2024/11/03 22:36:46 INFO history-message-save chat=-*redacted* from_id=*redacted* from_name=Alexey text="@*redacted* Ты живой?" telegram-llm-bot | 2024/11/03 22:36:46 INFO stats-middleware: counting message chat type in stats type=supergroup telegram-llm-bot | 2024/11/03 22:36:46 INFO /any-message type=mention telegram-llm-bot | 2024/11/03 22:36:46 INFO /mention chat=-*redacted* telegram-llm-bot | panic: runtime error: invalid memory address or nil pointer dereference telegram-llm-bot | [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x80d959] telegram-llm-bot | telegram-llm-bot | goroutine 54 [running]: telegram-llm-bot | telegram-ollama-reply-bot/llm.chatMessageToText({{0xc000284848, 0x6}, {0xc000284872, 0x7}, {0xc000284941, 0x395}, 0x0, 0x0, 0x0}) telegram-llm-bot | /build/llm/request_context.go:104 +0x99 telegram-llm-bot | telegram-ollama-reply-bot/llm.chatMessageToOpenAiChatCompletionMessage({{0xc000284848, 0x6}, {0xc000284872, 0x7}, {0xc000284941, 0x395}, 0x0, 0x0, 0x0}) telegram-llm-bot | /build/llm/request_context.go:90 +0x126 telegram-llm-bot | telegram-ollama-reply-bot/llm.(*LlmConnector).HandleChatMessage(0xc00007c1e8, {{0xc0009e03c8, 0x6}, {0xc0009e03f2, 0x7}, {0xc0009e04c1, 0x1f}, 0x0, 0x0, 0x0}, ...) telegram-llm-bot | /build/llm/llm.go:54 +0x6c5 telegram-llm-bot | telegram-ollama-reply-bot/bot.(*Bot).processMention(0xc00039c280, 0xc0009b4008) telegram-llm-bot | /build/bot/bot.go:149 +0x2e5 telegram-llm-bot | telegram-ollama-reply-bot/bot.(*Bot).textMessageHandler(0xc00039c280, 0xc000638140?, {0x30e5bd7, 0xc0009b4008, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...}) telegram-llm-bot | /build/bot/bot.go:122 +0x40a telegram-llm-bot | github.com/mymmrac/telego/telegohandler.(*HandlerGroup).processUpdateWithMiddlewares(0xc0000e9980, 0xc000432540, {0x30e5bd7, 0xc0009b4008, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...}, ...) telegram-llm-bot | /go/pkg/mod/github.com/mymmrac/telego@v0.29.1/telegohandler/handler_group.go:98 +0x4bd telegram-llm-bot | github.com/mymmrac/telego/telegohandler.(*HandlerGroup).processUpdateWithMiddlewares.func1.1() telegram-llm-bot | /go/pkg/mod/github.com/mymmrac/telego@v0.29.1/telegohandler/handler_group.go:76 +0x92 telegram-llm-bot | sync.(*Once).doSlow(0x0?, 0x0?) telegram-llm-bot | /usr/local/go/src/sync/once.go:76 +0xb4 telegram-llm-bot | sync.(*Once).Do(...) telegram-llm-bot | /usr/local/go/src/sync/once.go:67 telegram-llm-bot | github.com/mymmrac/telego/telegohandler.(*HandlerGroup).processUpdateWithMiddlewares.func1(0xc00021c000?, {0x30e5bd7, 0xc0009b4008, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...}) telegram-llm-bot | /go/pkg/mod/github.com/mymmrac/telego@v0.29.1/telegohandler/handler_group.go:75 +0x89 telegram-llm-bot | telegram-ollama-reply-bot/bot.(*Bot).chatTypeStatsCounter(0xc00039c280, 0xc000432540, {0x30e5bd7, 0xc0009b4008, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...}, ...) telegram-llm-bot | /build/bot/middleware.go:31 +0x39c telegram-llm-bot | github.com/mymmrac/telego/telegohandler.(*HandlerGroup).processUpdateWithMiddlewares(0xc0000e9980, 0xc000432540, {0x30e5bd7, 0xc0009b4008, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...}, ...) telegram-llm-bot | /go/pkg/mod/github.com/mymmrac/telego@v0.29.1/telegohandler/handler_group.go:74 +0x283 telegram-llm-bot | github.com/mymmrac/telego/telegohandler.(*HandlerGroup).processUpdateWithMiddlewares.func1.1() telegram-llm-bot | /go/pkg/mod/github.com/mymmrac/telego@v0.29.1/telegohandler/handler_group.go:76 +0x92 telegram-llm-bot | sync.(*Once).doSlow(0x8487c0?, 0xc0011c1100?) telegram-llm-bot | /usr/local/go/src/sync/once.go:76 +0xb4 telegram-llm-bot | sync.(*Once).Do(...) telegram-llm-bot | /usr/local/go/src/sync/once.go:67 telegram-llm-bot | github.com/mymmrac/telego/telegohandler.(*HandlerGroup).processUpdateWithMiddlewares.func1(0x0?, {0x30e5bd7, 0xc0009b4008, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...}) telegram-llm-bot | /go/pkg/mod/github.com/mymmrac/telego@v0.29.1/telegohandler/handler_group.go:75 +0x89 telegram-llm-bot | telegram-ollama-reply-bot/bot.(*Bot).chatHistory(0xc00039c280, 0xc000432540, {0x30e5bd7, 0xc0009b4008, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...}, ...) telegram-llm-bot | /build/bot/middleware.go:49 +0x13d telegram-llm-bot | github.com/mymmrac/telego/telegohandler.(*HandlerGroup).processUpdateWithMiddlewares(0xc0000e9980, 0xc000432540, {0x30e5bd7, 0xc0009b4008, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...}, ...) telegram-llm-bot | /go/pkg/mod/github.com/mymmrac/telego@v0.29.1/telegohandler/handler_group.go:74 +0x283 telegram-llm-bot | github.com/mymmrac/telego/telegohandler.(*HandlerGroup).processUpdate(0xc0000e9980, 0x0?, {0x30e5bd7, 0xc0009b4008, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...}) telegram-llm-bot | /go/pkg/mod/github.com/mymmrac/telego@v0.29.1/telegohandler/handler_group.go:50 +0x9e telegram-llm-bot | github.com/mymmrac/telego/telegohandler.(*BotHandler).Start.func1() telegram-llm-bot | /go/pkg/mod/github.com/mymmrac/telego@v0.29.1/telegohandler/bot_handler.go:109 +0x1e5 telegram-llm-bot | created by github.com/mymmrac/telego/telegohandler.(*BotHandler).Start in goroutine 1 telegram-llm-bot | /go/pkg/mod/github.com/mymmrac/telego@v0.29.1/telegohandler/bot_handler.go:98 +0x15b ```
skobkin added the
bug
label 2024-11-03 22:39:14 +00:00
skobkin self-assigned this 2024-11-03 22:39:14 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: skobkin/telegram-ollama-reply-bot#37
No description provided.