klustair / klustair-frontend

Frontend to Klustair scanner and Anchore
7 stars 2 forks source link

Frontend error using helm chart to deploy #9

Closed hugodopradofernandes closed 3 years ago

hugodopradofernandes commented 4 years ago

Illuminate\Database\QueryException SQLSTATE[42P01]: Undefined table: 7 ERROR: relation "k_reports" does not exist LINE 1: select count(distinct "uid") as aggregate from "k_reports" ^ (SQL: select count(distinct "uid") as aggregate from "k_reports")

Illuminate\Database\Connection::runQueryCallback vendor/laravel/framework/src/Illuminate/Database/Connection.php:671

I shared also here: https://flareapp.io/share/VP6K1V07

It happens once I port forward and open the Frontend. Have never worked. I hope the details provided help!

mms-gianni commented 3 years ago

Thank you for opening my very first issue here on github :D

Did you ran the migrations inside your container?

php artisan migrate

There is a refactored version of the helm chart on going which are addressing this issue with a initContainer.

https://github.com/klustair/klustair-helm/blob/refactoring/templates/frontend-deployment.yaml#L30

hugodopradofernandes commented 3 years ago

I'll try that soon and post here the result :)

hugodopradofernandes commented 3 years ago

New error using the Helm package klustair-0.1.0.tgz (Refactoring)

$ helm install klustair ./klustair-0.1.0.tgz -n klustair Error: template: klustair/templates/cronjob.yaml:35:33: executing "klustair/templates/cronjob.yaml" at <.Values.postpostgresqlgres.postgresqlUsername>: nil pointer evaluating interface {}.postgresqlUsername

Line 35 of cronjob.yaml has a wrong string:

            value: {{ .Values.postpostgresqlgres.postgresqlUsername | quote}}

Should be:

            value: {{ .Values.postgresql.postgresqlUsername | quote}}

But even fixing that I was facing a lot of yaml identation issues on helm also from cronjob.yaml . I tried to fix it, without luck.

mms-gianni commented 3 years ago

You are right. This is a copy/paste error I made. Sorry. I just fixed it in the refactoring branch.

I cant reproduce this error currently. $ helm template .

rendered the template as expected.

mms-gianni commented 3 years ago

I found several intend errors in the cronjob.yaml. They are fixed now in the new "main" branch.

hugodopradofernandes commented 3 years ago

I was now able to sucessfull deploy the chart and the frontend is working. I'm now going to install the anchore engine to test the full tool, but we can close this issue for now Thanks!

https://i.imgur.com/hEyOA0s.png

mms-gianni commented 3 years ago

you're welcome

Let me know if you have any other issues. I actually make a lot of changes in every 3 projects.

BTW: A Anchore installation is not necessary anymore if you scan your images with the included trivy scanner.