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] no explicit encoding set error when running rules #787

Open
1 task done
zhoufenqin opened this issue Mar 6, 2025 · 5 comments
Open
1 task done

[BUG] no explicit encoding set error when running rules #787

zhoufenqin opened this issue Mar 6, 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

0.6.0

Priority

Critical

Current Behavior

Repo: https://github.com/spring-projects/spring-petclinic.git
Rule: 3rd-party-spring-03001

for the app, in windup, the rule can be executed.
When running with kantra, it report error.

Command:
kantra analyze --input ./spring-petclinic --output ./spring.localtest --target azure-container-apps --target cloud-readiness --target linux --overwrite --enable-default-rulesets=false --rule=xxx/01-3rd-party-spring.windup.yaml

analysis.log:

time="2025-03-06T18:53:21+08:00" level=error msg="language server stopped with error" error="exec: not started" provider=java
time="2025-03-06T18:53:21+08:00" level=info msg="resolving dependency sources" provider=java
time="2025-03-06T18:53:39+08:00" level=info msg="language server log" line="!MESSAGE KONVEYOR_LOG: got: 820 search matches for java.io.(FileWriter|FileReader|PrintStream|File|PrintWriter|RandomAccessFile)* location 3 matches784" provider=java
time="2025-03-06T18:53:58+08:00" level=info msg="language server log" line="!MESSAGE KONVEYOR_LOG: waiting for source downloads" provider=java
time="2025-03-06T18:53:58+08:00" level=info msg="language server log" line="!MESSAGE KONVEYOR_LOG: waited for source downloads" provider=java
time="2025-03-06T18:53:58+08:00" level=info msg="language server log" line="!MESSAGE KONVEYOR_LOG: found errors: [] warnings: [Marker [on: /spring-petclinic, id: 7, type: org.eclipse.core.resources.noExplicitEncoding, attributes: [location: /spring-petclinic, message: Project 'spring-petclinic' has no explicit encoding set, severity: 1], created: 3/4/25, 9:58 AM]]" provider=java
time="2025-03-06T18:53:58+08:00" level=info msg="language server log" line="!MESSAGE KONVEYOR_LOG: pattern: TypeDeclarationPattern: qualification<org.springframework.boot.autoconfigure>, type<SpringBootApplication> TypeDeclarationPattern: pkg<*>, enclosing<*>, type<SpringBootApplication>, exact match, case sensitive, generic full match, fine grain: none | TypeReferencePattern: qualification<org.springframework.boot.autoconfigure>, type<SpringBootApplication>, exact match, case sensitive, generic full match, fine grain: none" provider=java
time="2025-03-06T18:54:15+08:00" level=info msg="language server log" line="!MESSAGE KONVEYOR_LOG: got: 3 search matches for org.springframework.boot.autoconfigure.SpringBootApplication location 4 matches9" provider=java
time="2025-03-06T18:54:15+08:00" level=info msg="Symbols retrieved" cap=referenced conditionInfo="{\"Referenced\":{\"Pattern\":\"org.springframework.boot.autoconfigure.SpringBootApplication\",\"Location\":\"ANNOTATION\",\"annotated\":{\"pattern\":\"\"},\"Filepaths\":null}}" provider=java symbols=9
time="2025-03-06T18:54:15+08:00" level=error msg="failed to evaluate rule" error="exit status 1" ruleID=3rd-party-spring-03001
time="2025-03-06T18:54:16+08:00" level=info msg="stopping java provider" error="{\"Stderr\":null}" provider=java

output.yaml:

- name: xxx
  description: xxx
  errors:
    3rd-party-spring-03001: exit status 1

Is there some thing wrong with java lsp server?

Expected Behavior

the project should add Spring Boot Configuration, Spring Boot Auto-configuration, Spring Boot Component Scan tags because the rule can be matched

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 Mar 6, 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 Mar 6, 2025
@shawn-hurley
Copy link
Contributor

Is there any chance that you could attach the analysis logs to the issue, it will narrow the issue down of which provider condition is causing the problem.

@zhoufenqin
Copy link
Author

Hi @shawn-hurley I have already paste the analysis.log content, see the descriptions content, it's all content in the log file because I only run a single rule

@shawn-hurley
Copy link
Contributor

Oh my! I must be reading too fast! I am sorry!

Can you run with --log-level 10 to get the trace/debug logs? this may give us more information about what happened.

Sorry for missing the logs

@zhoufenqin
Copy link
Author

Thanks @shawn-hurley , I add the log level, the analysis.log content is

time="2025-03-07T09:13:28+08:00" level=unknown msg="rules parsed" logger=parser parsed=1
time="2025-03-07T09:13:28+08:00" level=error msg="language server stopped with error" error="exec: not started" provider=java
time="2025-03-07T09:13:28+08:00" level=unknown msg="language server stopped" provider=java
time="2025-03-07T09:13:28+08:00" level=unknown msg="starting to run rpc connection" provider=java
time="2025-03-07T09:13:28+08:00" level=info msg="resolving dependency sources" provider=java
time="2025-03-07T09:13:39+08:00" level=trace msg="java connection initialized" provider=java
time="2025-03-07T09:13:41+08:00" level=unknown msg="running dependency analysis" provider=java
time="2025-03-07T09:13:41+08:00" level=info msg="language server log" line="!MESSAGE KONVEYOR_LOG: got: 820 search matches for java.io.(FileWriter|FileReader|PrintStream|File|PrintWriter|RandomAccessFile)* location 3 matches784" provider=java
time="2025-03-07T09:13:41+08:00" level=info msg="language server log" line="!MESSAGE KONVEYOR_LOG: waiting for source downloads" provider=java
time="2025-03-07T09:13:41+08:00" level=info msg="language server log" line="!MESSAGE KONVEYOR_LOG: waited for source downloads" provider=java
time="2025-03-07T09:13:41+08:00" level=info msg="language server log" line="!MESSAGE KONVEYOR_LOG: found errors: [] warnings: [Marker [on: /spring-petclinic, id: 7, type: org.eclipse.core.resources.noExplicitEncoding, attributes: [location: /spring-petclinic, message: Project 'spring-petclinic' has no explicit encoding set, severity: 1], created: 3/4/25, 9:58 AM]]" provider=java
time="2025-03-07T09:13:41+08:00" level=info msg="language server log" line="!MESSAGE KONVEYOR_LOG: pattern: TypeDeclarationPattern: qualification<org.springframework.boot.autoconfigure>, type<SpringBootApplication> TypeDeclarationPattern: pkg<*>, enclosing<*>, type<SpringBootApplication>, exact match, case sensitive, generic full match, fine grain: none | TypeReferencePattern: qualification<org.springframework.boot.autoconfigure>, type<SpringBootApplication>, exact match, case sensitive, generic full match, fine grain: none" provider=java
time="2025-03-07T09:13:41+08:00" level=info msg="language server log" line="!MESSAGE KONVEYOR_LOG: got: 3 search matches for org.springframework.boot.autoconfigure.SpringBootApplication location 4 matches9" provider=java
time="2025-03-07T09:14:15+08:00" level=info msg="language server log" line="!MESSAGE KONVEYOR_LOG: waiting for source downloads" provider=java
time="2025-03-07T09:14:15+08:00" level=info msg="language server log" line="!MESSAGE KONVEYOR_LOG: waited for source downloads" provider=java
time="2025-03-07T09:14:15+08:00" level=info msg="language server log" line="!MESSAGE KONVEYOR_LOG: found errors: [] warnings: [Marker [on: /spring-petclinic, id: 7, type: org.eclipse.core.resources.noExplicitEncoding, attributes: [location: /spring-petclinic, message: Project 'spring-petclinic' has no explicit encoding set, severity: 1], created: 3/4/25, 9:58 AM]]" provider=java
time="2025-03-07T09:14:15+08:00" level=info msg="language server log" line="!MESSAGE KONVEYOR_LOG: pattern: TypeDeclarationPattern: qualification<org.springframework.boot.autoconfigure>, type<SpringBootApplication> TypeDeclarationPattern: pkg<*>, enclosing<*>, type<SpringBootApplication>, exact match, case sensitive, generic full match, fine grain: none | TypeReferencePattern: qualification<org.springframework.boot.autoconfigure>, type<SpringBootApplication>, exact match, case sensitive, generic full match, fine grain: none" provider=java
time="2025-03-07T09:14:20+08:00" level=info msg="language server log" line="!MESSAGE KONVEYOR_LOG: got: 3 search matches for org.springframework.boot.autoconfigure.SpringBootApplication location 4 matches9" provider=java
time="2025-03-07T09:14:20+08:00" level=info msg="Symbols retrieved" cap=referenced conditionInfo="{\"Referenced\":{\"Pattern\":\"org.springframework.boot.autoconfigure.SpringBootApplication\",\"Location\":\"ANNOTATION\",\"annotated\":{\"pattern\":\"\"},\"Filepaths\":null}}" provider=java symbols=9
time="2025-03-07T09:14:20+08:00" level=error msg="failed to evaluate rule" error="exit status 1" ruleID=3rd-party-spring-03001
time="2025-03-07T09:14:20+08:00" level=unknown msg="All rules added buffer, waiting for engine to complete" size=0
time="2025-03-07T09:14:20+08:00" level=trace msg="done processing all the rules"
time="2025-03-07T09:14:20+08:00" level=unknown msg="rule engine stopping"
time="2025-03-07T09:14:20+08:00" level=unknown msg="stopping rule worker" worker=4
time="2025-03-07T09:14:20+08:00" level=unknown msg="stopping rule worker" worker=9
time="2025-03-07T09:14:20+08:00" level=unknown msg="stopping rule worker" worker=7
time="2025-03-07T09:14:20+08:00" level=unknown msg="stopping rule worker" worker=8
time="2025-03-07T09:14:20+08:00" level=unknown msg="stopping rule worker" worker=1
time="2025-03-07T09:14:20+08:00" level=unknown msg="stopping rule worker" worker=0
time="2025-03-07T09:14:20+08:00" level=unknown msg="stopping rule worker" worker=5
time="2025-03-07T09:14:20+08:00" level=unknown msg="stopping rule worker" worker=6
time="2025-03-07T09:14:20+08:00" level=unknown msg="stopping rule worker" worker=3
time="2025-03-07T09:14:20+08:00" level=unknown msg="stopping rule worker" worker=2
time="2025-03-07T09:14:20+08:00" level=info msg="stopping java provider" error="{\"Stderr\":null}" provider=java

I test this rule:

- customVariables: []
  labels:
  - konveyor.io/include=always
  links: []
  ruleID: 3rd-party-spring-03001
  tag:
  - Spring Boot Configuration
  - Spring Boot Auto-configuration
  - Spring Boot Component Scan
  when:
    java.referenced:
      location: ANNOTATION
      pattern: org.springframework.boot.autoconfigure.SpringBootApplication

# 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

2 participants