Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

First install only seeing a 404 page and DEBU[0002] Strange: no context found for '' #518

Open
deiga opened this issue Mar 6, 2024 · 4 comments

Comments

@deiga
Copy link

deiga commented Mar 6, 2024

Description

I've just installed the plugin and wanted to try it out. But when I run helm dashboard I get a 404 page.

I've checked that kubectl config current-context has a correct context set and I've tried to start dashboard with helm --kube-context foo dashboard, but to no avail.

$ helm dashboard --verbose

helm dashboard --verbose
DEBU[0000] Debug logging is enabled
INFO[0000] Helm Dashboard by Komodor, version 1.3.3 (b61adf133f639b8bffd43925b5b4b8230c197a26 @ 2023-06-22T08:59:05Z)
DEBU[0000] Starting command: [checkov --version]
DEBU[0000] Got latest version from GH: v1.3.3
DEBU[0001] Command STDOUT:
3.2.32
DEBU[0001] Command STDERR:
INFO[0001] Discovered Checkov version: 3.2.32
DEBU[0001] Starting command: [trivy --version]
DEBU[0002] Command STDOUT:
Version: 0.49.1
Policy Bundle:
  Digest: sha256:cdff1bc8c97e4f5cd04782b057c00f5ea8cd81147a506ac4be76bef13710f2d3
  DownloadedAt: 2024-03-06 11:27:31.176959 +0000 UTC
