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

Report expected location of registry backend in UI #5388

Open
pwright opened this issue Oct 23, 2024 · 7 comments
Open

Report expected location of registry backend in UI #5388

pwright opened this issue Oct 23, 2024 · 7 comments

Comments

@pwright
Copy link
Contributor

pwright commented Oct 23, 2024

Feature or Problem Description

With v3, there is the possibility of users not configuring the UI correctly and getting message:

Connection to the Registry server failed (could not reach the server). Please check your connection and try again, or report this error to an admin.

When clicking help, this modal is displayed:
image

Proposed Solution

On one of the screens, show the user the current configuration, ie where the UI expects to connect to, eg localhost:8080

$ more /opt/app-root/src/config.js

const ApicurioRegistryConfig = {
    "artifacts": {
        "url": "http://localhost:8080/apis/registry/v3"
    },
    "ui": {},
    "auth": {},
    "features": {}
};

Additional Context

@apicurio-bot
Copy link

apicurio-bot bot commented Oct 23, 2024

Thank you for reporting an issue!

Pinging @EricWittmann to respond or triage.

@apicurio-bot apicurio-bot bot added the area/ui label Oct 23, 2024
@EricWittmann EricWittmann moved this to Backlog in Registry 3.0 Oct 24, 2024
@EricWittmann EricWittmann added this to the 3.0.4 milestone Oct 24, 2024
@EricWittmann EricWittmann self-assigned this Nov 5, 2024
@EricWittmann EricWittmann modified the milestones: 3.0.4, 3.0.5 Nov 5, 2024
@EricWittmann EricWittmann modified the milestones: 3.0.5, 3.0.6 Dec 3, 2024
@simonepm
Copy link

simonepm commented Dec 4, 2024

Hello,

even if the endpoint is reachable (see curl) and the configured endpoint matches, I still receive:

"Connection to the Registry server failed (could not reach the server). Please check your connection and try again, or report this error to an admin."

image

image

What am I missing?

Thanks!

@EricWittmann EricWittmann modified the milestones: 3.0.6, 3.0.7 Dec 13, 2024
@devops-42
Copy link

devops-42 commented Jan 23, 2025

@simonepm Have same issue with Kubernetes deployments. When looking into the browser's inspector I saw, that the UI pod requests the browser to directly call the configured Kubernetes internal service URL, which fails of course. Maybe there's a config parameter where URL rewriting / proxying can be configured, but didn't found it in the documentation yet.

@EricWittmann Do you have any additional links or information? Thanks a lot in advance!

Used versions:

  • apicurio-registry: 3.0.6
  • apicurio-registry-ui: 3.0.6

@EricWittmann
Copy link
Member

even if the endpoint is reachable (see curl) and the configured endpoint matches, I still receive:

"Connection to the Registry server failed (could not reach the server). Please check your connection and try again, or report this error to an admin."

What am I missing?

Ack, I didn't see this until today! Sorry about that.

Typically if you can reach the API via curl but not in the UI then you have a CORS issue. You'll need to configure QUARKUS_HTTP_CORS_ORIGINS in the app deployment/pod to allow connections from the UI. You can either set the value to * or to the scheme://host of your UI.

I would recommend starting with * to see if that works (very permissive). If it does, then you could try setting it to the specific external URL of your UI (e.g. the ingress host) and see if you can get it working that way.

@EricWittmann
Copy link
Member

EricWittmann commented Jan 23, 2025

@simonepm Have same issue with Kubernetes deployments. When looking into the browser's inspector I saw, that the UI pod requests the browser to directly call the configured Kubernetes internal service URL, which fails of course. Maybe there's a config parameter where URL rewriting / proxying can be configured, but didn't found it in the documentation yet.

@EricWittmann Do you have any additional links or information? Thanks a lot in advance!

Used versions:

* `apicurio-registry: 3.0.6`

* `apicurio-registry-ui: 3.0.6`

In this case you need to configure the UI to know where to find the API. This is done by configuring the UI pod/deployment using this env var:

REGISTRY_API_URL

Set that to the external URL of your registry-api service.

Reference: https://github.com/Apicurio/apicurio-registry/blob/main/ui/.docker-scripts/create-config.cjs#L9

If you look at the config.js file that is loaded by the UI, you can see where it's getting that from.

@devops-42
Copy link

devops-42 commented Jan 23, 2025

@simonepm Have same issue with Kubernetes deployments. When looking into the browser's inspector I saw, that the UI pod requests the browser to directly call the configured Kubernetes internal service URL, which fails of course. Maybe there's a config parameter where URL rewriting / proxying can be configured, but didn't found it in the documentation yet.
@EricWittmann Do you have any additional links or information? Thanks a lot in advance!
Used versions:

* `apicurio-registry: 3.0.6`

* `apicurio-registry-ui: 3.0.6`

In this case you need to configure the UI to know where to find the API. This is done by configuring the UI pod/deployment using this env var:

REGISTRY_API_URL

Set that to the external URL of your registry-api service.

Reference: https://github.com/Apicurio/apicurio-registry/blob/main/ui/.docker-scripts/create-config.cjs#L9

If you look at the config.js file that is loaded by the UI, you can see where it's getting that from.

@EricWittmann Thanks for your response!

What I did: Have deployed the apicurio-registry in Kubernetes and created a service for accessing the API. Then I deployed the UI pod and configured the REGISTRY_API_URL pointing to the service name and port (apicurio-registry:8080). For accessing the UI I created an ingress resource pointing to the service of the UI.

What I've seen so far: Calling the URL of the UI ingress brings the same output as @simonepm has shown. When I open the network inspector console of the browser I saw, that the browser tries the URL apicurio-registry:8080 which is impossible from outside the Kubernetes cluster.
I created a second setup where I run the apicurio-registry locally on port 8080 and configured the REGISTRY_API_URL with localhost:8080. This worked so far, but this might not be the target deployment setup.

Maybe I miss something here and would appreciate any help!

Thanks!

/edit/
I've seen you mentioned the external URL, so I'd need here to expose the Apicurio API Url to the public even if it's only needed from inside the cluster?

@devops-42
Copy link

QUARKUS_HTTP_CORS_ORIGINS

@EricWittmann Have already played around with this parameter with no effect. I guess if I'd setup a public resolvable API-URL and set the CORS header accordingly, it'll work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Backlog
Development

No branches or pull requests

4 participants