# Pull Request creation timouts and returns 500 code in 1.17.2

**URL:** <https://forum.gitea.com/t/pull-request-creation-timouts-and-returns-500-code-in-1-17-2/5862>\
**Category:** Install/Maintain/Configure\
**Created:** [September 9, 2022, 8:27am UTC](https://forum.gitea.com/t/pull-request-creation-timouts-and-returns-500-code-in-1-17-2/5862 "2022-09-09T08:27:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![TomaszBogdanski](https://avatars.discourse-cdn.com/v4/letter/t/e274bd/32.png) [@TomaszBogdanski](https://forum.gitea.com/u/TomaszBogdanski)\
**Post date:** [September 9, 2022, 8:27am UTC](https://forum.gitea.com/t/pull-request-creation-timouts-and-returns-500-code-in-1-17-2/5862/1 "2022-09-09T08:27:20Z")

</div>

We have a massive repo in terms of number of files, which gitea usually handles fine. Upon upgrading to 1.17.2 we started to notice a problem with pull requests. Even a single character, single commit pull request creation (clicking “create pull request”) hangs for a long time and then returns 500. This issue occurs randomly and some pull requests are fine.

Upon checking gitea logs I can see error:

```auto
2022/09/07 09:19:25 ...ll/patch_unmerged.go:165:unmergedFiles() [E] [631842bf-15] Unable to run ls-files -u -z! Error: git ls-files -u -z: context deadline exceeded
2022/09/07 09:19:28 ...ers/web/repo/pull.go:1244:CompareAndPullRequestPost() [E] NewPullRequest: unable to run ls-files -u -z! Error: git ls-files -u -z: context deadline exceeded

```

So far I did garbage collection but problem did not disappear. In fact I had to do garbage collection from backend since from gitea front I was getting as well:

```auto
2022/09/07 09:53:37 models/db/context.go:140:Insert() [I] [63184d5e-3] [SQL] INSERT INTO notice (type,description,created_unix) VALUES (?,?,?) [1 Repository garbage collection failed for /mnt/disk1/git/gitea-repositories/telia/salesforce.git. Stdout: 
    Error: context deadline exceeded 1662537217] - 17.470209ms
2022/09/07 09:53:37 ...dels/admin/notice.go:55:CreateNotice() [I] [63184d5e-3] [SQL] INSERT INTO notice (type,description,created_unix) VALUES (?,?,?) [2 Task: Garbage collect all repositories cancelled: Repository garbage collection failed in repo: Telia/Salesforce: Error: <nil> 1662537217] - 1.922105ms

```

---

<div class="post-metadata">

**Author:** ![froyokimchi](https://avatars.discourse-cdn.com/v4/letter/f/57b2e6/32.png) [@froyokimchi](https://forum.gitea.com/u/froyokimchi)\
**Post date:** [September 29, 2022, 2:45pm UTC](https://forum.gitea.com/t/pull-request-creation-timouts-and-returns-500-code-in-1-17-2/5862/2 "2022-09-29T14:45:32Z")

</div>

Hello, Did you manage to resolve this issue? i have the same issue after migrating to 1.17.2. creating PR for “develop” branch always timeout with 500. i tried to increase the timeout setting but its not working. its like its just shows the loading icon and do nothing. I’ve got the same error in logs too.

---

<div class="post-metadata">

**Author:** ![jcatrysse](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/jcatrysse/32/3213_2.png) [@jcatrysse](https://forum.gitea.com/u/jcatrysse)\
**Post date:** [November 11, 2022, 1:27am UTC](https://forum.gitea.com/t/pull-request-creation-timouts-and-returns-500-code-in-1-17-2/5862/3 "2022-11-11T01:27:12Z")

</div>

Same thing… changing timeouts did not help… after about 300 seconds: " Error: git ls-files -u -z: context deadline exceeded"

---

<div class="post-metadata">

**Author:** ![jcatrysse](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/jcatrysse/32/3213_2.png) [@jcatrysse](https://forum.gitea.com/u/jcatrysse)\
**Post date:** [November 12, 2022, 10:34am UTC](https://forum.gitea.com/t/pull-request-creation-timouts-and-returns-500-code-in-1-17-2/5862/4 "2022-11-12T10:34:33Z")

</div>

An update on this issue. It seemed to be related to latency due to swapping.

I added Elasticsearch (8GB of RAM down the drain 🙂 ) and had no memory left, so I added swap space on disk… this resulted in this latency.

After putting in 32GB of RAM it flows like a river.