DEBU[0002] Command STDERR:
INFO[0002] Discovered Trivy: Version: 0.49.1
[GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production.
 - using env:	export GIN_MODE=release
 - using code:	gin.SetMode(gin.ReleaseMode)

[GIN-debug] GET    /                         --> github.com/komodorio/helm-dashboard/pkg/dashboard.configureStatic.func3 (5 handlers)
[GIN-debug] GET    /static/*filepath         --> github.com/komodorio/helm-dashboard/pkg/dashboard.configureStatic.func4 (5 handlers)
[GIN-debug] DELETE /                         --> github.com/komodorio/helm-dashboard/pkg/dashboard.configureRoutes.func1 (5 handlers)
[GIN-debug] GET    /status                   --> github.com/komodorio/helm-dashboard/pkg/dashboard.configureRoutes.func2 (5 handlers)
[GIN-debug] GET    /api/cache                --> github.com/komodorio/helm-dashboard/pkg/dashboard.configureRoutes.func3 (5 handlers)
[GIN-debug] DELETE /api/cache                --> github.com/komodorio/helm-dashboard/pkg/dashboard.configureRoutes.func4 (5 handlers)
[GIN-debug] POST   /diff                     --> github.com/komodorio/helm-dashboard/pkg/dashboard.configureRoutes.func5 (5 handlers)
[GIN-debug] GET    /api-docs                 --> github.com/komodorio/helm-dashboard/pkg/dashboard.configureRoutes.func6 (5 handlers)
[GIN-debug] GET    /api/helm/releases        --> github.com/komodorio/helm-dashboard/pkg/dashboard/handlers.(*HelmHandler).GetReleases-fm (5 handlers)
[GIN-debug] POST   /api/helm/releases/:ns    --> github.com/komodorio/helm-dashboard/pkg/dashboard/handlers.(*HelmHandler).Install-fm (5 handlers)
[GIN-debug] POST   /api/helm/releases/:ns/:name --> github.com/komodorio/helm-dashboard/pkg/dashboard/handlers.(*HelmHandler).Upgrade-fm (5 handlers)
[GIN-debug] DELETE /api/helm/releases/:ns/:name --> github.com/komodorio/helm-dashboard/pkg/dashboard/handlers.(*HelmHandler).Uninstall-fm (5 handlers)
[GIN-debug] GET    /api/helm/releases/:ns/:name/history --> github.com/komodorio/helm-dashboard/pkg/dashboard/handlers.(*HelmHandler).History-fm (5 handlers)
[GIN-debug] GET    /api/helm/releases/:ns/:name/:section --> github.com/komodorio/helm-dashboard/pkg/dashboard/handlers.(*HelmHandler).GetInfoSection-fm (5 handlers)
[GIN-debug] GET    /api/helm/releases/:ns/:name/resources --> github.com/komodorio/helm-dashboard/pkg/dashboard/handlers.(*HelmHandler).Resources-fm (5 handlers)
[GIN-debug] POST   /api/helm/releases/:ns/:name/rollback --> github.com/komodorio/helm-dashboard/pkg/dashboard/handlers.(*HelmHandler).Rollback-fm (5 handlers)
[GIN-debug] POST   /api/helm/releases/:ns/:name/test --> github.com/komodorio/helm-dashboard/pkg/dashboard/handlers.(*HelmHandler).RunTests-fm (5 handlers)
[GIN-debug] GET    /api/helm/repositories    --> github.com/komodorio/helm-dashboard/pkg/dashboard/handlers.(*HelmHandler).RepoList-fm (5 handlers)
[GIN-debug] POST   /api/helm/repositories    --> github.com/komodorio/helm-dashboard/pkg/dashboard/handlers.(*HelmHandler).RepoAdd-fm (5 handlers)
[GIN-debug] GET    /api/helm/repositories/:name --> github.com/komodorio/helm-dashboard/pkg/dashboard/handlers.(*HelmHandler).RepoCharts-fm (5 handlers)
[GIN-debug] POST   /api/helm/repositories/:name --> github.com/komodorio/helm-dashboard/pkg/dashboard/handlers.(*HelmHandler).RepoUpdate-fm (5 handlers)
[GIN-debug] DELETE /api/helm/repositories/:name --> github.com/komodorio/helm-dashboard/pkg/dashboard/handlers.(*HelmHandler).RepoDelete-fm (5 handlers)
[GIN-debug] GET    /api/helm/repositories/latestver --> github.com/komodorio/helm-dashboard/pkg/dashboard/handlers.(*HelmHandler).RepoLatestVer-fm (5 handlers)
[GIN-debug] GET    /api/helm/repositories/versions --> github.com/komodorio/helm-dashboard/pkg/dashboard/handlers.(*HelmHandler).RepoVersions-fm (5 handlers)
[GIN-debug] GET    /api/helm/repositories/values --> github.com/komodorio/helm-dashboard/pkg/dashboard/handlers.(*HelmHandler).RepoValues-fm (5 handlers)
[GIN-debug] GET    /api/k8s/contexts         --> github.com/komodorio/helm-dashboard/pkg/dashboard/handlers.(*KubeHandler).GetContexts-fm (5 handlers)
[GIN-debug] GET    /api/k8s/:kind/get        --> github.com/komodorio/helm-dashboard/pkg/dashboard/handlers.(*KubeHandler).GetResourceInfo-fm (5 handlers)
[GIN-debug] GET    /api/k8s/:kind/describe   --> github.com/komodorio/helm-dashboard/pkg/dashboard/handlers.(*KubeHandler).Describe-fm (5 handlers)
[GIN-debug] GET    /api/k8s/:kind/list       --> github.com/komodorio/helm-dashboard/pkg/dashboard/handlers.(*KubeHandler).GetNameSpaces-fm (5 handlers)
[GIN-debug] GET    /api/scanners             --> github.com/komodorio/helm-dashboard/pkg/dashboard/handlers.(*ScannersHandler).List-fm (5 handlers)
[GIN-debug] POST   /api/scanners/manifests   --> github.com/komodorio/helm-dashboard/pkg/dashboard/handlers.(*ScannersHandler).ScanManifest-fm (5 handlers)
[GIN-debug] GET    /api/scanners/resource/:kind --> github.com/komodorio/helm-dashboard/pkg/dashboard/handlers.(*ScannersHandler).ScanResource-fm (5 handlers)
INFO[0002] User analytics is collected to improve the quality, disable it with --no-analytics
INFO[0002] Opening web UI: http://localhost:8080
DEBU[0002] Strange: no context found for ''
INFO[0002] Updating repository: bitnami

$ kubectl version

Client Version: version.Info{Major:"1", Minor:"26", GitVersion:"v1.26.10", GitCommit:"b8609d4dd75c5d6fba4a5eaa63a5507cb39a6e99", GitTreeState:"clean", BuildDate:"2023-10-18T11:44:31Z", GoVersion:"go1.20.10", Compiler:"gc", Platform:"darwin/arm64"}
Kustomize Version: v4.5.7
Server Version: version.Info{Major:"1", Minor:"25+", GitVersion:"v1.25.16-eks-77b1e4e", GitCommit:"c39acac7636499dd73442b62e11951592aedd1f8", GitTreeState:"clean", BuildDate:"2024-01-13T01:51:36Z", GoVersion:"go1.20.10", Compiler:"gc", Platform:"linux/amd64"}

$ helm version

version.BuildInfo{Version:"v3.13.3", GitCommit:"c8b948945e52abba22ff885446a1486cb5fd3474", GitTreeState:"clean", GoVersion:"go1.20.11"}

Screenshots

No response

Additional information

No response

@undera
Copy link
Collaborator

undera commented Mar 6, 2024

The debug message of Strange: no context for '' is a part of normal loading, so ignore it.

The normal session would produce logs from GIN about any attempt to access it. Like this:

undera@undera-primary:/tmp/downloads$ helm dashboard
INFO[0000] Helm Dashboard by Komodor, version 1.3.3 (b61adf133f639b8bffd43925b5b4b8230c197a26 @ 2023-06-22T08:59:05Z) 
INFO[0002] Discovered Checkov version: 2.3.294          
INFO[0002] User analytics is collected to improve the quality, disable it with --no-analytics 
INFO[0002] Opening web UI: http://localhost:8080        
INFO[0002] Updating repository: crossplane              
Opening in existing browser session.
[GIN] 2024/03/06 - 18:39:36 | 200 |    5.697657ms |       127.0.0.1 | GET      "/"
...

Even 404 would be reflected like this:

[GIN] 2024/03/06 - 18:40:27 | 404 |        7.05µs |       127.0.0.1 | GET      "/boo"
[GIN] 2024/03/06 - 18:40:27 | 404 |       5.229µs |       127.0.0.1 | GET      "/favicon.ico"

So it looks like your browser hits some other service or proxy instead of local dashboard. Please check that you don't have a proxy preventing you to access local sites.

@alessandrodetta
Copy link
Contributor

alessandrodetta commented Mar 7, 2024

I can also observe this kind of error when I execute as plugin directly inside the root folder of the project. I still don't know why though or if it is even a proof of something 😞 Executing helm dashboard on any other folder works to me

@undera
Copy link
Collaborator

undera commented Mar 7, 2024

@alessandrodetta What you see can be explained by this section in old code: https://github.com/komodorio/helm-dashboard/blob/v1.3.3/pkg/dashboard/api.go#L169 . However, it would produce explicit warning in log.

@alessandrodetta
Copy link
Contributor

alessandrodetta commented Mar 8, 2024

Oh now I see, that's why. I guess that's not the same problem then because there is no warning in his log as mine (i.e time="2024-03-08T15:31:30+01:00" level=warning msg="Using local development path to serve static files"). I actually have an empty static folder.

However, it seems that activating verbosity (--verbose) as he did doesn't produce the log to endpoints calls from GIN
@undera Can you confirm this problem ? Or maybe they are written on a file somewhere else?

@deiga Can you try to execute just helm dashboard and see if in the log you get the call to endpoints (e.g GET "/" 404)? If still nothing gets reflected, maybe it is really something like a proxy/service intercepting the request.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants