continue icon indicating copy to clipboard operation
continue copied to clipboard

Setup Process Causes TCPIP flood via Ollama

Open adcura opened this issue 1 year ago • 4 comments

Before submitting your bug report

Relevant environment info

- OS: Windows 11
- Continue: 0.8.52 - 2024-09-16
- IDE: VS Code
- Model: Ollama version 0.3.11
- config.json: Unchanged Default config after just installing the extension

Description

During setup, I tried the Local With Ollama quickstart. I tried to copy the ollama pull llaama3.1b example into terminal to run it, but received this error: Error: Head "http://0.0.0.0:11434/": dial tcp 0.0.0.0:11434: bind: An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full.

Since my windows install is brand new, and I have Hyper-V running, I assumed it was a driver issue, or network config, so I spent a while resetting network, trying different driver settings.

I've just figured out that this event in my windows event log: TCP/IP failed to establish an outgoing connection because the selected local endpoint was recently used to connect to the same remote endpoint. This error typically occurs when outgoing connections are opened and closed at a high rate, causing all available local ports to be used and forcing TCP/IP to reuse a local port for an outgoing connection. To minimize the risk of data corruption, the TCP/IP standard requires a minimum time period to elapse between successive connections from a given local endpoint to a given remote endpoint. and this one: A request to allocate an ephemeral port number from the global TCP port space has failed due to all such ports being in use.

Was due to there being no more tcp ports available, every single one was used, as illustrated by netstat: ... [GIN] 2024/09/19 - 16:12:37 | 400 | 0s | 127.0.0.1 | POST "/api/show" [GIN] 2024/09/19 - 16:12:37 | 400 | 0s | 127.0.0.1 | POST "/api/show" [GIN] 2024/09/19 - 16:12:37 | 200 | 0s | 127.0.0.1 | GET "/api/tags" [GIN] 2024/09/19 - 16:12:38 | 400 | 679.7µs | 127.0.0.1 | POST "/api/show" [GIN] 2024/09/19 - 16:12:38 | 400 | 1.2483ms | 127.0.0.1 | POST "/api/show" ...

A continuous stream of requests, thousands per second was being made by something.

Turns out it was the Continue Extension Local With Ollama quickstart. When I closed that dialogue, the requests stopped and things returned to normal as the tcp ports freed up.

This flood of requests caused all other networking on my device to stop working properly, I imagine it could be fixed by implementing a throttle or timer in the checks to the local /api/tags and /api/show.

Any other information I could provide to help build a fix?

To reproduce

  1. install vs code extension for Continue on Windows 11
  2. Install Ollama
  3. Wait a minute until the tcp stack is full and web pages wont load, ollama cannot pull etc

Log output

