seriohub / velero-helm

Helm charts for velero-ui, velero-api, and velero-watchdog
14 stars 6 forks source link

Error on loading dashboard page #18

Closed mg-i-alf-dan closed 4 months ago

mg-i-alf-dan commented 4 months ago

Hi all, i stay test this software, but i have a problem, when i land on dashboard page i get this error:

Service method
'data' - file name: stats_service.py - fn name: stats - line: 110

and the second error i get, is when i go on schedule page, i get this error:

Run Process Check Output Error
Error

i have tried to call the API with curl for test the APIs that this two pages use for retrive data.. but i get the same errors, someone can help me with this?

davideserio commented 4 months ago

Hi, What does the diagnostic information on the login page show?

mg-i-alf-dan commented 4 months ago

Screenshot_2024-05-15_10-41-10

mg-i-alf-dan commented 4 months ago

i have already tried to substitute the Origin with "*" as the interface suggests, but the issue persist

davideserio commented 4 months ago

Which version of velero client and velero server are in use? Do the other pages, besides the dashboard, work?

mg-i-alf-dan commented 4 months ago

Client: 1.13.0 Server: 1.13.1

Yes besides the dashboard and the schedules page, others pages works well

nickveldrin commented 4 months ago

edit I just realized the API requires auth to view objects, and auth wont pass if you use a browser. But the below part is still true.

On the "Response" part of the debug, i am showing a red error 400 on the pages with no data, while it's green 200 on the backup-location page that has data.

That stats api page mentioned by the OP is also showing red 400. velero 2024-05-15 053811

davideserio commented 4 months ago

OK,

As mentioned in the README file, the project is currently running on clusters with version 12. We will be upgrading to version 13 shortly. There might be an update in the Velero client output JSON format. If anyone has the chance, please send me the output of the following commands so I can check for any differences with version 12 (please remove any sensitive information, even just a single scheduling and repository item would be sufficient):

velero schedule get -o json -n <your-velero-namespace>

and

velero repo get -o json -n <your-velero-namespace>

I can then see if it's a formatting issue.

mg-i-alf-dan commented 4 months ago

velero schedule get -o json -n "namespace" result.json

davideserio commented 4 months ago

The output JSON format is the same. I did a other quick test, for version 13 you may need a cluster role update (current cluster-role), the following should work:

mg-i-alf-dan commented 4 months ago

ok i have patched the cluster role, now, Repositories page work,

Dashboard page give this error:

Service method
'data' - file name: stats_service.py - fn name: stats - line: 110

Schedules page give this error

Service method
'items' - file name: schedule_service.py - fn name: get - line: 23
davideserio commented 4 months ago

Hi, I deployed on a cluster with velero version 13.2 with the patch and it works. Can you verify that the patch was successful?

kubectl get clusterrole vui-mgmt-cluster-role -o json

It shouldn't need to but can you try restarting the pod API as well?

mg-i-alf-dan commented 4 months ago

I reinstalled everything from scratch, and applied the patch, from the api pod logs I still get the code 400, I installed velero 1.13.2, to be the same as your implementation, I attach images, i can confirm that the clusterrole is correctly patched and i restart the deploy of all component of velero-ui.

Screenshot_2024-05-15_16-05-30

Screenshot_2024-05-15_16-05-53

Screenshot_2024-05-15_16-06-54

mg-i-alf-dan commented 4 months ago

This is the actual status of cluster role

{
    "apiVersion": "rbac.authorization.k8s.io/v1",
    "kind": "ClusterRole",
    "metadata": {
        "annotations": {
            "meta.helm.sh/release-name": "vui",
            "meta.helm.sh/release-namespace": "velero"
        },
        "creationTimestamp": "2024-05-15T14:04:06Z",
        "labels": {
            "app.kubernetes.io/instance": "vui",
            "app.kubernetes.io/managed-by": "Helm",
            "app.kubernetes.io/name": "vui",
            "app.kubernetes.io/version": "0.1.7",
            "helm.sh/chart": "vui-0.1.7"
        },
        "name": "vui-mgmt-cluster-role",
        "resourceVersion": "148013842",
        "uid": "9f71cbc8-22cf-4e6f-b91f-e5fd031b7eb1"
    },
    "rules": [
        {
            "apiGroups": [
                ""
            ],
            "resources": [
                "namespaces"
            ],
            "verbs": [
                "get",
                "list"
            ]
        },
        {
            "apiGroups": [
                "storage.k8s.io"
            ],
            "resources": [
                "storageclasses"
            ],
            "verbs": [
                "list"
            ]
        },
        {
            "apiGroups": [
                ""
            ],
            "resources": [
                "nodes"
            ],
            "verbs": [
                "get",
                "watch",
                "list"
            ]
        },
        {
            "apiGroups": [
                "velero.io"
            ],
            "resources": [
                "*"
            ],
            "verbs": [
                "*"
            ]
        }
    ]
}
davideserio commented 4 months ago

Could you please try running these commands from within the API pod bash and let me know if they are successful?

velero schedule get -o json
velero repo get -o json

Please verify that the first line is respectively

and

mg-i-alf-dan commented 4 months ago

My result is:

and

mg-i-alf-dan commented 4 months ago

Your comment gave me an idea and I did a test, and it works, but if there is only one schedule in the schedule, it doesn't create the overlying object (ScheduleList) so the UI doesn't find the object, it should be fixed on the ui, I think it also applies to backup and repo,

Thanks for your help

nickveldrin commented 4 months ago

For me, the clusterrole was "velero-ui-vui-mgmt-cluster-role", and when i applied the patch from above, it fixed all my dashboard issues.