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

marquez web proxy error #1735

Open
dvirgiln opened this issue Nov 1, 2021 · 3 comments
Open

marquez web proxy error #1735

dvirgiln opened this issue Nov 1, 2021 · 3 comments
Labels
bug Something isn't working
Milestone

Comments

@dvirgiln
Copy link

dvirgiln commented Nov 1, 2021

I am receiving an error accesing the API from marquez web

[HPM] Error occurred while trying to proxy request /api/v1/namespaces from marquez-web-internal-eks.eu-west-1.dev.hbi.systems to http://marquez-internal-eks.eu-west-1.dev.hbi.systems:80/ (ECONNRESET)

My application is deployed in Kubernetes. There is a redirection from http to https.

The problem is happening here:
https://github.com/MarquezProject/marquez/blob/main/web/setupProxy.js#L6

So first question is why http protocol is hardcoded here.

I made marquez web to work forking the code and creating my own image:

const apiOptions = {
  target: `https://${process.env.MARQUEZ_HOST}/`,
  secure: false,
  changeOrigin: true,
  headers: {
    "Connection": "keep-alive"
  }
}

I based my patch from this post:
chimurai/http-proxy-middleware#171

@wslulciuc wslulciuc added the bug Something isn't working label Mar 31, 2022
@wslulciuc wslulciuc added this to the Roadmap milestone Mar 31, 2022
@wslulciuc
Copy link
Member

wslulciuc commented Mar 31, 2022

@dvirgiln: Yeah, good point. The proxy server configuration assumes ssl termination at the ELB level (i.e. calls from the UI are made within the same VPC, thus not requiring ssl), but that's not always the case. I've added this issue to our roadmap to allow users to enable/disable ssl.

@phixMe
Copy link
Member

phixMe commented Jan 30, 2024

I wouldn't be opposed to crafting a separate docker image for a more production like deploy with an nginx server for this kind of purpose. Maybe worth making an issue for this.

@andyfase
Copy link

Just adding to this. I honestly think the change needed is as simple as

const apiOptions = {
  target: `${process.env.MARQUEZ_PROTO ?? "http"}://${process.env.MARQUEZ_HOST}:${process.env.MARQUEZ_PORT}/`,
  changeOrigin: process.env.PROXY_CHANGE_ORIGIN?.toLowerCase()  === "true"
}

This remains default behaviour and allows for:

  1. HTTPS proxying via optional MARQUEZ_PROTO env
  2. Setting the correct HOST header when proxying to the API (when the API and Web are on different domains) via optional PROXY_CHANGE_ORIGIN env

Usage

docker run -p 3000:3000 -e MARQUEZ_HOST="marquez-api.foo.com" -e MARQUEZ_PORT="443" -e MARQUEZ_PROTO="https"  -e PROXY_CHANGE_ORIGIN="true" marquez-web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Todo
Development

No branches or pull requests

4 participants