[GIN] 2024/09/19 - 16:12:36 | 200 |      1.0213ms |       127.0.0.1 | GET      "/api/tags"
[GIN] 2024/09/19 - 16:12:37 | 400 |            0s |       127.0.0.1 | POST     "/api/show"
[GIN] 2024/09/19 - 16:12:37 | 400 |       504.7µs |       127.0.0.1 | POST     "/api/show"
[GIN] 2024/09/19 - 16:12:37 | 200 |      1.0325ms |       127.0.0.1 | GET      "/api/tags"
[GIN] 2024/09/19 - 16:12:37 | 200 |       527.8µs |       127.0.0.1 | GET      "/api/tags"
[GIN] 2024/09/19 - 16:12:37 | 400 |       503.4µs |       127.0.0.1 | POST     "/api/show"
[GIN] 2024/09/19 - 16:12:37 | 400 |            0s |       127.0.0.1 | POST     "/api/show"
[GIN] 2024/09/19 - 16:12:37 | 200 |      1.0415ms |       127.0.0.1 | GET      "/api/tags"
[GIN] 2024/09/19 - 16:12:37 | 200 |      1.0415ms |       127.0.0.1 | GET      "/api/tags"
[GIN] 2024/09/19 - 16:12:37 | 400 |            0s |       127.0.0.1 | POST     "/api/show"
[GIN] 2024/09/19 - 16:12:37 | 400 |            0s |       127.0.0.1 | POST     "/api/show"
[GIN] 2024/09/19 - 16:12:37 | 200 |       505.4µs |       127.0.0.1 | GET      "/api/tags"
[GIN] 2024/09/19 - 16:12:37 | 200 |       505.4µs |       127.0.0.1 | GET      "/api/tags"
[GIN] 2024/09/19 - 16:12:37 | 400 |            0s |       127.0.0.1 | POST     "/api/show"
[GIN] 2024/09/19 - 16:12:37 | 400 |            0s |       127.0.0.1 | POST     "/api/show"
[GIN] 2024/09/19 - 16:12:37 | 200 |       505.1µs |       127.0.0.1 | GET      "/api/tags"
[GIN] 2024/09/19 - 16:12:37 | 200 |       505.1µs |       127.0.0.1 | GET      "/api/tags"
[GIN] 2024/09/19 - 16:12:37 | 400 |            0s |       127.0.0.1 | POST     "/api/show"
[GIN] 2024/09/19 - 16:12:37 | 400 |            0s |       127.0.0.1 | POST     "/api/show"
[GIN] 2024/09/19 - 16:12:37 | 200 |       522.1µs |       127.0.0.1 | GET      "/api/tags"
[GIN] 2024/09/19 - 16:12:37 | 200 |       522.1µs |       127.0.0.1 | GET      "/api/tags"
[GIN] 2024/09/19 - 16:12:37 | 400 |            0s |       127.0.0.1 | POST     "/api/show"
[GIN] 2024/09/19 - 16:12:37 | 400 |            0s |       127.0.0.1 | POST     "/api/show"
[GIN] 2024/09/19 - 16:12:37 | 200 |       532.2µs |       127.0.0.1 | GET      "/api/tags"
[GIN] 2024/09/19 - 16:12:37 | 200 |       532.2µs |       127.0.0.1 | GET      "/api/tags"
[GIN] 2024/09/19 - 16:12:37 | 400 |            0s |       127.0.0.1 | POST     "/api/show"
[GIN] 2024/09/19 - 16:12:37 | 400 |            0s |       127.0.0.1 | POST     "/api/show"
[GIN] 2024/09/19 - 16:12:37 | 400 |            0s |       127.0.0.1 | POST     "/api/show"
[GIN] 2024/09/19 - 16:12:37 | 400 |            0s |       127.0.0.1 | POST     "/api/show"
[GIN] 2024/09/19 - 16:12:37 | 200 |       505.4µs |       127.0.0.1 | GET      "/api/tags"
[GIN] 2024/09/19 - 16:12:37 | 200 |       505.4µs |       127.0.0.1 | GET      "/api/tags"
[GIN] 2024/09/19 - 16:12:37 | 200 |       505.4µs |       127.0.0.1 | GET      "/api/tags"
[GIN] 2024/09/19 - 16:12:37 | 200 |       505.4µs |       127.0.0.1 | GET      "/api/tags"
[GIN] 2024/09/19 - 16:12:37 | 400 |            0s |       127.0.0.1 | POST     "/api/show"
[GIN] 2024/09/19 - 16:12:37 | 400 |            0s |       127.0.0.1 | POST     "/api/show"
[GIN] 2024/09/19 - 16:12:37 | 400 |            0s |       127.0.0.1 | POST     "/api/show"
[GIN] 2024/09/19 - 16:12:37 | 400 |            0s |       127.0.0.1 | POST     "/api/show"
[GIN] 2024/09/19 - 16:12:37 | 200 |       507.4µs |       127.0.0.1 | GET      "/api/tags"
[GIN] 2024/09/19 - 16:12:37 | 200 |       507.4µs |       127.0.0.1 | GET      "/api/tags"
[GIN] 2024/09/19 - 16:12:37 | 200 |       507.4µs |       127.0.0.1 | GET      "/api/tags"
[GIN] 2024/09/19 - 16:12:37 | 200 |       507.4µs |       127.0.0.1 | GET      "/api/tags"
[GIN] 2024/09/19 - 16:12:37 | 400 |            0s |       127.0.0.1 | POST     "/api/show"
[GIN] 2024/09/19 - 16:12:37 | 400 |            0s |       127.0.0.1 | POST     "/api/show"
[GIN] 2024/09/19 - 16:12:37 | 200 |       525.6µs |       127.0.0.1 | GET      "/api/tags"
[GIN] 2024/09/19 - 16:12:37 | 200 |      1.0415ms |       127.0.0.1 | GET      "/api/tags"
[GIN] 2024/09/19 - 16:12:37 | 400 |            0s |       127.0.0.1 | POST     "/api/show"
[GIN] 2024/09/19 - 16:12:37 | 400 |            0s |       127.0.0.1 | POST     "/api/show"
[GIN] 2024/09/19 - 16:12:37 | 200 |       504.7µs |       127.0.0.1 | GET      "/api/tags"
[GIN] 2024/09/19 - 16:12:37 | 200 |       504.7µs |       127.0.0.1 | GET      "/api/tags"
[GIN] 2024/09/19 - 16:12:37 | 400 |            0s |       127.0.0.1 | POST     "/api/show"
[GIN] 2024/09/19 - 16:12:37 | 400 |            0s |       127.0.0.1 | POST     "/api/show"
[GIN] 2024/09/19 - 16:12:37 | 200 |         515µs |       127.0.0.1 | GET      "/api/tags"
[GIN] 2024/09/19 - 16:12:37 | 200 |         515µs |       127.0.0.1 | GET      "/api/tags"
[GIN] 2024/09/19 - 16:12:37 | 400 |            0s |       127.0.0.1 | POST     "/api/show"
[GIN] 2024/09/19 - 16:12:37 | 400 |       519.3µs |       127.0.0.1 | POST     "/api/show"
[GIN] 2024/09/19 - 16:12:37 | 200 |       519.3µs |       127.0.0.1 | GET      "/api/tags"
[GIN] 2024/09/19 - 16:12:37 | 200 |       518.8µs |       127.0.0.1 | GET      "/api/tags"
[GIN] 2024/09/19 - 16:12:37 | 400 |            0s |       127.0.0.1 | POST     "/api/show"
[GIN] 2024/09/19 - 16:12:37 | 400 |            0s |       127.0.0.1 | POST     "/api/show"
[GIN] 2024/09/19 - 16:12:37 | 200 |            0s |       127.0.0.1 | GET      "/api/tags"
[GIN] 2024/09/19 - 16:12:37 | 200 |       504.9µs |       127.0.0.1 | GET      "/api/tags"
[GIN] 2024/09/19 - 16:12:37 | 400 |            0s |       127.0.0.1 | POST     "/api/show"
[GIN] 2024/09/19 - 16:12:37 | 200 |       290.4µs |       127.0.0.1 | GET      "/api/tags"
[GIN] 2024/09/19 - 16:12:37 | 400 |            0s |       127.0.0.1 | POST     "/api/show"
[GIN] 2024/09/19 - 16:12:37 | 400 |            0s |       127.0.0.1 | POST     "/api/show"
[GIN] 2024/09/19 - 16:12:37 | 400 |            0s |       127.0.0.1 | POST     "/api/show"
[GIN] 2024/09/19 - 16:12:37 | 200 |       518.1µs |       127.0.0.1 | GET      "/api/tags"
[GIN] 2024/09/19 - 16:12:37 | 200 |            0s |       127.0.0.1 | GET      "/api/tags"
[GIN] 2024/09/19 - 16:12:37 | 200 |            0s |       127.0.0.1 | GET      "/api/tags"
[GIN] 2024/09/19 - 16:12:37 | 400 |            0s |       127.0.0.1 | POST     "/api/show"
[GIN] 2024/09/19 - 16:12:37 | 400 |            0s |       127.0.0.1 | POST     "/api/show"
[GIN] 2024/09/19 - 16:12:37 | 400 |            0s |       127.0.0.1 | POST     "/api/show"
[GIN] 2024/09/19 - 16:12:37 | 400 |            0s |       127.0.0.1 | POST     "/api/show"
[GIN] 2024/09/19 - 16:12:37 | 200 |       538.5µs |       127.0.0.1 | GET      "/api/tags"
[GIN] 2024/09/19 - 16:12:37 | 200 |       538.5µs |       127.0.0.1 | GET      "/api/tags"
[GIN] 2024/09/19 - 16:12:37 | 200 |       538.5µs |       127.0.0.1 | GET      "/api/tags"
[GIN] 2024/09/19 - 16:12:37 | 200 |       538.5µs |       127.0.0.1 | GET      "/api/tags"
[GIN] 2024/09/19 - 16:12:37 | 400 |            0s |       127.0.0.1 | POST     "/api/show"
[GIN] 2024/09/19 - 16:12:37 | 200 |       529.6µs |       127.0.0.1 | GET      "/api/tags"
[GIN] 2024/09/19 - 16:12:37 | 400 |            0s |       127.0.0.1 | POST     "/api/show"
[GIN] 2024/09/19 - 16:12:37 | 200 |            0s |       127.0.0.1 | GET      "/api/tags"
[GIN] 2024/09/19 - 16:12:37 | 400 |            0s |       127.0.0.1 | POST     "/api/show"
[GIN] 2024/09/19 - 16:12:37 | 400 |            0s |       127.0.0.1 | POST     "/api/show"
[GIN] 2024/09/19 - 16:12:37 | 200 |        96.3µs |       127.0.0.1 | GET      "/api/tags"
[GIN] 2024/09/19 - 16:12:37 | 200 |            0s |       127.0.0.1 | GET      "/api/tags"
[GIN] 2024/09/19 - 16:12:37 | 400 |            0s |       127.0.0.1 | POST     "/api/show"
[GIN] 2024/09/19 - 16:12:37 | 400 |       535.9µs |       127.0.0.1 | POST     "/api/show"
[GIN] 2024/09/19 - 16:12:37 | 200 |       178.9µs |       127.0.0.1 | GET      "/api/tags"
[GIN] 2024/09/19 - 16:12:37 | 200 |       178.9µs |       127.0.0.1 | GET      "/api/tags"
[GIN] 2024/09/19 - 16:12:37 | 400 |            0s |       127.0.0.1 | POST     "/api/show"
[GIN] 2024/09/19 - 16:12:37 | 400 |            0s |       127.0.0.1 | POST     "/api/show"
[GIN] 2024/09/19 - 16:12:37 | 200 |            0s |       127.0.0.1 | GET      "/api/tags"
[GIN] 2024/09/19 - 16:12:37 | 200 |            0s |       127.0.0.1 | GET      "/api/tags"
[GIN] 2024/09/19 - 16:12:37 | 400 |            0s |       127.0.0.1 | POST     "/api/show"
[GIN] 2024/09/19 - 16:12:37 | 400 |            0s |       127.0.0.1 | POST     "/api/show"

adcura avatar Sep 19 '24 06:09 adcura