Specker server running error

I am following steps from this Local development environment | Speckle Docs to run speckle server. I am getting below error.
I have tried changing redis default port from 6379 to 6380 but still same error. Please let me know what is problem here

@speckle/server: [ioredis] Unhandled error event: Error: connect ECONNREFUSED 127.0.0.1:6380
@speckle/server: at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1161:16)
@speckle/server: [ioredis] Unhandled error event: Error: connect ECONNREFUSED 127.0.0.1:6380
@speckle/server: at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1161:16)

Hi @vandana.babshetti, and welcome to the forum! It’s usually a pain to debug local server setups, so get ready :sweat_smile: If your redis db is running at a custom port, you probably might want to change this line in the .env file of the server.

(PS: I don’t spin up dependencies using docker; on windows you can install redis from here).

Thanks @dimitrie for quick reply. I have changed .env file. Installed redis from same link which you mentioned.

and did it work? I don’t want to celebrate early!

Its correct in my setup redis port in .env and I have installed redis from same location. As such no changes from your first reply.

If you need any more information please let me know

Hi @vandana.babshetti ,

Hmm, here’s a quick checklist to make sure i understand correctly:

  1. You are using Windows have Redis installed. Can you check if redis is running and you can use it independently? Also, on what port is it listening for connections?

  2. in your .env file you have the default REDIS_URL="redis://localhost:6379" ?

  3. Can you copy paste the server output, after verifying the above?

Thanks,
Cristi

  1. You are using Windows have Redis installed.
    Ans Yes

Can you check if redis is running and you can use it independently?

Ans Yes running and able to use independently

Also, on what port is it listening for connections?
Ans redis port 6380

  1. in your .env file you have the default REDIS_URL="redis://localhost:6379" ?
    Ans REDIS_URL="redis://localhost:6380"

  2. Can you copy paste the server output, after verifying the above?
    I am running npx lerna run dev --parallel and getting error below error

@speckle/server: [ioredis] Unhandled error event: Error: connect ECONNREFUSED 127.0.0.1:6380
@speckle/server: at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1161:16)
@speckle/server: [ioredis] Unhandled error event: Error: connect ECONNREFUSED 127.0.0.1:6380
@speckle/server: at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1161:16)

Hmm, the error mentions that there is no program listening on port 6380 on localhost… but u mentioned your redis listens on that port.

Can you run the following in a cmd window, to confirm?

netstat -ano | find "6379"

and

netstat -ano | find "6380"

The commands should display a line if there’s a program listenting on that port (with the pid of the process), or it will not display anything if there’s nothing listening on that port

Thanks for reply!!
Here is result

C:\Windows\system32>netstat -ano | find “6379”
TCP 127.0.0.1:6379 0.0.0.0:0 LISTENING 16428

Oh, So redis is actually listening on 6379!

Can you change the port in the env file to the default 6379 and try again?

Tried but same error with post 6379.

Can you paste the error after changing the redis port? Shouldn’t be connection refused if the port is open

This is error. I am running it from docker container

@speckle/server: [ioredis] Unhandled error event: Error: connect ECONNREFUSED 127.0.0.1:6379
@speckle/server: at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1142:16)
@speckle/server: [ioredis] Unhandled error event: Error: connect ECONNREFUSED 127.0.0.1:6379
@speckle/server: at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1142:16)
@speckle/server: [ioredis] Unhandled error event: Error: connect ECONNREFUSED 127.0.0.1:6379
@speckle/server: at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1142:16)
@speckle/server: [ioredis] Unhandled error event: Error: connect ECONNREFUSED 127.0.0.1:6379
@speckle/server: at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1142:16)
@speckle/server: [ioredis] Unhandled error event: Error: connect ECONNREFUSED 127.0.0.1:6379
@speckle/server: at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1142:16)
@speckle/server: [ioredis] Unhandled error event: Error: connect ECONNREFUSED 127.0.0.1:6379
@speckle/server: at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1142:16)

When I run it outside container then I am getting below error

It will be great if you help me to run anyone of it.

Thanks in advance.

Oooh, that explains it! If you run in docker container and want to be able to access services running on localhost, you can pass the parameter --net=host when running the container.

