Cingulara / openrmf-docs

Documentation on the OpenRMF application, including scripts to run the whole stack as well as just infrastructure with documentation on using the tool.
https://www.openrmf.io/
GNU General Public License v3.0
125 stars 26 forks source link

Dashboard errors [BUG] #312

Closed qu4n closed 1 year ago

qu4n commented 1 year ago

Describe the bug Upon initial loading, the Dashboard shows "error" message for the on the system packages, checklists, and templates buttons. See screenshot with js console errors shown:

image

Expanding these showed keycloak errors:

image

image

image

image

When clicking on the "System Packages" button on the Dashboard page, the following errors are displayed:

image

The "Checklists" button on the Dashboard page is inactive (not clickable).

Clicking on the "Templates" button produced the following js errors:

image

Currently not able to upload packages.

To Reproduce Steps to reproduce the behavior:

  1. Currently running Docker Desktop 4.19.0 and Ubuntu 22.04 LTS under Windows 11 Pro WSL2 (See config below):

    image

  2. Followed step-by-step instructions. Note that the startup script was executed within Ubuntu terminal.

Expected behavior

The Dashboard should not have any errors and there should be capability to upload packages.

Screenshots

Applicable screenshots provided above.

Desktop (please complete the following information):

Smartphone (please complete the following information):

N/A

Additional context

Docker Desktop shows all 27 containers are running.

Since there were keycloak errors, I inspected the logs and grepped the following errors:

2023-05-15 23:19:25 mongodb-report                          | {"t":{"$date":"2023-05-16T03:19:25.873+00:00"},"s":"I",  "c":"CONTROL",  "id":20712,   "ctx":"LogicalSessionCacheReap","msg":"Sessions collection is not set up; waiting until next sessions reap interval","attr":{"error":"NamespaceNotFound: config.system.sessions does not exist"}}
2023-05-15 23:19:27 mongodb-report                          | {"t":{"$date":"2023-05-16T03:19:27.839+00:00"},"s":"I",  "c":"CONTROL",  "id":23377,   "ctx":"SignalHandler","msg":"Received signal","attr":{"signal":15,"error":"Terminated"}}
2023-05-15 23:19:24 mongodb-audit                           | {"t":{"$date":"2023-05-16T03:19:24.491+00:00"},"s":"I",  "c":"CONTROL",  "id":20712,   "ctx":"LogicalSessionCacheReap","msg":"Sessions collection is not set up; waiting until next sessions reap interval","attr":{"error":"NamespaceNotFound: config.system.sessions does not exist"}}
2023-05-15 23:19:25 mongodb-audit                           | {"t":{"$date":"2023-05-16T03:19:25.401+00:00"},"s":"I",  "c":"CONTROL",  "id":23377,   "ctx":"SignalHandler","msg":"Received signal","attr":{"signal":15,"error":"Terminated"}}
2023-05-15 23:19:24 mongodb-checklist                       | {"t":{"$date":"2023-05-16T03:19:24.174+00:00"},"s":"I",  "c":"CONTROL",  "id":20712,   "ctx":"LogicalSessionCacheReap","msg":"Sessions collection is not set up; waiting until next sessions reap interval","attr":{"error":"NamespaceNotFound: config.system.sessions does not exist"}}
2023-05-15 23:19:25 mongodb-checklist                       | {"t":{"$date":"2023-05-16T03:19:25.144+00:00"},"s":"I",  "c":"CONTROL",  "id":23377,   "ctx":"SignalHandler","msg":"Received signal","attr":{"signal":15,"error":"Terminated"}}
2023-05-15 23:24:12 openrmf-web                             | 2023/05/16 03:24:12 [error] 29#29: *34 open() "/usr/share/nginx/html/favicon.ico" failed (2: No such file or directory), client: REDACTED_IP3, server: , request: "GET /favicon.ico HTTP/1.1", host: "REDACTED_IP1:8080"
2023-05-15 23:19:24 mongodb-template                        | {"t":{"$date":"2023-05-16T03:19:24.628+00:00"},"s":"I",  "c":"CONTROL",  "id":20712,   "ctx":"LogicalSessionCacheReap","msg":"Sessions collection is not set up; waiting until next sessions reap interval","attr":{"error":"NamespaceNotFound: config.system.sessions does not exist"}}
2023-05-15 23:19:25 mongodb-template                        | {"t":{"$date":"2023-05-16T03:19:25.523+00:00"},"s":"I",  "c":"CONTROL",  "id":23377,   "ctx":"SignalHandler","msg":"Received signal","attr":{"signal":15,"error":"Terminated"}}
2023-05-15 23:32:41 grafana                                 | logger=context traceID=00000000000000000000000000000000 userId=0 orgId=0 uname= t=2023-05-16T03:32:41.92+0000 lvl=eror msg="Invalid username or password" error="user not found" remote_addr=REDACTED_IP2 traceID=00000000000000000000000000000000
2023-05-15 23:34:34 grafana                                 | logger=sqlstore t=2023-05-16T03:34:34.23+0000 lvl=info msg="Database locked, sleeping then retrying" error="database is locked" retry=0
2023-05-15 23:37:29 openrmf-keycloak                        | 2023-05-16 03:37:29,375 WARN  [org.keycloak.events] (executor-thread-21) type=LOGIN_ERROR, realmId=e1edef6b-82a8-4f26-a42e-69480a261298, clientId=openrmf, userId=null, ipAddress=REDACTED_IP3, error=user_not_found, auth_method=openid-connect, auth_type=code, redirect_uri=http://REDACTED_IP1:8080/index.html, code_id=2fc1bfab-9d7a-4e4b-8ac3-470122e46e88, username=admin, authSessionParentId=2fc1bfab-9d7a-4e4b-8ac3-470122e46e88, authSessionTabId=vP8l3_Cuuns
2023-05-15 23:42:45 openrmf-keycloak                        | 2023-05-16 03:42:45,352 WARN  [org.keycloak.events] (executor-thread-23) type=LOGIN_ERROR, realmId=e1edef6b-82a8-4f26-a42e-69480a261298, clientId=openrmf, userId=null, ipAddress=REDACTED_IP3, error=invalid_redirect_uri, redirect_uri=http://localhost:8080/
2023-05-15 23:19:24 mongodb-score                           | {"t":{"$date":"2023-05-16T03:19:24.924+00:00"},"s":"I",  "c":"CONTROL",  "id":20712,   "ctx":"LogicalSessionCacheReap","msg":"Sessions collection is not set up; waiting until next sessions reap interval","attr":{"error":"NamespaceNotFound: config.system.sessions does not exist"}}
2023-05-15 23:19:25 mongodb-score                           | {"t":{"$date":"2023-05-16T03:19:25.923+00:00"},"s":"I",  "c":"CONTROL",  "id":23377,   "ctx":"SignalHandler","msg":"Received signal","attr":{"signal":15,"error":"Terminated"}}

