Saving markdown files via the Web interface fails. #1145

Closed
opened 2025-11-02 03:49:59 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @sgtwilko on GitHub (Oct 12, 2017).

  • Gitea version (or commit ref): 1.2.0 built with: bindata, sqlite
  • Git version: 2.14.1
  • Operating system: Windows server 2008R2
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

No errors listed in the log, but please let me know if there's some extra logging I can enabled that would provide information.

Description

When trying to edit Markdown files (such as README.md) via the web interface we receive this error:
Failed to update/create file 'README.md' with error: UpdateLocalCopyBranch [branch: Development]: git clone Development: exit status 128 - fatal: destination path 'data/tmp/local-repo/2' already exists and is not an empty directory.

Screenshots

gitea_markdownsaveerror

Originally created by @sgtwilko on GitHub (Oct 12, 2017). - Gitea version (or commit ref): 1.2.0 built with: bindata, sqlite - Git version: 2.14.1 - Operating system: Windows server 2008R2 - Database (use `[x]`): - [ ] PostgreSQL - [ ] MySQL - [x] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [x] No - [ ] Not relevant - Log gist: No errors listed in the log, but please let me know if there's some extra logging I can enabled that would provide information. ## Description When trying to edit Markdown files (such as README.md) via the web interface we receive this error: `Failed to update/create file 'README.md' with error: UpdateLocalCopyBranch [branch: Development]: git clone Development: exit status 128 - fatal: destination path 'data/tmp/local-repo/2' already exists and is not an empty directory.` ## Screenshots ![gitea_markdownsaveerror](https://user-images.githubusercontent.com/658876/31502291-87b7af14-af64-11e7-9e5f-c01124956eec.PNG)
GiteaMirror added the issue/duplicate label 2025-11-02 03:49:59 -06:00
Author
Owner

@lafriks commented on GitHub (Oct 12, 2017):

I think this could be windows related...

@lafriks commented on GitHub (Oct 12, 2017): I think this could be windows related...
Author
Owner

@sgtwilko commented on GitHub (Oct 13, 2017):

After a fair bit of time with Process Monitor (thank you Sysinternals!) I've found the issue.

For some reason (don't know why, I didn't install either) we had a 32bit version of Git and the 64bit version of Gitea.

Gitea was looking in System32 for the data/tmp/local-repo folder, Git was looking in what it thought was System32, but a 32bit application on a 64bit system is remapped by the OS to point to the SysWOW64, so the folder was never removed.

I've uninstalled the 32bit version and installed the 64bit and the issue went away.

Probably Gitea needs to either check that the bit versions match, but a better fix would be to force the data/tmp/ folder to be in the Gitea install location rather than in System32. I can't think of a reason why Gitea needs to be using the System32 folder for temp storage.

@sgtwilko commented on GitHub (Oct 13, 2017): After a fair bit of time with Process Monitor (thank you Sysinternals!) I've found the issue. For some reason (don't know why, I didn't install either) we had a 32bit version of Git and the 64bit version of Gitea. Gitea was looking in System32 for the `data/tmp/local-repo` folder, Git was looking in what it thought was System32, but a 32bit application on a 64bit system is remapped by the OS to point to the SysWOW64, so the folder was never removed. I've uninstalled the 32bit version and installed the 64bit and the issue went away. Probably Gitea needs to either check that the bit versions match, but a better fix would be to force the data/tmp/ folder to be in the Gitea install location rather than in System32. I can't think of a reason why Gitea needs to be using the System32 folder for temp storage.
Author
Owner

@lafriks commented on GitHub (Oct 13, 2017):

Yes that issue is known that when run as windows service it sets working directory to system32 so there is actually WIP PR to fix it but it is not merged yet

@lafriks commented on GitHub (Oct 13, 2017): Yes that issue is known that when run as windows service it sets working directory to system32 so there is actually WIP PR to fix it but it is not merged yet
Author
Owner

@lafriks commented on GitHub (Oct 13, 2017):

Duplicate of #2159

@lafriks commented on GitHub (Oct 13, 2017): Duplicate of #2159
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#1145