When you run directly, there seems to be a linux/windows small issue that we will fix. In the meantime, you can remove the debug variable in package.json.

I can give more details tomorrow if u need, as i’ll board a plane soon :slight_smile:

Okay!! Sounds good!! I will remove debug variable. Please help to fix it on tomorrow. I will be waiting for your reply. I am working on windows. Thanks.

I am able to resolve above error. I am getting below error now for web hook, file import and preview service
Error executing task: error:
@speckle/preview-service: UPDATE object_preview
@speckle/preview-service: SET
@speckle/preview-service: “previewStatus” = 1,
@speckle/preview-service: “lastUpdate” = NOW()
@speckle/preview-service: FROM (
@speckle/preview-service: SELECT “streamId”, “objectId” FROM object_preview
@speckle/preview-service: WHERE “previewStatus” = 0 OR (“previewStatus” = 1 AND “lastUpdate” < NOW() - INTERVAL ‘1 WEEK’)
@speckle/preview-service: ORDER BY “priority” ASC, “lastUpdate” ASC
@speckle/preview-service: LIMIT 1
@speckle/preview-service: ) as task
@speckle/preview-service: WHERE object_preview.“streamId” = task.“streamId” AND object_preview.“objectId” = task.“objectId”
@speckle/preview-service: RETURNING object_preview.“streamId”, object_preview.“objectId”
@speckle/preview-service: - relation “object_preview” does not exist
@speckle/preview-service: at Parser.parseErrorMessage (C:\Users\babshev\source\repos\speckle-server\packages\preview-service\node_modules\pg-protocol\dist\parser.js:287:98)
@speckle/preview-service: at Parser.handlePacket (C:\Users\babshev\source\repos\speckle-server\packages\preview-service\node_modules\pg-protocol\dist\parser.js:126:29)
@speckle/preview-service: at Parser.parse (C:\Users\babshev\source\repos\speckle-server\packages\preview-service\node_modules\pg-protocol\dist\parser.js:39:38)
@speckle/preview-service: at Socket. (C:\Users\babshev\source\repos\speckle-server\packages\preview-service\node_modules\pg-protocol\dist\index.js:11:42)
@speckle/preview-service: at Socket.emit (node:events:520:28)
@speckle/preview-service: at addChunk (node:internal/streams/readable:315:12)
@speckle/preview-service: at readableAddChunk (node:internal/streams/readable:289:9)
@speckle/preview-service: at Socket.Readable.push (node:internal/streams/readable:228:10)
@speckle/preview-service: at TCP.onStreamRead (node:internal/stream_base_commons:190:23) {
@speckle/preview-service: length: 113,
@speckle/preview-service: severity: ‘ERROR’,
@speckle/preview-service: code: ‘42P01’,
@speckle/preview-service: detail: undefined,
@speckle/preview-service: hint: undefined,
@speckle/preview-service: position: ‘13’,
@speckle/preview-service: internalPosition: undefined,
@speckle/preview-service: internalQuery: undefined,
@speckle/preview-service: where: undefined,
@speckle/preview-service: schema: undefined,
@speckle/preview-service: table: undefined,
@speckle/preview-service: column: undefined,
@speckle/preview-service: dataType: undefined,
@speckle/preview-service: constraint: undefined,
@speckle/preview-service: file: ‘parse_relation.c’,
@speckle/preview-service: line: ‘1376’,
@speckle/preview-service: routine: ‘parserOpenTable’
@speckle/preview-service: }

It will be great if you help me for it

Hi @vandana.babshetti, one thing that i would try is to start the services one by one. The essential ones are the server and the frontend. That would mean:

  • cd packages/server
  • npm run dev

and in a different terminal:

  • cd packages/frontend
  • npm run dev

I’m saying this because the critical error message in that dump is, i suspect:

@speckle/preview-service: - relation “object_preview” does not exist

Which potentially can mean that the migrations didn’t run yet, and the preview service starts before they completed. Anyway, this will help us drill down a bit more.

Thanks dimitrie for quick reply.
Here is error after above steps

result on localhost as below

Please let me know what is missing here