Skip to content

Failed to get home directory: Cannot specify home directory because it's empty #9541

Closed
@chaosmonk1

Description

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

Description

I have installed Gitea on Debian 10, mostly following these instructions, deviating in the following ways:

  • I installed the FSH-compliant wrapper script to /usr/bin

  • I installed the Gitea 1.10.1 binary to /usr/lib/gitea/gitea, since that's where the wrapper script expects it to be.

  • I am using SysVinit rather than systemd, so instead of the systemd unit file I used this init script, changing DAEMON=/usr/local/bin/$NAME to DAEMON=/usr/bin/$NAME in order to point to the FHS wrapper script.

I ran sudo service gitea start, and at first everything seemed fine. I was able to install Gitea via the web interface, create a user, and push several repos. However, upon making some changes to /etc/gitea/app.ini and running sudo service gitea restart, I got the following warning and error:

2019/12/30 03:01:29 ...s/setting/setting.go:517:NewContext() [W] Custom config '/var/lib/gitea/custom/"/etc/gitea/app.ini"' not found, ignore this if you're running first time
2019/12/30 03:01:29 ...s/setting/setting.go:523:NewContext() [F] Failed to get home directory: Cannot specify home directory because it's empty

Although Gitea restarted successfully, I found that my changes to app.ini had not taken effect. These messages also appeared when I ran Gitea for the first time, but I did not pay close attention to them at the time.

The first message appears to be an issue of "/etc/gitea/app.ini" getting appended to the custom config path. My suspicion was that this is because of the line DAEMON_ARGS="web -c /etc/$NAME/app.ini", and that the -c argument might be redundant with the wrapper script. I tried changing it to DAEMON_ARGS="web", and restarted Gitea.

This time, I only got the second message: Failed to get home directory: .... However, Gitea no longer worked properly. Many pages gave a 500 error. I then reverted my change to the init script and restarted, but still got the 500 errors. I tried hacking at the init and wrapper scripts for a while, but could not get back to where I was, let alone fix the original problem. I gave up, deleted all Gitea files, and started fresh.

I am now back to where I was, with the same two messages and my changes to app.ini not taking effect. This time I don't want to mess with anything before I understand exactly what's going on. Can anyone provide some insight? Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions