# Sonar scanner fails on gitea server

**URL:** <https://community.sonarsource.com/t/sonar-scanner-fails-on-gitea-server/21767>\
**Category:** SonarQube Server / Community Build\
**Created:** [March 18, 2020, 1:20pm UTC](https://community.sonarsource.com/t/sonar-scanner-fails-on-gitea-server/21767 "2020-03-18T13:20:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![manfred](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/manfred/32/5524_2.png) [@manfred](https://community.sonarsource.com/u/manfred)\
**Post date:** [March 18, 2020, 1:20pm UTC](https://community.sonarsource.com/t/sonar-scanner-fails-on-gitea-server/21767/1 "2020-03-18T13:20:56Z")

</div>

Hi. I’m implementing a post-receive git hook on gitea server side. It’s a sonar-scanner command that executes in a bash script, that updates the SonarQube server everytime somebody pushes to the repo.

SonarQube Scanner 4.2.0.1873

What I’m interesting in, is the following error I get when I manually execute sonar-scanner (that’s to see if I have communication with SonarQube server):

> ERROR: Error during SonarQube Scanner execution  
> org.eclipse.jgit.errors.NoWorkTreeException: Bare Repository has neither a working tree, nor an index  
> at org.eclipse.jgit.lib.Repository.getWorkTree(Repository.java:1569)

so the path where I execute sonar-scanner is /home/git/gitea-repositories/user/project.git (that’s standard location for gitea repos)  
What I only understand is that the git project folder is not suitable for sonar-scanner somehow on gitea server. I didn’t reproduce the same behavior on another host, where I successfully execute sonar-scanner.

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [March 19, 2020, 4:45pm UTC](https://community.sonarsource.com/t/sonar-scanner-fails-on-gitea-server/21767/2 "2020-03-19T16:45:26Z")

</div>

Hi,

Welcome to the community!

You need to either disable SCM blame retrieval or run the scanner from the project root directory (side-by-side with the `.git` directory).

&nbsp;  
HTH,  
Ann
