Skip to content
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

timeout exception Error: failed to pipe response #42

Open
tengzhexiao opened this issue Mar 3, 2024 · 8 comments
Open

timeout exception Error: failed to pipe response #42

tengzhexiao opened this issue Mar 3, 2024 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@tengzhexiao
Copy link

when I try to response from ollama a few second,
the error log:

⨯ Error: failed to pipe response 2024-03-03 21:28:21 at pipeToNodeResponse (/app/node_modules/next/dist/server/pipe-readable.js:111:15) 2024-03-03 21:28:21 at process.processTicksAndRejections (node:internal/process/task_queues:95:5) 2024-03-03 21:28:21 at async NextNodeServer.runEdgeFunction (/app/node_modules/next/dist/server/next-server.js:1225:13) 2024-03-03 21:28:21 at async NextNodeServer.handleCatchallRenderRequest (/app/node_modules/next/dist/server/next-server.js:247:37) 2024-03-03 21:28:21 at async NextNodeServer.handleRequestImpl (/app/node_modules/next/dist/server/base-server.js:807:17) 2024-03-03 21:28:21 at async invokeRender (/app/node_modules/next/dist/server/lib/router-server.js:163:21) 2024-03-03 21:28:21 at async handleRequest (/app/node_modules/next/dist/server/lib/router-server.js:342:24) 2024-03-03 21:28:21 at async requestHandlerImpl (/app/node_modules/next/dist/server/lib/router-server.js:366:13) 2024-03-03 21:28:21 at async Server.requestListener (/app/node_modules/next/dist/server/lib/start-server.js:140:13) { 2024-03-03 21:28:21 [cause]: SyntaxError: Expected ',' or ']' after array element in JSON at position 1454 2024-03-03 21:28:21 at JSON.parse (<anonymous>) 2024-03-03 21:28:21 at Object.start (/app/.next/server/pages/api/chat.js:1:822) 2024-03-03 21:28:21 at process.processTicksAndRejections (node:internal/process/task_queues:95:5) 2024-03-03 21:28:21 } 2024-03-03 21:28:21 Error: aborted 2024-03-03 21:28:21 at connResetException (node:internal/errors:787:14) 2024-03-03 21:28:21 at abortIncoming (node:_http_server:793:17) 2024-03-03 21:28:21 at socketOnClose (node:_http_server:787:3) 2024-03-03 21:28:21 at Socket.emit (node:events:530:35) 2024-03-03 21:28:21 at TCP.<anonymous> (node:net:337:12) { 2024-03-03 21:28:21 code: 'ECONNRESET' 2024-03-03 21:28:21 }

in ollama console every thing is all right.

@daniiiol
Copy link

daniiiol commented Mar 4, 2024

I have the same issue here 👋

@ivanfioravanti ivanfioravanti self-assigned this Mar 4, 2024
@ivanfioravanti ivanfioravanti added the bug Something isn't working label Mar 4, 2024
@ivanfioravanti
Copy link
Owner

I will check and keep you posted

@guofeng63667
Copy link

the same issue

@wenkeming
Copy link

image Same issue during chat, and there is no problem to geting the model list

@damiencarrier
Copy link

Same issue using windows 11 and pinokio installer:
Start very often after at the end of first assistant generation.

✓ Ready in 6.3s
⨯ Error: failed to pipe response
at pipeToNodeResponse (E:\IA\pinokio\api\chatbot-ollama.git\app\node_modules\next\dist\server\pipe-readable.js:111:15)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async NextNodeServer.runEdgeFunction (E:\IA\pinokio\api\chatbot-ollama.git\app\node_modules\next\dist\server\next-server.js:1225:13)
at async NextNodeServer.handleCatchallRenderRequest (E:\IA\pinokio\api\chatbot-ollama.git\app\node_modules\next\dist\server\next-server.js:247:37)
at async NextNodeServer.handleRequestImpl (E:\IA\pinokio\api\chatbot-ollama.git\app\node_modules\next\dist\server\base-server.js:807:17)
at async invokeRender (E:\IA\pinokio\api\chatbot-ollama.git\app\node_modules\next\dist\server\lib\router-server.js:163:21)
at async handleRequest (E:\IA\pinokio\api\chatbot-ollama.git\app\node_modules\next\dist\server\lib\router-server.js:342:24)
at async requestHandlerImpl (E:\IA\pinokio\api\chatbot-ollama.git\app\node_modules\next\dist\server\lib\router-server.js:366:13)
at async Server.requestListener (E:\IA\pinokio\api\chatbot-ollama.git\app\node_modules\next\dist\server\lib\start-server.js:140:13) {
[cause]: SyntaxError: Expected ',' or ']' after array element in JSON at position 4090
at JSON.parse ()
at Object.start (E:\IA\pinokio\api\chatbot-ollama.git\app.next\server\pages\api\chat.js:1:822)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
}
Error: aborted
at connResetException (node:internal/errors:721:14)
at abortIncoming (node:_http_server:793:17)
at socketOnClose (node:_http_server:787:3)
at Socket.emit (node:events:526:35)
at TCP. (node:net:337:12) {
code: 'ECONNRESET'
}

@ukorg-hash
Copy link

I just encountered this same issue on unraid 6.12.10. After reboot it starts working again and hangs after some time. I did some testing to reproduce the hang but it feels to random. stop/starting the ollama and chatbot-ollama didn't have any effect.

 ⨯ Error: failed to pipe response
    at pipeToNodeResponse (/app/node_modules/next/dist/server/pipe-readable.js:111:15)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async NextNodeServer.runEdgeFunction (/app/node_modules/next/dist/server/next-server.js:1225:13)
    at async NextNodeServer.handleCatchallRenderRequest (/app/node_modules/next/dist/server/next-server.js:247:37)
    at async NextNodeServer.handleRequestImpl (/app/node_modules/next/dist/server/base-server.js:807:17)
    at async invokeRender (/app/node_modules/next/dist/server/lib/router-server.js:163:21)
    at async handleRequest (/app/node_modules/next/dist/server/lib/router-server.js:342:24)
    at async requestHandlerImpl (/app/node_modules/next/dist/server/lib/router-server.js:366:13)
    at async Server.requestListener (/app/node_modules/next/dist/server/lib/start-server.js:140:13) {
  [cause]: SyntaxError: Unexpected non-whitespace character after JSON at position 101
      at JSON.parse (<anonymous>)
      at Object.start (/app/.next/server/pages/api/chat.js:1:822)
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
}
Error: aborted
    at abortIncoming (node:_http_server:794:17)
    at socketOnClose (node:_http_server:788:3)
    at Socket.emit (node:events:530:35)
    at TCP.<anonymous> (node:net:337:12) {
  code: 'ECONNRESET'
}

> [email protected] start
> next start

   ▲ Next.js 14.1.0
   - Local:        http://localhost:3000

 ✓ Ready in 354ms

@marcelogmca
Copy link

marcelogmca commented Aug 26, 2024

To anyone still finding this issue, I managed to fix it by replacing the first JSON.parse(r) in "/app/.next/server/pages/api/chat.js", to this: try{n=JSON.parse(r)}catch(e){n = {"response":""};}

After that I never had any issues with the generation getting stuck.

I didn't look deep into the issue too much, but this fixed the problem on the surface at least.

@ivanfioravanti
Copy link
Owner

Would you like filing a PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants