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

Error with ollama api #28

Open
Kocurowy96 opened this issue Jan 4, 2025 · 6 comments
Open

Error with ollama api #28

Kocurowy96 opened this issue Jan 4, 2025 · 6 comments
Labels
invalid This doesn't seem right

Comments

@Kocurowy96
Copy link

mes1sage.txt
http://localhost:11434/api/show - in web:
ima1ge
http://localhost:11434 - in web:
obraz

@Kocurowy96
Copy link
Author

Kocurowy96 commented Jan 4, 2025

mes1sage.txt:
[Shard #0] [ERROR] AxiosError: connect ECONNREFUSED ::1:11434
at AxiosError.from (file:///D:/discord-ai-bot-main/discord-ai-bot-main/node_modules/axios/lib/core/AxiosError.js:92:14)
at RedirectableRequest.handleRequestError (file:///D:/discord-ai-bot-main/discord-ai-bot-main/node_modules/axios/lib/adapters/http.js:620:25)
at RedirectableRequest.emit (node:events:517:28)
at eventHandlers. (D:\discord-ai-bot-main\discord-ai-bot-main\node_modules\follow-redirects\index.js:49:24)
at ClientRequest.emit (node:events:517:28)
at Socket.socketErrorListener (node:_http_client:501:9)
at Socket.emit (node:events:517:28)
at emitErrorNT (node:internal/streams/destroy:151:8)
at emitErrorCloseNT (node:internal/streams/destroy:116:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
at Axios.request (file:///D:/discord-ai-bot-main/discord-ai-bot-main/node_modules/axios/lib/core/Axios.js:45:41)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async makeRequest (file:///D:/discord-ai-bot-main/discord-ai-bot-main/src/bot.js:77:19)
at async Client. (file:///D:/discord-ai-bot-main/discord-ai-bot-main/src/bot.js:292:17) {
port: 11434,
address: '::1',
syscall: 'connect',
code: 'ECONNREFUSED',
errno: -4078,
config: {
transitional: {
silentJSONParsing: true,
forcedJSONParsing: true,
clarifyTimeoutError: false
},
adapter: [ 'xhr', 'http', 'fetch' ],
transformRequest: [ [Function: transformRequest] ],
transformResponse: [ [Function: transformResponse] ],
timeout: 0,
xsrfCookieName: 'XSRF-TOKEN',
xsrfHeaderName: 'X-XSRF-TOKEN',
maxContentLength: -1,
maxBodyLength: -1,
env: { FormData: [Function], Blob: [class Blob] },
validateStatus: [Function: validateStatus],
headers: Object [AxiosHeaders] {
Accept: 'application/json, text/plain, /',
'Content-Type': 'application/json',
'User-Agent': 'axios/1.7.9',
'Content-Length': '17',
'Accept-Encoding': 'gzip, compress, deflate, br'
},
method: 'post',
url: URL {
href: 'http://localhost:11434/api/show',
origin: 'http://localhost:11434',
protocol: 'http:',
username: '',
password: '',
host: 'localhost:11434',
hostname: 'localhost',
port: '11434',
pathname: '/api/show',
search: '',
searchParams: URLSearchParams {},
hash: ''
},
data: '{"name":"llama2"}',
responseType: 'text'
},
request: <ref *1> Writable {
_writableState: WritableState {
objectMode: false,
highWaterMark: 16384,
finalCalled: false,
needDrain: false,
ending: false,
ended: false,
finished: false,
destroyed: false,
decodeStrings: true,
defaultEncoding: 'utf8',
length: 0,
writing: false,
corked: 0,
sync: true,
bufferProcessing: false,
onwrite: [Function: bound onwrite],
writecb: null,
writelen: 0,
afterWriteTickInfo: null,
buffered: [],
bufferedIndex: 0,
allBuffers: true,
allNoop: true,
pendingcb: 0,
constructed: true,
prefinished: false,
errorEmitted: false,
emitClose: true,
autoDestroy: true,
errored: null,
closed: false,
closeEmitted: false,
[Symbol(kOnFinished)]: []
},
_events: [Object: null prototype] {
response: [Function: handleResponse],
error: [Function: handleRequestError],
socket: [Function: handleRequestSocket]
},
_eventsCount: 3,
_maxListeners: undefined,
_options: {
maxRedirects: 21,
maxBodyLength: Infinity,
protocol: 'http:',
path: '/api/show',
method: 'POST',
headers: [Object: null prototype],
agents: [Object],
auth: undefined,
family: undefined,
beforeRedirect: [Function: dispatchBeforeRedirect],
beforeRedirects: [Object],
hostname: 'localhost',
port: '11434',
agent: undefined,
nativeProtocols: [Object],
pathname: '/api/show'
},
_ended: false,
_ending: true,
_redirectCount: 0,
_redirects: [],
_requestBodyLength: 17,
_requestBodyBuffers: [ [Object] ],
_onNativeResponse: [Function (anonymous)],
_currentRequest: ClientRequest {
_events: [Object: null prototype],
_eventsCount: 7,
_maxListeners: undefined,
outputData: [],
outputSize: 0,
writable: true,
destroyed: false,
_last: true,
chunkedEncoding: false,
shouldKeepAlive: false,
maxRequestsOnConnectionReached: false,
_defaultKeepAlive: true,
useChunkedEncodingByDefault: true,
sendDate: false,
_removedConnection: false,
_removedContLen: false,
_removedTE: false,
strictContentLength: false,
_contentLength: '17',
_hasBody: true,
_trailer: '',
finished: false,
_headerSent: true,
_closed: false,
socket: [Socket],
_header: 'POST /api/show HTTP/1.1\r\n' +
'Accept: application/json, text/plain, /\r\n' +
'Content-Type: application/json\r\n' +
'User-Agent: axios/1.7.9\r\n' +
'Content-Length: 17\r\n' +
'Accept-Encoding: gzip, compress, deflate, br\r\n' +
'Host: localhost:11434\r\n' +
'Connection: close\r\n' +
'\r\n',
_keepAliveTimeout: 0,
_onPendingData: [Function: nop],
agent: [Agent],
socketPath: undefined,
method: 'POST',
maxHeaderSize: undefined,
insecureHTTPParser: undefined,
joinDuplicateHeaders: undefined,
path: '/api/show',
_ended: false,
res: null,
aborted: false,
timeoutCb: null,
upgradeOrConnect: false,
parser: null,
maxHeadersCount: null,
reusedSocket: false,
host: 'localhost',
protocol: 'http:',
_redirectable: [Circular *1],
[Symbol(kCapture)]: false,
[Symbol(kBytesWritten)]: 0,
[Symbol(kNeedDrain)]: false,
[Symbol(corked)]: 0,
[Symbol(kOutHeaders)]: [Object: null prototype],
[Symbol(errored)]: null,
[Symbol(kHighWaterMark)]: 16384,
[Symbol(kRejectNonStandardBodyWrites)]: false,
[Symbol(kUniqueHeaders)]: null
},
_currentUrl: 'http://localhost:11434/api/show',
[Symbol(kCapture)]: false
},
cause: Error: connect ECONNREFUSED ::1:11434
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1555:16) {
errno: -4078,
code: 'ECONNREFUSED',
syscall: 'connect',
address: '::1',
port: 11434
}
}

@Kocurowy96
Copy link
Author

Ollama is working but:
obraz
Sorry, i from poland and i don't know to translate this error

@Kocurowy96
Copy link
Author

@238SAMIxD
obraz
I have a anwser from Ollama Server

@238SAMIxD
Copy link
Owner

Hey! Thank you for reporting the issue. I investigated it and it seems all works correctly. The issue persist only when I want to get model info for a model that do not exist. Please check if you have correct MODEL set in .env file
image

# What language model to use, orca is one of the lower-end models that doesn't require as much computer power as llama2
MODEL=llama3.1

Daj znać, czy działa :D

@238SAMIxD 238SAMIxD added the invalid This doesn't seem right label Jan 4, 2025
@Furundane
Copy link

Furundane commented Jan 8, 2025

I have same problems, it is not working with some model names with parameter number like qwen:0.5b and llama3.2:1b . I tried general-name in ollama pull (model) command, it's not working too.

Calling /api/show failing, bot won't generate message. in ollama, with ollama show qwen:0.5b commands /api/show works.

@Furundane
Copy link

Furundane commented Jan 8, 2025

@Kocurowy96 imo, set IP Address to 0.0.0.0 not localhost. I had same econrefused problems, but it solved after i changed ip address to 0.0.0.0:11434

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

3 participants