Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"pre-receive hook declined" after running Gogs for some time on Windows #6316

Closed
ZantsuRocks opened this issue Sep 8, 2020 · 12 comments · Fixed by #6361
Closed

"pre-receive hook declined" after running Gogs for some time on Windows #6316

ZantsuRocks opened this issue Sep 8, 2020 · 12 comments · Fixed by #6361
Assignees
Labels
💊 bug Something isn't working 🔙 regression Damn, why it stops working? 🧗🏾 windows Categorizes as related to Windows
Milestone

Comments

@ZantsuRocks
Copy link

Describe the bug
When trying to push some repo to Gogs it throws an error

Gogs version and commit
0.12.1 - 43fc826 (The bug never occurred on 0.11.91)

Git version
git version 2.23.0.windows.1 (Windows Client and Windows Server)
and
git version 2.17.1 (Linux Client)

Operating system
Pushing PC -> Windows 10, Linux
Repo Server -> Windows Server 2016

Database
SQLite3

To Reproduce
Steps to reproduce the behavior:

  1. Open Gogs Service in services.msc "C:\gogs\gogs.exe" web --config "C:\gogs\custom\conf\app.ini"
  2. Push some data (Push completes)
  3. Let the service run for about 24h
  4. Try to push some data again (Push throw an error)
git: 'credential-cache' is not a git command. See 'git --help'.
remote: Gogs: Internal error        
To https://srvfs01.agst.com.br:3000/AGST/JigaBrise.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://srvfs01.agst.com.br:3000/AGST/JigaBrise.git'
  1. Restart the service on services.msc
  2. Try to push again and it works.

Can you reproduce the bug at https://try.gogs.io?
No

Expected behavior
As there is no pre-receive hook on the repo or something wrong in the local repo to finish the push successfully

Actual behavior
When trying to push some repo to Gogs it throws an error

Screenshots
Error:
erro
Ok (After restarting the service):
ok

Additional context
app.ini.txt
gogs.log
hooks/*.log are empty

@Crayon2000
Copy link
Contributor

I am currently having the same problem. I need to restart the service each day in order to make push request work. The problem did not occur before updating to 0.12.1. I am also using gogs on Windows.

@unknwon unknwon changed the title [pre-receive hook declined] After some time that gogs service is running. "pre-receive hook declined" after running Gogs for some time on Windows Sep 9, 2020
@unknwon unknwon added status: needs reproduce Wait, how did that happen? 💊 bug Something isn't working 🧗🏾 windows Categorizes as related to Windows 🙇‍♂️ help wanted Need your help 🔙 regression Damn, why it stops working? labels Sep 9, 2020
@unknwon
Copy link
Member

unknwon commented Sep 9, 2020

Thanks for reporting!

I don't have any clue about the root cause top of my head, but I'll take a look during 0.13 dev cycle.

@unknwon unknwon added this to the 0.13 milestone Sep 9, 2020
@sln162
Copy link

sln162 commented Sep 17, 2020

With the same problem, I even tried to restart the service regularly. I've rolled back to 0.11.91

@unknwon
Copy link
Member

unknwon commented Sep 18, 2020

My current guess is that the daily log rotation has problem on Windows, since it seems to often appear in the next day? 🤔

@sln162
Copy link

sln162 commented Sep 18, 2020

@unknwon Maybe, I always thought it was more than 10 hours. When there is a problem, my method is to restart the gogs service every time to solve the problem. After encountering this problem, I tried a lot, including changing different versions of GIT, re covering and installing new ones. All of these problems could not be solved. I manually restart every day for more than 20 days, but I didn't wait for your repair version. I gave up and went back to 0.11

@MooLee89
Copy link

This problem is very serious, it reappeared after restarting for 12 hours

@sln162
Copy link

sln162 commented Sep 26, 2020

@MooLee89 It's very serious. Every day I restart, I want to write an auxiliary program to help gogs restart automatically. The author hasn't found the reason yet, so I suggest to use the old version. There are more and more users who upgrade to the new version. As long as they use windows, they will encounter this problem. Now, there are 4 or 5 people who are fed back. In fact, hundreds of people may have encountered this problem. Please wait for version 0.13 to be funny,because it could take a year.

@unknwon unknwon modified the milestones: 0.13, 0.12.3 Sep 26, 2020
@unknwon
Copy link
Member

unknwon commented Sep 26, 2020

I've set up a 0.13.0+dev on a Windows server see if I can reproduce this problem after few hours.

@unknwon unknwon removed status: needs reproduce Wait, how did that happen? 🙇‍♂️ help wanted Need your help labels Sep 28, 2020
@unknwon
Copy link
Member

unknwon commented Sep 28, 2020

Found the cause (by setting RUN_MODE=dev): The data race on xorm.log file during daily rotation.

remote: Failed to set database engine: create 'xorm.log': init: init rotation: rename rotate file: 
rename C:/Users/Administrator/Desktop/gogs/log/xorm.log C:/Users/Administrator/Desktop/gogs/log/xorm.log.2020-09-26: 
The process cannot access the file because it is being used by another process.

Working on a fix.

@unknwon
Copy link
Member

unknwon commented Sep 29, 2020

The patch will be included in 0.12.3.

@unknwon
Copy link
Member

unknwon commented Oct 7, 2020

The 0.12.3 has been released.

@sln162
Copy link

sln162 commented Oct 7, 2020

Thank you very much. I often check whether 0.12.3 has been released these days. Last night, I saw that it was released 17 minutes ago, but there was only the source code. I waited for an hour and kept refreshing. At 0:17, I finally got the Windows version.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
💊 bug Something isn't working 🔙 regression Damn, why it stops working? 🧗🏾 windows Categorizes as related to Windows
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants