Skip to content

Push via ssh looks for custom/conf/app.ini at wrong path #1086

@jmert

Description

@jmert
  • Gitea version (or commit ref): Gitea version 1.0.0+351-g8947b711
  • Git version: git version 2.12.0
  • Operating system: Arch Linux
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

Using Arch's gittea-git AUR package, a recent recompile-and-update broke my ability to push to my repositories. The error message looked like:

$ git push
Counting objects: 10, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (10/10), done.
Writing objects: 100% (10/10), 1.83 KiB | 0 bytes/s, done.
Total 10 (delta 4), reused 0 (delta 0)
remote: 2017/02/28 08:42:59 [W] Custom config '/usr/bin/custom/conf/app.ini' not found, ignore this if you're running first time
remote: 2017/02/28 08:42:59 [...a/modules/log/log.go:59 NewGitLogger()] [E] Failed to create dir /usr/bin/log/hooks: mkdir /usr/bin/log: permission denied
To host:user/repo.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'gitea@host:user/repo.git'

I eventually figured out a work-around to be to add into my gitea user's ~/.ssh/environment file:

GITEA_CUSTOM=/var/lib/gitea/custom

The systemd service file includes this environment, so the web service started just fine. Neither of gitea's git hooks nor the authorized_keys file it generates explicitly includes this environment variable.

Searching through my system's update logs, it appears the issue has crept in sometime between versions r4904.284c0160-1 which was working and r5007.8947b711-1 which I installed yesterday. (I apologize for having to use the AUR package's versioning instead of gitea's versioning, but that's all my package manager knows about).

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue/criticalThis issue should be fixed ASAP. If it is a PR, the PR should be merged ASAPtype/bug

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions