gitea: SyncRepositoryHooks failing due to EINTR

  • Gitea version (or commit ref): 1.12.0
  • Git version: 2.20.1
  • Operating system: Debian
  • 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:

2020/05/25 18:52:08 …dules/setting/git.go:93:newGit() [I] Git Version: 2.20.1, Wire Protocol Version 2 Enabled 2020/05/25 18:52:08 …/repository/hooks.go:156:SyncRepositoryHooks() [T] Doing: SyncRepositoryHooks 2020/05/25 18:52:08 …m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT “id”, “owner_id”, “owner_name”, “lower_name”, “name”, “description”, “website”, “original_service_type”, “original_url”, “default_branch”, “num_watches”, “num_stars”, “num_forks”, “num_issues”, “num_closed_issues”, “num_pulls”, “num_closed_pulls”, “num_milestones”, “num_closed_milestones”, “is_private”, “is_empty”, “is_archived”, “is_mirror”, “status”, “is_fork”, “fork_id”, “is_template”, “template_id”, “size”, “is_fsck_enabled”, “close_issues_via_commit_in_any_branch”, “topics”, “avatar”, “created_unix”, “updated_unix” FROM “repository” WHERE id>$1 LIMIT 50 [0] - 7.145921ms 2020/05/25 18:52:08 main.go:111:main() [F] Failed to run app with [./gitea admin --config /home/gitea/gitea-config/gitea/app.ini regenerate hooks]: SyncRepositoryHook: write old hook file ‘/appdata/repositories/config.git/hooks/pre-receive’: close /appdata/repositories/config.git/hooks/pre-receive: interrupted system call

Description

After moving my app.ini, I needed to sync hooks. This failed from webgui so did it from command line:

./gitea admin --config /home/gitea/gitea-config/gitea/app.ini regenerate hooks

Thais also fails with the above error, although it appears that some hooks may have changed before the failure. Thus repeated runs of the above will eventually get through all the hooks (as the order of attempts are not fixed).

Environment

I’m running Gitea in an LXC container, and my repos are on a bind mount (which in turn is an autofs CIFS mount on the LXC host). The repo files are mounted -rwxr-xr-x and owned by the same user that runs gitea.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 21 (10 by maintainers)

Most upvoted comments

I’ve removed GODEBUG=asyncpreemptoff=1 with 1.13.1 and can’t see any immediate signs of the interruptions. I’ll monitor and update if I see any further issues.

So this has to do with changes in go 1.14 that mean that CIFS has problems.

See: https://github.com/golang/go/issues/39026#event-3329295983 https://github.com/golang/go/issues/38033 https://github.com/golang/go/issues/20400

It appears that GODEBUG=asyncpreemptoff=1 will reduce this from happening.

Rather disappointingly:

Sorry, we aren’t going to backport the EINTR change to 1.14. That is much too invasive and risky.

1.14 did not introduce this problem, it merely made it occur more often. The workaround of setting GODEBUG will reduce the number of times the problems occurs back to 1.13 levels.

It looks like the only way to fix this to either:

  • You need to set GODEBUG=asyncpreemptoff=1 in the environment (!)(!)
  • Wait till go 1.15 (!)(!)
  • Rewrite every call that could return an EINTR to retry (!)(!)

this is highly irritating.