spiffe / tornjak

Tornjak is a UI and management layer used for brokering human access to one or more SPIRE deployments
Apache License 2.0
78 stars 41 forks source link

[bug] Manager UI Error messages upon startup #515

Open maia-iyer opened 3 weeks ago

maia-iyer commented 3 weeks ago

Environment:

I deployed Tornjak backend in a local Kind cluster and the Tornjak manager backend is running locally at port 50000 Then I ran:

cd frontend
REACT_APP_API_SERVER_URI=http://localhost:50000/ REACT_APP_TORNJAK_MANAGER=true npm start

To start the frontend with the manager UI.

Error

I notice the home page for the manager is the Agents list page. When I go to any page other than the Manage Servers page, I get this in the heading:

image

Particularly, this error message does not come from the backend (there are no calls to the backend), which means there's somewhere in the frontend is assuming error code.

Potential suggestions

  1. Immediate fix is to find where this error message is coming from and remove it
  2. I think it might also make sense to have the Manage Servers page be the home page for the manager? a. Perhaps it might even make sense to add a hierarchical level between the pages? For example, the Manage Servers page is a higher level than the other pages that are specific to one server. Maybe a sidebar menu or something like that. I recognize this is a bigger ask, so we can open a separate issue if we decide to do this at some point - just wanted to raise the idea
cstecc commented 1 week ago

can I be assigned to this issue?

mamy-CS commented 1 week ago

/assign @cstecc

cstecc commented 1 day ago

I also used a kind cluster locally and did not get this message. this text also doesn't seem to exist anywhere within the files did someone already resolve this issue?

maia-iyer commented 1 day ago

I still do see some bug - Ideal behavior means that upon seeing the home page of the UI, there would be no error, but there seems to be some error. Perhaps recent development has changed the error. Here's what I see now:

image

There ideally shouldn't be any error, and a backend shouldn't be called.

Additional investigation shows that upon inspection of the network (at the bottom of the screenshot), there's a call to localhost:10000 to list. When I clicked on it, it seems to be making a call to http://localhost:10000/manager-api/server/list

This is problematic: The manager API is run at localhost:50000, so the localhost:10000 should not be known to the UI. I ran the manager UI using:

REACT_APP_API_SERVER_URI=http://localhost:50000/
REACT_APP_TORNJAK_MANAGER=true npm start

So some API call is not currently being constructed right

maia-iyer commented 1 day ago

This is a slightly different issue though, so @cstecc I might close this issue in favor of opening a new one. Would you be interested in working on this bug?

cstecc commented 3 hours ago

Yes ill work on this thank you!