vmware-tanzu / cloud-suitability-analyzer

Automated, rule based source code scanning to determine cloud suitability
Other
79 stars 34 forks source link

Postgres support #167

Closed devsprint closed 8 months ago

devsprint commented 8 months ago

I looks like Postgres support is broken. I have tried PG 12, 14.5 and 16. During the initial import of the rules the process stops with error:

CSA: 4.1.12 DBEngine: postgres-PostgreSQL 12.18 (Debian 12.18-1.pgdg120+2) on aarch64-unknown-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit  DBName: postgres
Found No Rule files for import @ [./rules]
Loading rules from Bootstap...

(/Users/XXXX/cloud-suitability-analyzer/csa-app/db/rule_repository.go:83)
[2024-03-11 10:49:19]  pq: invalid input syntax for type integer: "false"

(/Users/XXXX/cloud-suitability-analyzer/csa-app/db/rule_repository.go:83)
[2024-03-11 10:49:19]  pq: invalid input syntax for type integer: "false"

(/Users/XXXX/cloud-suitability-analyzer/csa-app/db/rule_repository.go:83)
[2024-03-11 10:49:19]  pq: invalid input syntax for type integer: "false"

(/Users/XXXX/cloud-suitability-analyzer/csa-app/db/rule_repository.go:83)
[2024-03-11 10:49:19]  pq: invalid input syntax for type integer: "false"

(/Users/XXXX/cloud-suitability-analyzer/csa-app/db/rule_repository.go:83)
[2024-03-11 10:49:19]  pq: invalid input syntax for type integer: "false"

(/Users/XXXX/cloud-suitability-analyzer/csa-app/db/rule_repository.go:83)
[2024-03-11 10:49:19]  pq: invalid input syntax for type integer: "false"

(/Users/XXXX/cloud-suitability-analyzer/csa-app/db/rule_repository.go:83)
[2024-03-11 10:49:19]  pq: invalid input syntax for type integer: "false"

(/Users/XXXX/cloud-suitability-analyzer/csa-app/db/rule_repository.go:83)
[2024-03-11 10:49:19]  pq: invalid input syntax for type integer: "false"

(/Users/XXXX/cloud-suitability-analyzer/csa-app/db/rule_repository.go:83)
[2024-03-11 10:49:19]  pq: invalid input syntax for type integer: "false"
csa: error: Error saving rule [SNAP-ETL-import]! Details: pq: invalid input syntax for type integer: "false"

After manually update the db field types for negative and has_fired from integer to bool, the process continues. However there is another error:

Decompiling [jenkins_war.ear]...
Found [1] Applications...
Gathering Files...done!
 (2m9.356023334s)

App/File Details:

    jenkins_war.ear has [838] files

**** Found [838] total Files to Analyze ****

Analyzing...100%
Analyzing - jenkins_war.ear...done! (1.1584485s)
Analyzing...done! (1.15913225s)
Saving...done! (1.169451916s)
SLOC Analysis...done! (92.914625ms)
Scoring...done! (8.818208ms)

                    SLOC SUMMARY
----------------------------------------------------
|           language| #files| blank| comment|  code|
|-------------------|-------|------|--------|------|
|       Bourne Shell|      2|    10|      23|    24|
|                CSS|     69|  1057|    1447|  5864|
|               HTML|    427|   301|      28|  5363|
|               Java|      1|    78|       0|   435|
|         JavaScript|     67| 15909|   34954| 62337|
|              Maven|      1|     4|       2|   129|
|         Plain Text|      5|     7|       0|   134|
| Properties File(s)|      1|     0|       0|     3|
|                XML|      9|    37|      21|   371|
|           ***TOTAL|    582| 17403|   36475| 74660|
----------------------------------------------------
no such table: findings%

But findings table is present and has data into it.

What is the version of Postgres supported?

rahulkj commented 8 months ago

Thank you for reporting the issue.

Please use the latest release 4.1.13.