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

[BUG] failed to evaluate rule when analyze a non-java project #782

Open
1 task done
zhoufenqin opened this issue Feb 25, 2025 · 5 comments
Open
1 task done

[BUG] failed to evaluate rule when analyze a non-java project #782

zhoufenqin opened this issue Feb 25, 2025 · 5 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. needs-priority Indicates an issue or PR lacks a `priority/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.

Comments

@zhoufenqin
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Konveyor version

v0.6.0

Priority

Major

Current Behavior

I know when using "kantra analyze" command, it not support some language apps like php, but the analyze step not report error directly. when using analyzer-lsp to evaluate rule, the message is meaningless

For example:
when run list of rules, it will evaluate selected rules. if it's a full mode, it will get dependencies.

  1. for each rule, it will call the "GetDependencies" again, analyze the pom.xml if exist, very duplicate
  2. if it's not a java project, then it will locate to GetDependenciesFallback, when the pom.xml not found, it doesn't return directly, actually, it will try to use gopom.Parse(path), it always fail because it can't process the folder.
    the error message shows like below, very meaingless and can't really understand what happened.
time="2025-02-24T16:29:47+08:00" level=error msg="failed to evaluate rule" error=EOF ruleID=apm-00000
time="2025-02-24T16:29:47+08:00" level=error msg="Analyzing POM" error=EOF provider=java
time="2025-02-24T16:29:47+08:00" level=info msg="rule returned" ruleID=apm-00001
time="2025-02-24T16:29:47+08:00" level=error msg="failed to evaluate rule" error=EOF ruleID=apm-00001
time="2025-02-24T16:29:47+08:00" level=error msg="Analyzing POM" error=EOF provider=java
time="2025-02-24T16:29:47+08:00" level=info msg="rule returned" ruleID=apm-00002
time="2025-02-24T16:29:47+08:00" level=error msg="failed to evaluate rule" error=EOF ruleID=apm-00002
time="2025-02-24T16:29:47+08:00" level=error msg="Analyzing POM" error=EOF provider=java
time="2025-02-24T16:29:47+08:00" level=info msg="rule returned" ruleID=3rd-party-20000
time="2025-02-24T16:29:47+08:00" level=error msg="failed to evaluate rule" error=EOF ruleID=3rd-party-20000
time="2025-02-24T16:29:48+08:00" level=error msg="Analyzing POM" error=EOF provider=java
....

Expected Behavior

improve the evaluate rule process

How Reproducible

Always (Default)

Steps To Reproduce

No response

Environment

- **Analyzer Image SHA** 
- **JDTLS  base image SHA**
- **Provider Settings JSON**

Anything else?

No response

@zhoufenqin zhoufenqin added kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Feb 25, 2025
@konveyor-ci-bot
Copy link

This issue is currently awaiting triage.
If contributors determine this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.
The triage/accepted label can be added by org members.

@konveyor-ci-bot konveyor-ci-bot bot added the needs-priority Indicates an issue or PR lacks a `priority/foo` label and requires one. label Feb 25, 2025
@jmle
Copy link
Contributor

jmle commented Feb 25, 2025

@zhoufenqin probably this bug should go to the kantra repository. Besides that, the analyzer doesn't necessarily need to analyze a java app - that is only the Java provider's job. There are other providers that can be run even if the application is not a Java application, for instance, the builtin provider, which providers support for full-text searches, XML parsing, and others. That's why the analyzer shouldn't be reporting the fact that the application is not a Java one. WDYT, @rromannissen ?

@rromannissen
Copy link

I agree. Kantra should take care of language identification and finding a suitable provider. Any thoughts @pranavgaikwad @shawn-hurley @eemcmullan ?

@eemcmullan
Copy link
Contributor

@zhoufenqin looks like this is kantra 0.6, which by default will only analyze Java apps. @rromannissen Maybe we aren't making it clear enough that containerless mode is only Java? We could use our language discovery for both modes so containerless could use it to send a warning if languages other than Java are found. wdyt?

@zhoufenqin
Copy link
Author

@zhoufenqin looks like this is kantra 0.6, which by default will only analyze Java apps. @rromannissen Maybe we aren't making it clear enough that containerless mode is only Java? We could use our language discovery for both modes so containerless could use it to send a warning if languages other than Java are found. wdyt?

Thanks @eemcmullan, it's good to identify the language and give some warning messages, if it's not a java, maybe it should not go to the analyzer-lsp step

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. needs-priority Indicates an issue or PR lacks a `priority/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.
Projects
None yet
Development

No branches or pull requests

4 participants