Note that I redacted 3 unique IPs.

I am also running the latest scripts from OpenRMF-OSS-v1.9.zip file.

DaleBinghamSoteriaSoft commented 1 year ago

Usually when we see this, there are a few things that cause it we ask people to check.

Normally one of those is causing the forbidden access. The "admin" type user you create with the Keycloak script usually has the proper role. So if you are using that user to log in, it may be one of the others.

Also, the URL to access OpenRMF OSS, the URL for the JWT Authority (plus auth/realms/openrmf at the end), and the Valid Redirect URI in Keycloak (plus the /* at the end) have to all be the same. And be a valid IP or DNS and not localhost or 127.0.0.1 type of entries. Keycloak creates the JWT for you, it is passed back to the web interface, and then that is used in API calls. The APIs validate the JWT token and authority as well for security. So all those URLs/DNS/IPs have to be the same for those 3 things to login successfully as well.

qu4n commented 1 year ago

@DaleBinghamSoteriaSoft,

Thank you for the quick reply. After going through it multiple times based on your recommendation, I finally figured out what the problem was. I noticed that in your step-by-step instructions, you mentioned:

We tell folks to click the "+ Add valid redirect URIs" button underneath each so they are set correctly. Then scroll down to click the Save button and you are good here.

I really didn't know what that meant, but what I had done previously was just typed in the URIs. I did not clicked on the "+ Add valid redirect URIs" button underneath each one. I guess just having typed it in doesn't set it until that is done. Now after logging in, I don't get anymore errors and am able to see the add package buttons. This issue is now resolved:

image

Thanks again for the help!

DaleBinghamSoteriaSoft commented 1 year ago

@qu4n that is excellent news. Thanks for sharing here so others can see as well.