[GH-ISSUE #967] how to view the ollama server log please? (to solve the "Invalid request" error) #471

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

Originally created by @Xingeqwd on GitHub (Nov 2, 2023).
Original GitHub issue: https://github.com/ollama/ollama/issues/967

Hello, masters

i have a Ollama API server and a continuedev-server, on a same linux server

when i use the continuedev-server send request to Ollama-api, the Ollama-api return "Invalid request to Ollama"

I not sure what request was send to Ollama, causing the "Invalid request to Ollama" problem
I also know that the "/api/completions" are correct, like this document writeed

i want to see the Ollama API log to find out these, but dont know where the log is,
so i came to ask about that

I have only the continue-dev server stdout


  File "/root/anaconda3/envs/continue-dev/lib/python3.10/site-packages/continuedev/libs/llm/ollama.py", line 108, in _stream_complete
    raise ContinueCustomException(

continuedev.core.main.ContinueCustomException: ('Ollama returned an error: ', 'Invalid request to Ollama')

[2023-11-02 11:06:30] [WARNING] Meilisearch did not start in less than 20 seconds. Stopping polling.
[2023-11-02 11:06:43] [WARNING] Meilisearch did not start in less than 20 seconds. Stopping polling.
[2023-11-02 11:06:43] [ERROR] Error while running step: 
Ollama returned an error: 
Invalid request to Ollama
[2023-11-02 11:16:50] [ERROR] Error while running step: 
Ollama returned an error: 
Invalid request to Ollama

I thought there might have a "log file", or something etc
I have seen the Ollama-parameter, no found anything about log (exept only the "verbose")
I have also glanced the systemctl status & journalctl, these only record/contain the success, failure are not in these

Thanks to everyone, hope you all have a good and nice day and life!


BTW, my issue when deploying the continue server is issues#570
the newest reply send by me contained the logs etc. i haven't add these here

Originally created by @Xingeqwd on GitHub (Nov 2, 2023). Original GitHub issue: https://github.com/ollama/ollama/issues/967 Hello, masters i have a Ollama API server and a continuedev-server, on a same linux server when i use the continuedev-server send request to Ollama-api, the Ollama-api return "Invalid request to Ollama" I not sure what request was send to Ollama, causing the "Invalid request to Ollama" problem I also know that the "/api/completions" are correct, like this [document](https://github.com/jmorganca/ollama/blob/main/docs/api.md#generate-a-completion) writeed i want to see the Ollama API log to find out these, but dont know where the log is, so i came to ask about that I have only the continue-dev server stdout ``` File "/root/anaconda3/envs/continue-dev/lib/python3.10/site-packages/continuedev/libs/llm/ollama.py", line 108, in _stream_complete raise ContinueCustomException( continuedev.core.main.ContinueCustomException: ('Ollama returned an error: ', 'Invalid request to Ollama') [2023-11-02 11:06:30] [WARNING] Meilisearch did not start in less than 20 seconds. Stopping polling. [2023-11-02 11:06:43] [WARNING] Meilisearch did not start in less than 20 seconds. Stopping polling. [2023-11-02 11:06:43] [ERROR] Error while running step: Ollama returned an error: Invalid request to Ollama [2023-11-02 11:16:50] [ERROR] Error while running step: Ollama returned an error: Invalid request to Ollama ``` I thought there might have a "log file", or something etc I have seen the Ollama-parameter, no found anything about log (exept only the "verbose") I have also glanced the `systemctl status & journalctl`, these only record/contain the success, failure are not in these Thanks to everyone, hope you all have a good and nice day and life! _____ BTW, my issue when deploying the continue server is [issues#570](https://github.com/continuedev/continue/issues/570) the newest reply send by me contained the logs etc. i haven't add these here
Author
Owner

@BruceMacD commented on GitHub (Nov 2, 2023):

This looks like an error message from continue.dev so it's a bit difficult to pinpoint. Try dumping the full ollama logs to a file, that way you can be sure that there are no error messages there:

sudo journalctl -u ollama.service > ollama_logs.txt
<!-- gh-comment-id:1790877957 --> @BruceMacD commented on GitHub (Nov 2, 2023): This looks like an error message from continue.dev so it's a bit difficult to pinpoint. Try dumping the full ollama logs to a file, that way you can be sure that there are no error messages there: ``` sudo journalctl -u ollama.service > ollama_logs.txt ```
Author
Owner

@Xingeqwd commented on GitHub (Nov 3, 2023):

sudo journalctl -u ollama.service > ollama_logs.txt

Wow, awosome sir, you are really right, no see the error in the log

(with the ollama log below)

11月 02 17:27:32 ******** ollama[2724443]: [GIN] 2023/11/02 - 17:27:32 | 200 |   1.65550427s |       127.0.0.1 | POST     "/api/generate"
11月 02 17:28:04 ******** ollama[2952233]: {"timestamp":1698917284,"level":"INFO","function":"log_server_request","line":1233,"message":"request","remote_addr":"127.0.0.1","remote_port":44320,"status":200,"method":"HEAD","path":"/","params":{}}
11月 02 17:28:04 ******** ollama[2952233]: {"timestamp":1698917284,"level":"INFO","function":"log_server_request","line":1233,"message":"request","remote_addr":"127.0.0.1","remote_port":44320,"status":200,"method":"POST","path":"/detokenize","params":{}}
11月 02 17:28:04 ******** ollama[2952233]: {"timestamp":1698917284,"level":"INFO","function":"log_server_request","line":1233,"message":"request","remote_addr":"127.0.0.1","remote_port":44320,"status":200,"method":"POST","path":"/completion","params":{}}
11月 02 17:28:04 ******** ollama[2724443]: llama_print_timings:        load time =    1019.04 ms
11月 02 17:28:04 ******** ollama[2724443]: llama_print_timings:      sample time =       0.79 ms /     6 runs   (    0.13 ms per token,  7623.89 tokens per second)
11月 02 17:28:04 ******** ollama[2724443]: llama_print_timings: prompt eval time =      75.51 ms /    30 tokens (    2.52 ms per token,   397.31 tokens per second)
11月 02 17:28:04 ******** ollama[2724443]: llama_print_timings:        eval time =      33.04 ms /     5 runs   (    6.61 ms per token,   151.32 tokens per second)
11月 02 17:28:04 ******** ollama[2724443]: llama_print_timings:       total time =     110.43 ms
11月 02 17:28:04 ******** ollama[2952233]: {"timestamp":1698917284,"level":"INFO","function":"log_server_request","line":1233,"message":"request","remote_addr":"127.0.0.1","remote_port":44336,"status":200,"method":"POST","path":"/tokenize","params":{}}
11月 02 17:28:04 ******** ollama[2724443]: [GIN] 2023/11/02 - 17:28:04 | 200 |  155.446418ms |       127.0.0.1 | POST     "/api/generate"
<!-- gh-comment-id:1791799704 --> @Xingeqwd commented on GitHub (Nov 3, 2023): > sudo journalctl -u ollama.service > ollama_logs.txt Wow, awosome sir, you are really right, no see the error in the log (with the ollama log below) ``` 11月 02 17:27:32 ******** ollama[2724443]: [GIN] 2023/11/02 - 17:27:32 | 200 | 1.65550427s | 127.0.0.1 | POST "/api/generate" 11月 02 17:28:04 ******** ollama[2952233]: {"timestamp":1698917284,"level":"INFO","function":"log_server_request","line":1233,"message":"request","remote_addr":"127.0.0.1","remote_port":44320,"status":200,"method":"HEAD","path":"/","params":{}} 11月 02 17:28:04 ******** ollama[2952233]: {"timestamp":1698917284,"level":"INFO","function":"log_server_request","line":1233,"message":"request","remote_addr":"127.0.0.1","remote_port":44320,"status":200,"method":"POST","path":"/detokenize","params":{}} 11月 02 17:28:04 ******** ollama[2952233]: {"timestamp":1698917284,"level":"INFO","function":"log_server_request","line":1233,"message":"request","remote_addr":"127.0.0.1","remote_port":44320,"status":200,"method":"POST","path":"/completion","params":{}} 11月 02 17:28:04 ******** ollama[2724443]: llama_print_timings: load time = 1019.04 ms 11月 02 17:28:04 ******** ollama[2724443]: llama_print_timings: sample time = 0.79 ms / 6 runs ( 0.13 ms per token, 7623.89 tokens per second) 11月 02 17:28:04 ******** ollama[2724443]: llama_print_timings: prompt eval time = 75.51 ms / 30 tokens ( 2.52 ms per token, 397.31 tokens per second) 11月 02 17:28:04 ******** ollama[2724443]: llama_print_timings: eval time = 33.04 ms / 5 runs ( 6.61 ms per token, 151.32 tokens per second) 11月 02 17:28:04 ******** ollama[2724443]: llama_print_timings: total time = 110.43 ms 11月 02 17:28:04 ******** ollama[2952233]: {"timestamp":1698917284,"level":"INFO","function":"log_server_request","line":1233,"message":"request","remote_addr":"127.0.0.1","remote_port":44336,"status":200,"method":"POST","path":"/tokenize","params":{}} 11月 02 17:28:04 ******** ollama[2724443]: [GIN] 2023/11/02 - 17:28:04 | 200 | 155.446418ms | 127.0.0.1 | POST "/api/generate" ```
Author
Owner

@cheuk-cheng commented on GitHub (Nov 3, 2023):

sudo journalctl -u ollama.service > ollama_logs.txtis showing sudo: journalctl: command not founderror in macOS. Is there a different command line to use? Thanks.

<!-- gh-comment-id:1793242192 --> @cheuk-cheng commented on GitHub (Nov 3, 2023): `sudo journalctl -u ollama.service > ollama_logs.txt`is showing `sudo: journalctl: command not found`error in macOS. Is there a different command line to use? Thanks.
Author
Owner

@Xingeqwd commented on GitHub (Nov 5, 2023):

This looks like an error message from continue.dev so it's a bit difficult to pinpoint. Try dumping the full ollama logs to a file, that way you can be sure that there are no error messages there:

sudo journalctl -u ollama.service > ollama_logs.txt

AHHH, SRY sir, i fotgot to reply

yes, this is not a ollama problem, its looks like a continue problem,

after the continue update of 2023.11.3 afternoon(UTC+8) this all goes functional!

thank you sir, this is a nice work, wish everyone have a nice life!

<!-- gh-comment-id:1793790101 --> @Xingeqwd commented on GitHub (Nov 5, 2023): > This looks like an error message from continue.dev so it's a bit difficult to pinpoint. Try dumping the full ollama logs to a file, that way you can be sure that there are no error messages there: > > ``` > sudo journalctl -u ollama.service > ollama_logs.txt > ``` AHHH, SRY sir, i fotgot to reply yes, this is not a ollama problem, its looks like a continue problem, after the continue update of 2023.11.3 afternoon(UTC+8) this all goes functional! thank you sir, this is a nice work, wish everyone have a nice life!
Author
Owner

@Xingeqwd commented on GitHub (Nov 5, 2023):

sudo journalctl -u ollama.service > ollama_logs.txtis showing sudo: journalctl: command not founderror in macOS. Is there a different command line to use? Thanks.

hello bro @cheuk-cheng ,

this command not found error might be cause by your system dont have a journalctl
(if there no syntax problem)

I guess that you maybe using a ubuntu side linux? not a RHEL(like Centos) side
this side of linux dont have a journalctl with installation. (as i remembered)

so you should install one of this, like this stackexchange-website said

you can try this, bro! this should be right

SRY if i am wrong.😀(just in case)

( come back in after a long time, i Just found out this man is using MACOS.. I was careless, the linux content above may have no big effect )


by the way, bro,
when you reply others with "@", they will more easiler to know you have replied them

<!-- gh-comment-id:1793791472 --> @Xingeqwd commented on GitHub (Nov 5, 2023): > `sudo journalctl -u ollama.service > ollama_logs.txt`is showing `sudo: journalctl: command not found`error in macOS. Is there a different command line to use? Thanks. hello bro @cheuk-cheng , this command not found error might be cause by your system dont have a journalctl (if there no syntax problem) I guess that you maybe using a ubuntu side linux? not a RHEL(like Centos) side this side of linux dont have a journalctl with installation. (as i remembered) so you should install one of this, like this [stackexchange-website](https://unix.stackexchange.com/questions/379226/setting-up-journalctl-on-ubuntu-linux) said you can try this, bro! this should be right SRY if i am wrong.😀(just in case) ( come back in after a long time, i Just found out this man is using MACOS.. I was careless, the linux content above may have no big effect ) _____ by the way, bro, when you reply others with "@", they will more easiler to know you have replied them
Author
Owner

@cheuk-cheng commented on GitHub (Nov 6, 2023):

Thanks @Xingeqwd. I was asked by Continue devs about collecting ollama log for a different issue. Then I came upon this issue which mentioned journalctl command but unfortunately I could not find it in macOS.

<!-- gh-comment-id:1797016850 --> @cheuk-cheng commented on GitHub (Nov 6, 2023): Thanks @Xingeqwd. I was asked by Continue devs about collecting ollama log for a different issue. Then I came upon this issue which mentioned `journalctl` command but unfortunately I could not find it in macOS.
Author
Owner

@BruceMacD commented on GitHub (Nov 7, 2023):

@cheuk-cheng on MacOS the logs will be in ~/.ollama/logs/server.log

<!-- gh-comment-id:1799295174 --> @BruceMacD commented on GitHub (Nov 7, 2023): @cheuk-cheng on MacOS the logs will be in `~/.ollama/logs/server.log`
Author
Owner

@cheuk-cheng commented on GitHub (Nov 7, 2023):

Thanks @BruceMacD. I found the server log as you advised and uploaded it for Continue devs.

<!-- gh-comment-id:1799354507 --> @cheuk-cheng commented on GitHub (Nov 7, 2023): Thanks @BruceMacD. I found the server log as you advised and uploaded it for Continue devs.
Author
Owner

@WendellZ524 commented on GitHub (May 7, 2024):

@cheuk-cheng on MacOS the logs will be in ~/.ollama/logs/server.log

Hi bro,
I am using docker behind poxy to deploy ollama, my issue is after I run ollama run llama3 I get Error: something went wrong, please see the ollama server logs for details
But I cannot find the log files
journalctl -u ollama.service > ollama_logs.txt get No journal files were found.

I cannot find any files in .ollma dir

$:~/.ollama# ls
id_ed25519  id_ed25519.pub  models

I have copied my ca files to the container but I still cannot solve that problem.

<!-- gh-comment-id:2097236497 --> @WendellZ524 commented on GitHub (May 7, 2024): > @cheuk-cheng on MacOS the logs will be in `~/.ollama/logs/server.log` Hi bro, I am using docker behind poxy to deploy ollama, my issue is after I run ``` ollama run llama3``` I get `Error: something went wrong, please see the ollama server logs for details` But I cannot find the log files ```journalctl -u ollama.service > ollama_logs.txt``` get `No journal files were found.` I cannot find any files in .ollma dir ``` $:~/.ollama# ls id_ed25519 id_ed25519.pub models ``` I have copied my ca files to the container but I still cannot solve that problem.
Author
Owner

@BruceMacD commented on GitHub (May 7, 2024):

@WendellZ524 if you're running in a container you should be able to use docker logs. Here is an example:

❯ docker ps
CONTAINER ID   IMAGE           COMMAND               CREATED       STATUS              PORTS                      NAMES
d1139463fc90   ollama/ollama   "/bin/ollama serve"   4 weeks ago   Up About a minute   0.0.0.0:11434->11434/tcp   ollama

❯ docker logs ollama

Hope that helps. More info here:
https://github.com/ollama/ollama/blob/main/docs/troubleshooting.md

<!-- gh-comment-id:2098966269 --> @BruceMacD commented on GitHub (May 7, 2024): @WendellZ524 if you're running in a container you should be able to use `docker logs`. Here is an example: ```bash ❯ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES d1139463fc90 ollama/ollama "/bin/ollama serve" 4 weeks ago Up About a minute 0.0.0.0:11434->11434/tcp ollama ❯ docker logs ollama ``` Hope that helps. More info here: https://github.com/ollama/ollama/blob/main/docs/troubleshooting.md
Author
Owner

@vishalpatel89 commented on GitHub (May 16, 2024):

cat ~/.ollama/logs/server.log

this will help to see the logs. #MacM1

<!-- gh-comment-id:2114091948 --> @vishalpatel89 commented on GitHub (May 16, 2024): cat ~/.ollama/logs/server.log this will help to see the logs. #MacM1
Author
Owner

@TaosLezz commented on GitHub (Jan 20, 2025):

You can find in C:\Users\dev\AppData\Local\Ollama\server.log

<!-- gh-comment-id:2601835119 --> @TaosLezz commented on GitHub (Jan 20, 2025): You can find in C:\Users\dev\AppData\Local\Ollama\server.log
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#471