[GH-ISSUE #1049] Random panics when generating #513

Closed
opened 2026-04-12 10:12:33 -05:00 by GiteaMirror · 7 comments
Owner

Originally created by @aaronfrancis635 on GitHub (Nov 8, 2023).
Original GitHub issue: https://github.com/ollama/ollama/issues/1049

It seems tempremental, sometimes it will generate with no issues, some other times it will panic with the same model and the same prompt.

example body being sent:

{
	"model": "model_name",
	"prompt": "Describe yourself",
	"stream": false
}

logs below:

Nov 08 22:19:03 osmium ollama[2581054]: [GIN] 2023/11/08 - 22:19:03 | 200 |  3.456758865s |     5.***.***.*** | POST     "/api/generate"
Nov 08 22:19:03 osmium ollama[2581054]: [GIN] 2023/11/08 - 22:19:03 | 200 |  3.456758865s |     5.***.***.*** | POST     "/api/generate"
Nov 08 22:20:26 osmium ollama[3404611]: {"timestamp":1699482026,"level":"INFO","function":"log_server_request","line":1233,"message":"request","remote_addr":"127.0.0.1","remote_port":34870,"status":200,"method":"HEAD","path":"/","params":{}}
Nov 08 22:20:36 osmium ollama[2581054]: 2023/11/08 22:20:36 [Recovery] 2023/11/08 - 22:20:36 panic recovered:
Nov 08 22:20:36 osmium ollama[2581054]: runtime error: invalid memory address or nil pointer dereference
Nov 08 22:20:36 osmium ollama[2581054]: /usr/local/go/src/runtime/panic.go:261 (0x451137)
Nov 08 22:20:36 osmium ollama[2581054]: /usr/local/go/src/runtime/signal_unix.go:861 (0x451105)
Nov 08 22:20:36 osmium ollama[2581054]: /go/src/github.com/jmorganca/ollama/server/routes.go:234 (0x98f535)
Nov 08 22:20:36 osmium ollama[2581054]: /root/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 (0x995ac4)
Nov 08 22:20:36 osmium ollama[2581054]: /go/src/github.com/jmorganca/ollama/server/routes.go:659 (0x995ab2)
Nov 08 22:20:36 osmium ollama[2581054]: /root/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 (0x972db9)
Nov 08 22:20:36 osmium ollama[2581054]: /root/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/recovery.go:102 (0x972da7)
Nov 08 22:20:36 osmium ollama[2581054]: /root/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 (0x971f5d)
Nov 08 22:20:36 osmium ollama[2581054]: /root/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/logger.go:240 (0x971f2c)
Nov 08 22:20:36 osmium ollama[2581054]: /root/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 (0x97101a)
Nov 08 22:20:36 osmium ollama[2581054]: /root/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:620 (0x970cad)
Nov 08 22:20:36 osmium ollama[2581054]: /root/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:576 (0x9707dc)
Nov 08 22:20:36 osmium ollama[2581054]: /usr/local/go/src/net/http/server.go:2938 (0x6d326d)
Nov 08 22:20:36 osmium ollama[2581054]: /usr/local/go/src/net/http/server.go:2009 (0x6cf153)
Nov 08 22:20:36 osmium ollama[2581054]: /usr/local/go/src/runtime/asm_amd64.s:1650 (0x46d680)
Nov 08 22:20:36 osmium ollama[2581054]:
Nov 08 22:20:36 osmium ollama[2581054]: [GIN] 2023/11/08 - 22:20:36 | 500 | 10.005014413s |     5.***.***.*** | POST     "/api/generate"
Nov 08 22:20:36 osmium ollama[3404611]: {"timestamp":1699482036,"level":"INFO","function":"log_server_request","line":1233,"message":"request","remote_addr":"127.0.0.1","remote_port":34870,"status":200,"method":"POST","path":"/completion","params":{}}
Nov 08 22:20:36 osmium ollama[2581054]: llama_print_timings:        load time =    1268.89 ms
Nov 08 22:20:36 osmium ollama[2581054]: llama_print_timings:      sample time =     150.00 ms /   461 runs   (    0.33 ms per token,  3073.25 tokens per second)
Nov 08 22:20:36 osmium ollama[2581054]: llama_print_timings: prompt eval time =     184.63 ms /    18 tokens (   10.26 ms per token,    97.49 tokens per second)
Nov 08 22:20:36 osmium ollama[2581054]: llama_print_timings:        eval time =    9604.34 ms /   460 runs   (   20.88 ms per token,    47.90 tokens per second)

Any ideas are appreciated.
Thanks.

Originally created by @aaronfrancis635 on GitHub (Nov 8, 2023). Original GitHub issue: https://github.com/ollama/ollama/issues/1049 It seems tempremental, sometimes it will generate with no issues, some other times it will panic with the same model and the same prompt. example body being sent: ```JSON { "model": "model_name", "prompt": "Describe yourself", "stream": false } ``` logs below: ``` Nov 08 22:19:03 osmium ollama[2581054]: [GIN] 2023/11/08 - 22:19:03 | 200 | 3.456758865s | 5.***.***.*** | POST "/api/generate" Nov 08 22:19:03 osmium ollama[2581054]: [GIN] 2023/11/08 - 22:19:03 | 200 | 3.456758865s | 5.***.***.*** | POST "/api/generate" Nov 08 22:20:26 osmium ollama[3404611]: {"timestamp":1699482026,"level":"INFO","function":"log_server_request","line":1233,"message":"request","remote_addr":"127.0.0.1","remote_port":34870,"status":200,"method":"HEAD","path":"/","params":{}} Nov 08 22:20:36 osmium ollama[2581054]: 2023/11/08 22:20:36 [Recovery] 2023/11/08 - 22:20:36 panic recovered: Nov 08 22:20:36 osmium ollama[2581054]: runtime error: invalid memory address or nil pointer dereference Nov 08 22:20:36 osmium ollama[2581054]: /usr/local/go/src/runtime/panic.go:261 (0x451137) Nov 08 22:20:36 osmium ollama[2581054]: /usr/local/go/src/runtime/signal_unix.go:861 (0x451105) Nov 08 22:20:36 osmium ollama[2581054]: /go/src/github.com/jmorganca/ollama/server/routes.go:234 (0x98f535) Nov 08 22:20:36 osmium ollama[2581054]: /root/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 (0x995ac4) Nov 08 22:20:36 osmium ollama[2581054]: /go/src/github.com/jmorganca/ollama/server/routes.go:659 (0x995ab2) Nov 08 22:20:36 osmium ollama[2581054]: /root/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 (0x972db9) Nov 08 22:20:36 osmium ollama[2581054]: /root/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/recovery.go:102 (0x972da7) Nov 08 22:20:36 osmium ollama[2581054]: /root/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 (0x971f5d) Nov 08 22:20:36 osmium ollama[2581054]: /root/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/logger.go:240 (0x971f2c) Nov 08 22:20:36 osmium ollama[2581054]: /root/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 (0x97101a) Nov 08 22:20:36 osmium ollama[2581054]: /root/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:620 (0x970cad) Nov 08 22:20:36 osmium ollama[2581054]: /root/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:576 (0x9707dc) Nov 08 22:20:36 osmium ollama[2581054]: /usr/local/go/src/net/http/server.go:2938 (0x6d326d) Nov 08 22:20:36 osmium ollama[2581054]: /usr/local/go/src/net/http/server.go:2009 (0x6cf153) Nov 08 22:20:36 osmium ollama[2581054]: /usr/local/go/src/runtime/asm_amd64.s:1650 (0x46d680) Nov 08 22:20:36 osmium ollama[2581054]: Nov 08 22:20:36 osmium ollama[2581054]: [GIN] 2023/11/08 - 22:20:36 | 500 | 10.005014413s | 5.***.***.*** | POST "/api/generate" Nov 08 22:20:36 osmium ollama[3404611]: {"timestamp":1699482036,"level":"INFO","function":"log_server_request","line":1233,"message":"request","remote_addr":"127.0.0.1","remote_port":34870,"status":200,"method":"POST","path":"/completion","params":{}} Nov 08 22:20:36 osmium ollama[2581054]: llama_print_timings: load time = 1268.89 ms Nov 08 22:20:36 osmium ollama[2581054]: llama_print_timings: sample time = 150.00 ms / 461 runs ( 0.33 ms per token, 3073.25 tokens per second) Nov 08 22:20:36 osmium ollama[2581054]: llama_print_timings: prompt eval time = 184.63 ms / 18 tokens ( 10.26 ms per token, 97.49 tokens per second) Nov 08 22:20:36 osmium ollama[2581054]: llama_print_timings: eval time = 9604.34 ms / 460 runs ( 20.88 ms per token, 47.90 tokens per second) ``` Any ideas are appreciated. Thanks.
GiteaMirror added the bug label 2026-04-12 10:12:33 -05:00
Author
Owner

@mxyng commented on GitHub (Nov 15, 2023):

Do you have a specific model this happens on? I'm not able to reproduce it with mistral, llama2, llama2:13b, or orca-mini. Also what platform are you running ollama on? Are you using GPU acceleration of some kind (CUDA, Metal)?

<!-- gh-comment-id:1813285456 --> @mxyng commented on GitHub (Nov 15, 2023): Do you have a specific model this happens on? I'm not able to reproduce it with mistral, llama2, llama2:13b, or orca-mini. Also what platform are you running ollama on? Are you using GPU acceleration of some kind (CUDA, Metal)?
Author
Owner

@kongjy commented on GitHub (Nov 21, 2023):

I'm also having this 'temperamental' issue with mistral:instruct on Mac (M1), no GPU acceleration. Example query format:

payload = {
            "model": "mistral:instruct",
            "temperature": float(temperature), 
            "max_tokens": int(max_tokens),
            "top_p": float(top_p),
            "prompt": prompt,
            "stream": False, 
            "format": "json"}
response = requests.post("http://localhost:11434/api/generate", json=payload)

Logs below:

17746 [GIN] 2023/11/20 - 17:13:55 | 200 |  4.104297625s |       127.0.0.1 | POST     "/api/generate"
17747 {"timestamp":1700529235,"level":"INFO","function":"log_server_request","line":1240,"message":"request","remote_addr":"127.0.0.1","remot      e_port":58640,"status":200,"method":"HEAD","path":"/","params":{}}
17748 ^[[31m2023/11/20 17:14:27 [Recovery] 2023/11/20 - 17:14:27 panic recovered:
17749 runtime error: invalid memory address or nil pointer dereference
17750 /opt/homebrew/Cellar/go/1.21.3/libexec/src/runtime/panic.go:261 (0x10487f61b)
17751 /opt/homebrew/Cellar/go/1.21.3/libexec/src/runtime/signal_unix.go:861 (0x10487f5e8)
17752 /Users/jmorgan/workspace/ollama/server/routes.go:250 (0x104d4b6c8)
17753 /Users/jmorgan/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 (0x104d50db3)
17754 /Users/jmorgan/workspace/ollama/server/routes.go:675 (0x104d50d98)
17755 /Users/jmorgan/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 (0x104d3235f)
17756 /Users/jmorgan/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/recovery.go:102 (0x104d32344)
17757 /Users/jmorgan/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 (0x104d316ff)
17758 /Users/jmorgan/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/logger.go:240 (0x104d316d0)
17759 /Users/jmorgan/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 (0x104d30833)
17760 /Users/jmorgan/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:620 (0x104d3055c)
17761 /Users/jmorgan/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:576 (0x104d3017f)
17762 /opt/homebrew/Cellar/go/1.21.3/libexec/src/net/http/server.go:2938 (0x104ac439b)
17763 /opt/homebrew/Cellar/go/1.21.3/libexec/src/net/http/server.go:2009 (0x104ac0797)
17764 /opt/homebrew/Cellar/go/1.21.3/libexec/src/runtime/asm_arm64.s:1197 (0x10489c3a3)
17765 ^[[0m
17766 [GIN] 2023/11/20 - 17:14:27 | 500 |  31.77838625s |       127.0.0.1 | POST     "/api/generate"
17767 llama_print_timings:        load time =     345.27 ms
17768 llama_print_timings:      sample time =    8255.78 ms /   963 runs   (    8.57 ms per token,   116.65 tokens per second)
17769 llama_print_timings: prompt eval time =     882.71 ms /   310 tokens (    2.85 ms per token,   351.19 tokens per second)
17770 llama_print_timings:        eval time =   21548.72 ms /   962 runs   (   22.40 ms per token,    44.64 tokens per second)
17771 llama_print_timings:       total time =   31794.00 ms

<!-- gh-comment-id:1820063801 --> @kongjy commented on GitHub (Nov 21, 2023): I'm also having this 'temperamental' issue with mistral:instruct on Mac (M1), no GPU acceleration. Example query format: ```python payload = { "model": "mistral:instruct", "temperature": float(temperature), "max_tokens": int(max_tokens), "top_p": float(top_p), "prompt": prompt, "stream": False, "format": "json"} response = requests.post("http://localhost:11434/api/generate", json=payload) ``` Logs below: ```shell 17746 [GIN] 2023/11/20 - 17:13:55 | 200 | 4.104297625s | 127.0.0.1 | POST "/api/generate" 17747 {"timestamp":1700529235,"level":"INFO","function":"log_server_request","line":1240,"message":"request","remote_addr":"127.0.0.1","remot e_port":58640,"status":200,"method":"HEAD","path":"/","params":{}} 17748 ^[[31m2023/11/20 17:14:27 [Recovery] 2023/11/20 - 17:14:27 panic recovered: 17749 runtime error: invalid memory address or nil pointer dereference 17750 /opt/homebrew/Cellar/go/1.21.3/libexec/src/runtime/panic.go:261 (0x10487f61b) 17751 /opt/homebrew/Cellar/go/1.21.3/libexec/src/runtime/signal_unix.go:861 (0x10487f5e8) 17752 /Users/jmorgan/workspace/ollama/server/routes.go:250 (0x104d4b6c8) 17753 /Users/jmorgan/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 (0x104d50db3) 17754 /Users/jmorgan/workspace/ollama/server/routes.go:675 (0x104d50d98) 17755 /Users/jmorgan/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 (0x104d3235f) 17756 /Users/jmorgan/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/recovery.go:102 (0x104d32344) 17757 /Users/jmorgan/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 (0x104d316ff) 17758 /Users/jmorgan/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/logger.go:240 (0x104d316d0) 17759 /Users/jmorgan/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 (0x104d30833) 17760 /Users/jmorgan/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:620 (0x104d3055c) 17761 /Users/jmorgan/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:576 (0x104d3017f) 17762 /opt/homebrew/Cellar/go/1.21.3/libexec/src/net/http/server.go:2938 (0x104ac439b) 17763 /opt/homebrew/Cellar/go/1.21.3/libexec/src/net/http/server.go:2009 (0x104ac0797) 17764 /opt/homebrew/Cellar/go/1.21.3/libexec/src/runtime/asm_arm64.s:1197 (0x10489c3a3) 17765 ^[[0m 17766 [GIN] 2023/11/20 - 17:14:27 | 500 | 31.77838625s | 127.0.0.1 | POST "/api/generate" 17767 llama_print_timings: load time = 345.27 ms 17768 llama_print_timings: sample time = 8255.78 ms / 963 runs ( 8.57 ms per token, 116.65 tokens per second) 17769 llama_print_timings: prompt eval time = 882.71 ms / 310 tokens ( 2.85 ms per token, 351.19 tokens per second) 17770 llama_print_timings: eval time = 21548.72 ms / 962 runs ( 22.40 ms per token, 44.64 tokens per second) 17771 llama_print_timings: total time = 31794.00 ms ```
Author
Owner

@aaronfrancis635 commented on GitHub (Nov 23, 2023):

Do you have a specific model this happens on? I'm not able to reproduce it with mistral, llama2, llama2:13b, or orca-mini. Also what platform are you running ollama on? Are you using GPU acceleration of some kind (CUDA, Metal)?

Mine is as mentioned above by @kongjy, but with GPU acceleration (CUDA, machine has a NVIDIA RTX 2080Ti + RTX 3060 12GB).

Using only the base mistral instruct model, but I have had this on the llama2 chat model too, no customisation to the models or templates.

<!-- gh-comment-id:1823911144 --> @aaronfrancis635 commented on GitHub (Nov 23, 2023): > Do you have a specific model this happens on? I'm not able to reproduce it with mistral, llama2, llama2:13b, or orca-mini. Also what platform are you running ollama on? Are you using GPU acceleration of some kind (CUDA, Metal)? Mine is as mentioned above by @kongjy, but with GPU acceleration (CUDA, machine has a NVIDIA RTX 2080Ti + RTX 3060 12GB). Using only the base mistral instruct model, but I have had this on the llama2 chat model too, no customisation to the models or templates.
Author
Owner

@yudanta commented on GitHub (Dec 7, 2023):

Having similar issue while generating through "api/generate"

2023/12/06 23:35:05 [Recovery] 2023/12/06 - 23:35:05 panic recovered:
runtime error: invalid memory address or nil pointer dereference
/opt/homebrew/Cellar/go/1.21.3/libexec/src/runtime/panic.go:261 (0x104bc361b)
/opt/homebrew/Cellar/go/1.21.3/libexec/src/runtime/signal_unix.go:861 (0x104bc35e8)
/Users/jmorgan/workspace/ollama/server/routes.go:252 (0x105089708)
/Users/jmorgan/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 (0x105090413)
/Users/jmorgan/workspace/ollama/server/routes.go:764 (0x1050903f8)
/Users/jmorgan/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 (0x105070fef)
/Users/jmorgan/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/recovery.go:102 (0x105070fd4)
/Users/jmorgan/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 (0x10507038f)
/Users/jmorgan/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/logger.go:240 (0x105070360)
/Users/jmorgan/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 (0x10506f4c3)
/Users/jmorgan/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:620 (0x10506f1ec)
/Users/jmorgan/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:576 (0x10506ee0f)
/opt/homebrew/Cellar/go/1.21.3/libexec/src/net/http/server.go:2938 (0x104e07f4b)
/opt/homebrew/Cellar/go/1.21.3/libexec/src/net/http/server.go:2009 (0x104e04347)
/opt/homebrew/Cellar/go/1.21.3/libexec/src/runtime/asm_arm64.s:1197 (0x104be0423)

[GIN] 2023/12/06 - 23:35:05 | 500 |  5.001405209s |       127.0.0.1 | POST     "/api/generate"

Model: neural-chat:7b-v3.2

works fine with same prompt through cli run

<!-- gh-comment-id:1844383891 --> @yudanta commented on GitHub (Dec 7, 2023): Having similar issue while generating through "api/generate" ``` 2023/12/06 23:35:05 [Recovery] 2023/12/06 - 23:35:05 panic recovered: runtime error: invalid memory address or nil pointer dereference /opt/homebrew/Cellar/go/1.21.3/libexec/src/runtime/panic.go:261 (0x104bc361b) /opt/homebrew/Cellar/go/1.21.3/libexec/src/runtime/signal_unix.go:861 (0x104bc35e8) /Users/jmorgan/workspace/ollama/server/routes.go:252 (0x105089708) /Users/jmorgan/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 (0x105090413) /Users/jmorgan/workspace/ollama/server/routes.go:764 (0x1050903f8) /Users/jmorgan/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 (0x105070fef) /Users/jmorgan/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/recovery.go:102 (0x105070fd4) /Users/jmorgan/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 (0x10507038f) /Users/jmorgan/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/logger.go:240 (0x105070360) /Users/jmorgan/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 (0x10506f4c3) /Users/jmorgan/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:620 (0x10506f1ec) /Users/jmorgan/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:576 (0x10506ee0f) /opt/homebrew/Cellar/go/1.21.3/libexec/src/net/http/server.go:2938 (0x104e07f4b) /opt/homebrew/Cellar/go/1.21.3/libexec/src/net/http/server.go:2009 (0x104e04347) /opt/homebrew/Cellar/go/1.21.3/libexec/src/runtime/asm_arm64.s:1197 (0x104be0423) [GIN] 2023/12/06 - 23:35:05 | 500 | 5.001405209s | 127.0.0.1 | POST "/api/generate" ``` Model: neural-chat:7b-v3.2 works fine with same prompt through cli run
Author
Owner

@jonasferoz commented on GitHub (Dec 9, 2023):

Same issue with api/generate and llama2. Intel MacBook.

2023/12/09 03:04:03 [Recovery] 2023/12/09 - 03:04:03 panic recovered:
runtime error: invalid memory address or nil pointer dereference
/opt/homebrew/Cellar/go/1.21.3/libexec/src/runtime/panic.go:261 (0x104e597)
/opt/homebrew/Cellar/go/1.21.3/libexec/src/runtime/signal_unix.go:861 (0x104e565)
/Users/jmorgan/workspace/ollama/server/routes.go:252 (0x15876b5)
/Users/jmorgan/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 (0x158f604)
/Users/jmorgan/workspace/ollama/server/routes.go:764 (0x158f5f2)
/Users/jmorgan/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 (0x156bcb9)
/Users/jmorgan/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/recovery.go:102 (0x156bca7)
/Users/jmorgan/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 (0x156ae5d)
/Users/jmorgan/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/logger.go:240 (0x156ae2c)
/Users/jmorgan/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 (0x1569f1a)
/Users/jmorgan/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:620 (0x1569bad)
/Users/jmorgan/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:576 (0x15696dc)
/opt/homebrew/Cellar/go/1.21.3/libexec/src/net/http/server.go:2938 (0x12d1e8d)
/opt/homebrew/Cellar/go/1.21.3/libexec/src/net/http/server.go:2009 (0x12cdd73)
/opt/homebrew/Cellar/go/1.21.3/libexec/src/runtime/asm_amd64.s:1650 (0x106b0a0)

[GIN] 2023/12/09 - 03:04:03 | 500 |          1m0s |       127.0.0.1 | POST     "/api/generate"
<!-- gh-comment-id:1848378979 --> @jonasferoz commented on GitHub (Dec 9, 2023): Same issue with api/generate and llama2. Intel MacBook. ``` 2023/12/09 03:04:03 [Recovery] 2023/12/09 - 03:04:03 panic recovered: runtime error: invalid memory address or nil pointer dereference /opt/homebrew/Cellar/go/1.21.3/libexec/src/runtime/panic.go:261 (0x104e597) /opt/homebrew/Cellar/go/1.21.3/libexec/src/runtime/signal_unix.go:861 (0x104e565) /Users/jmorgan/workspace/ollama/server/routes.go:252 (0x15876b5) /Users/jmorgan/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 (0x158f604) /Users/jmorgan/workspace/ollama/server/routes.go:764 (0x158f5f2) /Users/jmorgan/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 (0x156bcb9) /Users/jmorgan/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/recovery.go:102 (0x156bca7) /Users/jmorgan/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 (0x156ae5d) /Users/jmorgan/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/logger.go:240 (0x156ae2c) /Users/jmorgan/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 (0x1569f1a) /Users/jmorgan/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:620 (0x1569bad) /Users/jmorgan/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:576 (0x15696dc) /opt/homebrew/Cellar/go/1.21.3/libexec/src/net/http/server.go:2938 (0x12d1e8d) /opt/homebrew/Cellar/go/1.21.3/libexec/src/net/http/server.go:2009 (0x12cdd73) /opt/homebrew/Cellar/go/1.21.3/libexec/src/runtime/asm_amd64.s:1650 (0x106b0a0) [GIN] 2023/12/09 - 03:04:03 | 500 | 1m0s | 127.0.0.1 | POST "/api/generate" ```
Author
Owner

@sibuthomasmathew commented on GitHub (Dec 19, 2023):

Using the container image with tag 0.1.12. Running into the same issue with api/generate and model: mistral:

2023/12/19 13:58:47 llama.go:493: llama runner started in 0.601399 seconds


2023/12/19 13:59:46 [Recovery] 2023/12/19 - 13:59:46 panic recovered:
runtime error: invalid memory address or nil pointer dereference
/usr/local/go/src/runtime/panic.go:261 (0x4511b7)
/usr/local/go/src/runtime/signal_unix.go:861 (0x451185)
/go/src/github.com/jmorganca/ollama/server/routes.go:252 (0x987375)
/root/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 (0x98f004)
/go/src/github.com/jmorganca/ollama/server/routes.go:754 (0x98eff2)
/root/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 (0x96afd9)
/root/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/recovery.go:102 (0x96afc7)
/root/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 (0x96a17d)
/root/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/logger.go:240 (0x96a14c)
/root/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 (0x96923a)
/root/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:620 (0x968ecd)
/root/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:576 (0x9689fc)
/usr/local/go/src/net/http/server.go:2938 (0x6d2c0d)
/usr/local/go/src/net/http/server.go:2009 (0x6ceaf3)
/usr/local/go/src/runtime/asm_amd64.s:1650 (0x46d780)

[GIN] 2023/12/19 - 13:59:46 | 500 |          1m0s |   10.230.182.64 | POST     "/api/generate"
<!-- gh-comment-id:1863290254 --> @sibuthomasmathew commented on GitHub (Dec 19, 2023): Using the container image with tag `0.1.12`. Running into the same issue with `api/generate` and `model: mistral`: ``` 2023/12/19 13:58:47 llama.go:493: llama runner started in 0.601399 seconds 2023/12/19 13:59:46 [Recovery] 2023/12/19 - 13:59:46 panic recovered: runtime error: invalid memory address or nil pointer dereference /usr/local/go/src/runtime/panic.go:261 (0x4511b7) /usr/local/go/src/runtime/signal_unix.go:861 (0x451185) /go/src/github.com/jmorganca/ollama/server/routes.go:252 (0x987375) /root/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 (0x98f004) /go/src/github.com/jmorganca/ollama/server/routes.go:754 (0x98eff2) /root/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 (0x96afd9) /root/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/recovery.go:102 (0x96afc7) /root/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 (0x96a17d) /root/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/logger.go:240 (0x96a14c) /root/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 (0x96923a) /root/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:620 (0x968ecd) /root/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:576 (0x9689fc) /usr/local/go/src/net/http/server.go:2938 (0x6d2c0d) /usr/local/go/src/net/http/server.go:2009 (0x6ceaf3) /usr/local/go/src/runtime/asm_amd64.s:1650 (0x46d780) [GIN] 2023/12/19 - 13:59:46 | 500 | 1m0s | 10.230.182.64 | POST "/api/generate" ```
Author
Owner

@jmorganca commented on GitHub (Jan 12, 2024):

Hi folks, this should be fixed as of a few versions ago. Please re-open or let me know if this isn't the case. Thanks for reporting the issue!

<!-- gh-comment-id:1888492448 --> @jmorganca commented on GitHub (Jan 12, 2024): Hi folks, this should be fixed as of a few versions ago. Please re-open or let me know if this isn't the case. Thanks for reporting the issue!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#513