Skip to content

Unhandled exception when using Ollama to generate commit message #8078

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

Open
stevensiebe opened this issue Apr 8, 2025 · 3 comments
Open
Labels
bug Something isn't working UI Any broken visuals like layouts, colors etc.

Comments

@stevensiebe
Copy link

Version

0.14.16

Operating System

Windows

Distribution Method

msi (Windows)

Describe the issue

When using Ollama as an option to generate a commit message, I get the following error.

Unhandled exception
A promise had an unhandled exception
SyntaxError: Failed to execute 'close' on 
'ReadableStreamDefaultController': Unexpected end of JSON 
input

My endpoint is set to
http://127.0.0.1:11434
my model is set to
gemma3:latest

I know the endpoint is valid, as Page Assist and other applications use it. No matter what the model is set to, I get the same error.

Switching to Anthropic or Open AI in preferences and running the same operation work as expected. Just get an error when using Ollama.

How to reproduce (Optional)

No response

Expected behavior (Optional)

No response

Relevant log output (Optional)

@stevensiebe stevensiebe added the bug Something isn't working label Apr 8, 2025
@Byron Byron added the UI Any broken visuals like layouts, colors etc. label Apr 12, 2025
@Byron
Copy link
Collaborator

Byron commented Apr 12, 2025

Thanks for reporting!
It's probably an issue with how the App thinks the protocol should be used.

What might help here is to use the developer tools via View -> Developer Tools to get more information on the call that it made. From there it should be possible to figure out what's wrong with it.
My guess is that the endpoint isn't used correctly so it will return an error message in a format that is not JSON.
Thanks for your help!

CC @Caleb-T-Owens who may have some experience with this.

@Byron Byron added the feedback requested Feedback was requested to help resolve the issue label Apr 12, 2025
@jhony1104
Copy link

Using a proxy to access a remote ollama, I had the same error. Starting in ollama with the environment variable OLLAMA_ORIGINS=* solved it for me.

@stevensiebe
Copy link
Author

These are the errors I see in the console
board:1 [Intervention] Images loaded lazily and replaced with placeholders. Load events are deferred. See https://go.microsoft.com/fwlink/?linkid=2048113 Tracking Prevention blocked access to storage for <URL>. Tracking Prevention blocked access to storage for <URL>. Tracking Prevention blocked access to storage for <URL>. Tracking Prevention blocked access to storage for <URL>. Tracking Prevention blocked access to storage for <URL>. Tracking Prevention blocked access to storage for <URL>. Tracking Prevention blocked access to storage for <URL>. Tracking Prevention blocked access to storage for <URL>. board:1 Autofocus processing was blocked because a document already has a focused element. hooks.client.ts:36 PromiseRejectionEvent {isTrusted: true, reason: SyntaxError: Failed to execute 'close' on 'ReadableStreamDefaultController': Unexpected end of JSON…, type: 'unhandledrejection', target: Window, currentTarget: Window, …}isTrusted: truebubbles: falsecancelBubble: falsecancelable: truecomposed: falsecurrentTarget: Window {window: Window, self: Window, document: document, name: '', location: Location, …}defaultPrevented: falseeventPhase: 0promise: (...)reason: SyntaxError: Failed to execute 'close' on 'ReadableStreamDefaultController': Unexpected end of JSON input at S.onmessage (http://tauri.localhost/_app/immutable/chunks/ayvuQ9Kc.js:49:1355) at http://tauri.localhost/_app/immutable/chunks/BXPbXBim.js:1:1000 at value (<anonymous>:275:30) at <anonymous>:1:159returnValue: truesrcElement: Window {window: Window, self: Window, document: document, name: '', location: Location, …}target: Window {window: Window, self: Window, document: document, name: '', location: Location, …}timeStamp: 18865.700000001118type: "unhandledrejection"[[Prototype]]: PromiseRejectionEvent Z @ hooks.client.ts:36 window.onunhandledrejection @ hooks.client.ts:24 VM222:1 Uncaught (in promise) SyntaxError: Failed to execute 'close' on 'ReadableStreamDefaultController': Unexpected end of JSON input at S.onmessage (index.js:130:32) at core.js:88:71 at value (<anonymous>:275:30) at <anonymous>:1:159 S.onmessage @ index.js:130 (anonymous) @ core.js:88 value @ VM12:275 (anonymous) @ VM221:1 Promise.then (anonymous) @ VM221:1

@Byron Byron removed the feedback requested Feedback was requested to help resolve the issue label Apr 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working UI Any broken visuals like layouts, colors etc.
Projects
None yet
Development

No branches or pull requests

3 participants