Error while trying open frontend running on 3000

Hi Speckle team!

I’m new to speckle. I was trying it to setup the speckle server in local.
All things are setup, postgres, redis etc…

But I could able to open the frontend running on http:localhost:3000
I got this response in browser >> Error occurred while trying to proxy: localhost:3000/

While I check in cmd of the application, I got the error which I have attached as image below.

Please me out resolving this.

Thanks in advance!

Heya! Welcome to the speckle community. Here’s how i usually set things up for dev locally:

  • from the server repo (speckle server repo folder/packages/server) i run yarn dev
  • in a new terminal (speckle server repo folder/packages/frontend) i run yarn dev

This makes sure we’re running just the main two components, namely the server and the frontend. File imports won’t work, and neither will be previews be generated, but that’s usually okay if i’m not debugging those specifically! Let me know if this helps.

Thank you so much @dimitrie for you help!
I opened this URL : http://localhost:8080/authn/login

but got this response. Here instead of interoperability in seconds it should be login or register section.

Please if you can do this favour, I’ll be grateful.

Perfect, we’re getting there! Last step: instead of localhost:8080, go to :3000 - the server proxies the frontend for you.

Let me know if that helps, otherwise we dig in a bit more.

got this response again. Do I need to do anything else?

image

In server,

okay, a few extra asks then:

  • can i see the .env file for the server?
  • what environment are you running in? (e.g., is this WLS?)
  • can i see a screenshot or a copy paste of the server initialization logs?
  1. server .env file
    .env (4.2 KB)

  2. I’m not getting this. what’s WLS?

  3. sure.

FYI, redis is also up and running.

(WSL = windows subsystem for linux, doesn’t matter much)

At the bottom of your env file, there’s these two variables:

could you uncomment them and restart the server? I’m going to be AFK for a while now, but will try to chime in later. I suspect there might be some port/hosts mismatches somewhere…

Tried. But no progress. Same error.

Let me know if you need more information about it.

Sure. Will be waiting for your response.

If anyone has found any solutions to it. Please help me out.
I’m still been stuck at this.

Thank you!

Hi @moin034ws

I’d like to try to replicate (and hopefully solve) your problem, but I will need clear instructions as to what commands you are using.

Which operating system are you using?
Can you please list out the exact commands that you are running?

Thank you,

Iain

sure.

I’m using Windows Operating System and Windows PowerShell for commands to execute.

Basically, I’m following this docs, Local development environment | Speckle Docs

  1. git clone https://github.com/specklesystems/speckle-server.git
  2. corepack enable
  3. yarn

Then I got to know about PostgreSQL, redis etc… were required, so I installed accordingly them but redis I’m not using WSL, i’m running it directly in my windows OS.

  1. yarn build

Once the build has completed, I had different Postgres username, password and DB them the official project. So I replaced them all in local system where I have cloned it.

username: postgres
password: 123456789
DB: speckle: speckle_test

The files where I made changes are,

  1. \speckle-server\docker-compose-speckle.yml
    Here the changes were,
    POSTGRES_DB, POSTGRES_PASSWORD, POSTGRES_USER, POSTGRES_URL: ‘postgres’, where DB,
    username and password set as above value.
    PG_CONNECTION_STRING: ‘postgres://postgres:123456789@localhost:5432/speckle_test
    A question here, what should be the URL for SPECKLE_SERVER_URL in fileimport-service: section of
    above file.

  2. \speckle-server.circleci\config.yml
    Here the changes were,
    POSTGRES_DB, POSTGRES_PASSWORD, POSTGRES_USER, POSTGRES_URL: ‘postgres’, where DB,
    username and password set as above value only in test-server: section.
    A question here too, what should be the URL for CANONICAL_URL

Similar postgres changes in following files,

  1. speckle-server\docker-compose-deps.yml

  2. speckle-server\packages\fileimport-service\knex.js

  3. speckle-server\packages\fileimport-service\package.json

  4. speckle-server\packages\preview-service\knex.js

  5. speckle-server\packages\server.vscode\launch.json

  6. speckle-server\packages\webhook-service\src\knex.js

  7. speckle-server\utils\1click_image_scripts\template-docker-compose.yml
    Here the changes were,
    POSTGRES_DB, POSTGRES_PASSWORD, POSTGRES_USER, POSTGRES_URL: ‘postgres’, where DB,
    username and password set as above value.
    A question here too, what should be the URL for CANONICAL_URL

  8. speckle-server\utils\monitor-deployment\dev_run.sh
    Here, I only changed value PG_CONNECTION_STRING =
    postgres://postgres:123456789@localhost:5432/speckle_test

  9. speckle-server\packages\server.env
    Here made changes for PostgreSQL,
    A question here too, what should be the URL for CANONICAL_URL

  10. speckle-server\packages\server.env.test
    Here, I changed POSTGRES_URL and POSTGRES_USER

  1. yarn dev:docker:up
  2. yarn dev

So that’s all I did.
I’m sure, somewhere I have messed up. If you can look into it and provide me with a solution, It would really be a great help.

Thank you, and I apologize if the detailed information I provided seemed lengthy and might have caused any inconvenience.

Hi! @iainsproat @dimitrie
Were you able to figure it out the cause for the issue below?

I tried adding this proxy_read_timeout 300s; in speckle-server\utils\1click_image_scripts\template-nginx-site.conf. But still no luck

If this error could be more specific. It’ll be a great help.

Hi @moin034ws

I tried recreating the issue last night but wasn’t able to.

Were you able to get speckle server running with the default configuration? i.e. run the docker compose file containing the dependencies, docker-compose-deps.yml, and use the original values for all of the variables.

If you are able to get this default configuration running, it would suggest that the issue is with one of the dependencies or variables you currently have. If you aren’t able to get the default configuration running, it may be an issue with the speckle server or how it interacts with your particular environment (which includes operating system and network).

The 504 Http Status Code is an indication that Speckle Server, or the ingress, cannot reach an upstream component. 504 Gateway Timeout - HTTP | MDN

Iain

Sort of found a solution here.

I could able to resolve all the issues, so I downgraded the node version to 16. It worked.
As you suggested, many configurations I kept as default.
Major changes were related to Postgres credentials, redis URLs, so updated them in most of the files.

Thanks a lot.

Hey @moin034ws

I’ve been able to reproduce your issue on my setup. It is related to the backend not being able to proxy to the frontend. The culprit is again the node 16 → 18 upgrade breaking localhost dns resolution in some setups. So downgrading to node 16 does fix the issue, but it might bring in other issues we do not know / test for / support.
Instead I’ve added a PR to fix the issues and make things work on node 18. If you update your version, please also update your .env file values too in frontend 1 and 2 depending on which one you use.

Regard,
Gergő

3 Likes

Hi!

Thank you! Sure, will follow up.

Regards,
Moin