# "The file was removed, no source code can be displayed."

**URL:** <https://community.sonarsource.com/t/the-file-was-removed-no-source-code-can-be-displayed/185225>\
**Category:** SonarQube Cloud\
**Tags:** cfamily\
**Created:** [July 10, 2026, 8:43am UTC](https://community.sonarsource.com/t/the-file-was-removed-no-source-code-can-be-displayed/185225 "2026-07-10T08:43:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Oodini](https://avatars.discourse-cdn.com/v4/letter/o/db5fbb/32.png) [@Oodini](https://community.sonarsource.com/u/Oodini)\
**Post date:** [July 10, 2026, 8:43am UTC](https://community.sonarsource.com/t/the-file-was-removed-no-source-code-can-be-displayed/185225/1 "2026-07-10T08:43:01Z")

</div>

Hello,

I submitted C++ code to SonarQube Cloud.

- ALM: Gitlab
- CI: Jenkins
- Scanner command:

```auto
Running SonarScanner with following arguments: -D'sonar.organization=xxxxx' -D'sonar.sourceEncoding=UTF-8' -D'sonar.cfamily.compile-commands=../../../bin/sonar-build-wrapper/compile_commands.json' -D'sonar.projectBaseDir=yyyyy' -D'sonar.pullrequest.key=252' -D'sonar.pullrequest.branch=Qt_lupdate' -D'sonar.pullrequest.base=develop'

```

\*Language: C++

The Sonar analysis reports some issues, and when I want to get info about them, I get in the web GUI:

> _The file was removed, no source code can be displayed._

I do have the rights on the files, as all members of the organization (and i am one of the administrators)

---

<div class="post-metadata">

**Author:** ![David-Lee](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/david-lee/32/76870_2.png) [@David-Lee](https://community.sonarsource.com/u/David-Lee)\
**Post date:** [July 10, 2026, 11:38am UTC](https://community.sonarsource.com/t/the-file-was-removed-no-source-code-can-be-displayed/185225/2 "2026-07-10T11:38:23Z")

</div>

That sounds frustrating. It may be a branch or commit mismatch—check that SonarQube is analyzing the same source revision as GitLab.

---

<div class="post-metadata">

**Author:** ![stevan.vanderwerf](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/stevan.vanderwerf/32/76888_2.png) [@stevan.vanderwerf](https://community.sonarsource.com/u/stevan.vanderwerf)\
**Post date:** [July 12, 2026, 11:24pm UTC](https://community.sonarsource.com/t/the-file-was-removed-no-source-code-can-be-displayed/185225/3 "2026-07-12T23:24:46Z")

</div>

Hi @Oodini,

This message has two possible causes:

**1. “See Source Code” permission** : This is the most common cause. Even as an org administrator, if the “See Source Code” permission isn’t explicitly granted at the project level, SonarQube shows this message instead. Check under Project → Administration → Permissions and confirm that your user or group has “See Source Code” enabled.

**2. File path resolution in PR analysis** : Since you’re running a PR analysis with `sonar.projectBaseDir` and a `compile_commands.json`, the file paths SonarQube indexed may not be matching what it’s trying to display. A few things to verify:

- Are you viewing the issue within the correct PR context (PR #252 / branch `Qt_lupdate`)? Switching to a different branch or the main branch view can trigger this message if that file wasn’t analyzed in that context.
- Do the file paths in your `compile_commands.json` resolve correctly relative to the `sonar.projectBaseDir` you’ve set? A mismatch here can result in issues being reported but files not being viewable.

Could you confirm whether the permission check resolves it, and if not, share what the exact path looks like in the scanner logs for one of the affected files?

Best regards,

Stevan
