Could not find ref 'v3.5.0' in refs/heads, refs/remotes/upstream or refs/remotes/origin

As one of may I am facing sonar warning
“Could not find ref ‘v3.5.0’ in refs/heads, refs/remotes/upstream or refs/remotes/origin. You may see unexpected issues and changes. Please make sure to fetch this ref before pull request analysis.”

I have fetched both branches before running analise but still getting warning. So git branch shows:

  • bug/15174_get-cases-for-user
    develop
    release/v3.5.0

and Sonar-project.properties has:

sonar.pullrequest.key=2869
sonar.pullrequest.branch=bug/15174_get-cases-for-user
sonar.pullrequest.base=release/v3.5.0

One more thing that is a question to me is where does “release/” annotation gone in a warning. bug/ and release/ are missing in sonarcloud.io as well

What am I doing wrong
Thanks for help

Anyone? :confused:

Hi @tadejcek

“release” keyword is a part of the long-living branch pattern that is defined by default.

Is this release/v3.5.0 branch already been analyzed on SonarCloud ? Is not, then you should, otherwise it may lead to errors.

Which CI tool are you using ? Are you filling those sonar.pullrequest.* by “hand” in the properties file ?

Mickaël

Hi @mickaelcaro,
thx for the response.

I think I have had tried that release/v3.5.0 was pre-analyzed. But I will try once again and back to you.

I am using Jenkins. And pullrequest.* are written by hand.
I have also tried checking out both branches by hand and running sonar command

Ok @mickaelcaro,
have made another test (by hand. Not using CI) that shows the same warning :confused:

What have I done:

  • I made checkout release/v3.5.0
  • run analyze. After analyze was finished the results were on sonarcloud.io
    image

My sonar prop was:

sonar.host.url=
sonar.login=
sonar.organization=
sonar.projectKey=
sonar.projectName=
sonar.projectVersion=
sonar.sources=.
sonar.host.url=https://sonarcloud.io
sonar.sourceEncoding=UTF-8
sonar.exclusions=
sonar.login=
sonar.c.file.suffixes=-
sonar.cpp.file.suffixes=-
sonar.objc.file.suffixes=-
sonar.eslint.reportPaths=
sonar.testExecutionReportPaths=
sonar.typescript.tslint.reportPath=
sonar.javascript.lcov.reportPaths=
sonar.coverage.exclusions=
sonar.scm.provider=git
sonar.branch.name=release/v3.5.0

  • checkout PR on branch bug/15192-check-updated-action-deleted so I have both branches on local
    image

  • run PR analyze on bug/15192-check-updated-action-deleted with sonar prop.:

    sonar.organization=
    sonar.projectKey=
    sonar.projectName=
    sonar.projectVersion=
    sonar.sources=.
    sonar.host.url=https://sonarcloud.io
    sonar.sourceEncoding=UTF-8
    sonar.exclusions=
    sonar.login=
    sonar.c.file.suffixes=-
    sonar.cpp.file.suffixes=-
    sonar.objc.file.suffixes=-
    sonar.eslint.reportPaths=
    sonar.testExecutionReportPaths=
    sonar.typescript.tslint.reportPath=
    sonar.javascript.lcov.reportPaths=
    sonar.coverage.exclusions=
    sonar.pullrequest.key=2880
    sonar.pullrequest.branch=bug/15192-check-updated-action-deleted
    sonar.pullrequest.base=release/v3.5.0
    sonar.pullrequest.provider=vsts
    sonar.pullrequest.vsts.instanceUrl=
    sonar.pullrequest.vsts.project=
    sonar.pullrequest.vsts.repository=
    sonar.scm.provider=git

But still getting the warning

> WARN: Could not find ref: v3.5.0 in refs/heads, refs/remotes/upstream or refs/remotes/origin"

Any suggestions?

Hi @tadejcek

Sorry for the late reply.

Could youi please give me a background task id that relates to one of these analysis on that branch ?

Thanks in advance.
Mickaël

Hi @mickaelcaro

Last two background tasks that have warning:
AXf8rovJSEcQXtpi67tC

AXf5VZbL7Q7kA315kp5

Thank you
Tadej

Hi @tadejcek

Thanks for that, so far the properties passed to the background process looks ok.

Will it be possible also that you share with us the log, in debug mode, of the Scanning process ?

I can PM you so you can share it privately, let me know.

Thank you.

Sorry for long responsne. Yes, please, It is possible.