gradle Wrong offset errors #12399
-
Hello, I have some weird issues with gradle, where failures occur with "Wrong offset errors". This is with a selfhosted renovate (28.11.2) connected to an AzureDevOps Server git repository. The renovate.json contains: "extends": [
"config:base",
"group:allNonMajor",
":preserveSemverRanges"
] The build.gradle contains: plugins {
id 'java'
id 'application'
id 'maven-publish'
}
dependencies {
implementation 'com.google.guava:guava:28.0-jre'
testImplementation 'junit:junit:4.12'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.4.2'
} The error that I get is: 2021-10-29T14:29:53.9298400Z DEBUG: Wrong offset (repository=some/repository, branch=renovate/all-minor-patch)
2021-10-29T14:29:53.9299111Z "depName": "org.junit.jupiter:junit-jupiter-engine",
2021-10-29T14:29:53.9299622Z "currentValue": "5.4.2",
2021-10-29T14:29:53.9300009Z "newValue": "5.8.1" It seems from looking at it is logging the original currentValue, not the actual currentValue, which makes it a bit tricky to analyze.I think this issue is due to applying multiple updates to the same gradle file. The below baseDeps shows that the "baseDeps": [
{
"depName": "com.google.guava:guava",
"currentValue": "28.0-jre",
"managerData": {
"fileReplacePosition": 138,
"packageFile": "Test.Build.Gradle.Java/build.gradle"
},
"fileReplacePosition": 138,
"registryUrls": [
"https://repo.maven.apache.org/maven2"
],
"depIndex": 0,
"updates": [
{
"bucket": "non-major",
"newVersion": "28.2-jre",
"newValue": "28.2-jre",
"newMajor": 28,
"newMinor": 2,
"updateType": "minor",
"branchName": "renovate/all-minor-patch"
},
{
"bucket": "major",
"newVersion": "31.0.1-jre",
"newValue": "31.0.1-jre",
"newMajor": 31,
"newMinor": 0,
"updateType": "major",
"branchName": "renovate/com.google.guava-guava-31.x"
}
],
"warnings": [],
"versioning": "gradle",
"sourceUrl": "https://github.com/google/guava",
"currentVersion": "28.0-jre",
"isSingleVersion": true,
"fixedVersion": "28.0-jre"
},
{
"depName": "junit:junit",
"currentValue": "4.12",
"managerData": {
"fileReplacePosition": 185,
"packageFile": "Test.Build.Gradle.Java/build.gradle"
},
"fileReplacePosition": 185,
"registryUrls": [
"https://repo.maven.apache.org/maven2"
],
"depIndex": 1,
"updates": [
{
"bucket": "non-major",
"newVersion": "4.13.2",
"newValue": "4.13.2",
"newMajor": 4,
"newMinor": 13,
"updateType": "minor",
"branchName": "renovate/all-minor-patch"
}
],
"warnings": [],
"versioning": "gradle",
"sourceUrl": "https://github.com/junit-team/junit4",
"homepage": "http://junit.org",
"currentVersion": "4.12",
"isSingleVersion": true,
"fixedVersion": "4.12"
},
{
"depName": "org.junit.jupiter:junit-jupiter-engine",
"currentValue": "5.4.2",
"managerData": {
"fileReplacePosition": 252,
"packageFile": "Test.Build.Gradle.Java/build.gradle"
},
"fileReplacePosition": 252,
"registryUrls": [
"https://repo.maven.apache.org/maven2"
],
"depIndex": 2,
"updates": [
{
"bucket": "non-major",
"newVersion": "5.8.1",
"newValue": "5.8.1",
"newMajor": 5,
"newMinor": 8,
"updateType": "minor",
"branchName": "renovate/all-minor-patch"
}
],
"warnings": [],
"versioning": "gradle",
"sourceUrl": "https://github.com/junit-team/junit5",
"homepage": "https://junit.org/junit5/",
"currentVersion": "5.4.2",
"isSingleVersion": true,
"fixedVersion": "5.4.2"
}
], Am I understanding this correctly? Or is there something else going on here? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
(sigh, this is not an answer, still getting used to this discussion mechanism) I have also seen an occurrence where an PR was created for a build.gradle that intended to update a (private) package version, but instead resulted in:
(note here that 1.0.10 is inserted for the wrong package, at a location that is not related (but does happen to be a package) |
Beta Was this translation helpful? Give feedback.
-
@rarkins @viceice Can you take a look at this discussion and see what we need to proceed? This discussion has not seen a response from the maintainers yet. So that's why I'm "nudging" you. 😉 |
Beta Was this translation helpful? Give feedback.
-
I'm having the same issue using renovate 41.42.6 A lot of my dependencies can't be updated with message"Wrong offset" followed by "Error updating file"
when modifying the sourcecode of renovate for more information, it seems manager/gradle/update.js expects to get a position where the version is, but the position is wrong.
I was able to reproduce this in multiple repositories that I use, even in a public repo of mine: (from which I took the log output/examples for this comment) |
Beta Was this translation helpful? Give feedback.
Not reproducible on my end.
You may want to check this: https://docs.renovatebot.com/getting-started/installing-onboarding/#self-hosting-on-windows