Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

getting an error java.lang.IllegalArgumentException: line is not a valid line offset for pointer. #120

Open
manku211 opened this issue Nov 25, 2024 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@manku211
Copy link

INFO Sensor RustSensor [communityrust]

11:44:14.895 ERROR Unable to parse file: src/service/crons/process_historical_event/client.rs

11:44:14.897 ERROR Parse error at line 554 column 25:

544: // transfer reward

545: let reward_fut = client.transfer_rewards(process_reward_rx);

546: let (_res1, _res2) = tokio::join!(process_event_fut, reward_fut);

547: if let Err(err) = super::state::del("quest", ".", redis_pool.clone()).await {

548: tracing::error!("fail to remove quest from queue due to {err}");

549: }

550: }

551:

552: tracing::info!("process event sleep for 15 sec");

553: tokio::time::sleep(std::time::Duration::from_secs(15)).await;

554: if !continue_processing {

                         ^

555: break 'outer;

556: }

557: }

558: }

559: }

560:

561: #[cfg(test)]

562: mod test {

563: use super::*;

564: use crate::config::configuration::build_setting;

11:44:20.149 INFO Sensor RustSensor [communityrust] (done) | time=8452ms

11:44:20.150 INFO Sensor Import of Clippy issues [communityrust]

11:44:20.153 INFO Importing /opt/atlassian/pipelines/agent/build/clippy-report.json

11:44:20.265 INFO [stdout] /opt/atlassian/pipelines/agent/build/src/lib.rs

11:44:20.296 ERROR Error during SonarScanner Engine execution

java.lang.IllegalArgumentException: 12 is not a valid line offset for pointer. File src/lib.rs has 11 character(s) at line 6

@bzhoek
Copy link

bzhoek commented Nov 25, 2024

Can you share the contents of your clippy-report.json? I noticed my build is failing on clippy::missing_safety_doc, which identifies src/lib.rs as the source, but in reality the warning is caused in another file. When I disable the warning, I can import the file in SonarQube:

RUSTFLAGS="-Aclippy::missing_safety_doc" cargo clippy --message-format=json > target/clippy.json

@manku211
Copy link
Author

@bzhoek it was working previously , i use this command still does not work
clippy-report.json

@bzhoek
Copy link

bzhoek commented Nov 25, 2024

It looks like a regression that was introduced in v0.2.5. Can you revert to the previous version of the plug-in to see if that still works?

@bzhoek
Copy link

bzhoek commented Nov 25, 2024

@manku211 I just tried it with v0.2.4 of the plug-in and that works without a problem (even with SonarQube 10.7.

@manku211
Copy link
Author

@bzhoek I tried with v0.2.4 it still gives the parse error at some line but it does not break this time and does not give error of java.lang.IllegalArgumentException.
Thanku very much .

@C4tWithShell C4tWithShell self-assigned this Nov 30, 2024
@C4tWithShell
Copy link
Owner

@bzhoek, thank you for support and information about clippy::missing_safety_doc! I will double check the work of plugin for it

@manku211, can you share the parse errors, please?

@C4tWithShell C4tWithShell added the bug Something isn't working label Nov 30, 2024
@manku211
Copy link
Author

manku211 commented Dec 2, 2024

ERROR: Unable to parse file: src/service/crons/process_historical_event/client.rs

ERROR: Parse error at line 554 column 25:

544: // transfer reward

545: let reward_fut = client.transfer_rewards(process_reward_rx);

546: let (_res1, _res2) = tokio::join!(process_event_fut, reward_fut);

547: if let Err(err) = super::state::del("quest", ".", redis_pool.clone()).await {

548: tracing::error!("fail to remove quest from queue due to {err}");

549: }

550: }

551:

552: tracing::info!("process event sleep for 15 sec");

553: tokio::time::sleep(std::time::Duration::from_secs(15)).await;

554: if !continue_processing {

                         ^

555: break 'outer;

556: }

557: }

558: }

559: }

560:

561: #[cfg(test)]

562: mod test {

563: use super::*;

564: use crate::config::configuration::build_setting;
this is just snippet of my rust code where it usually give parse error but not breaking pipeline because i'm using old version plugin now it points the error at line number 554

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants