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

Backend port mismatch #281

Open
frafra opened this issue Feb 21, 2024 · 8 comments
Open

Backend port mismatch #281

frafra opened this issue Feb 21, 2024 · 8 comments

Comments

@frafra
Copy link

frafra commented Feb 21, 2024

Hi :)
I am running Azimutt locally using Docker Compose with the prebuilt image. Port 4000 is exposed, but when I try to add a schema from a database conection I get this error:

Loaded postgres database.
http://localhost:4177: NetworkError when attempting to fetch resource.
: Not Found
Done!
@rllola
Copy link

rllola commented Mar 26, 2024

I run into the same problem @frafra. You actually need to install CLI to extract the database schema.

Here the steps:

$ npm install -g azimutt
$ azimutt gateway

A note was showing but I missed it too...

@jmrenouard
Copy link

With docker install I get same error message

@rllola
Copy link

rllola commented Apr 14, 2024

I have published a gist with a working example including azimutt gateway to export postgres schema in docker compose.

https://gist.github.com/rllola/973d6911bf6cdeefa9f16a4ec7fd400d

It can be improved but it is working. I hope it will help @jmrenouard

@loicknuchel
Copy link
Contributor

Hi, this is expected ;)

Azimutt backend is listening to port 4000 but for privacy and networking reasons, it never access any customer database.
That's the gateway job, a small node app which can be seen as a proxy between your frontend and your database.
It's expected to be run locally by each user with npx azimutt@latest gateway and listen on port 4177. That's why Azimutt it trying to reach out localhost:4177, even on azimutt.app, if it fails it will try with the one I deployed (gateway.azimutt.app).
In enterprise plan, you can even define your own url if you want to host the gateway in your infra and maybe customize it with additional user/db rights ;)

@rllola do you think the gateway should be started by default in the Docker compose? Would make sense for easier trial (less to know at the beginning).

@rllola
Copy link

rllola commented Aug 21, 2024

That would be a nice touch. If people don't want to use it they can then comment it but it would show how to use it with the gateway or stop it via docker compose stop.
Personally, it was the feature that I wanted to try when I have found azimutt.

I can propose a PR to update the docker compose to include the gateway.

@loicknuchel
Copy link
Contributor

Cool, your PR is welcome 👍

@rllola
Copy link

rllola commented Aug 21, 2024

I am testing the docker compose using the current build. I have specify the gateway url like this : GATEWAY_URL: http://gateway:4177. gateway is the name of the service in the docker-compose.yml

Unfortunately it is not working. It is still trying to reach http://localhost:4177 (which is not available) and I also have a CORS error in the console.

Could it be that a modification lead to override the GATEWAY_URL environment variable ?

@rllola
Copy link

rllola commented Aug 21, 2024

I think it might come from here :
https://github.com/azimuttapp/azimutt/blob/main/frontend/ts-src/services/backend.ts#L190

It seems to try first to reach http://localhost:4177 first with a ping and it if fails it will try the reach the gateway_remote url. In my browser the local ping return 200 for some unknown reason.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants