From 7277c8bfb6b7a7fb2e616b30601a264896e7cd93 Mon Sep 17 00:00:00 2001 From: coolaj86 Date: Tue, 14 Nov 2017 14:48:12 +0000 Subject: [PATCH] Add troubleshooting systemd --- README.md | 82 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) diff --git a/README.md b/README.md index bd6317c..a6de456 100644 --- a/README.md +++ b/README.md @@ -82,3 +82,85 @@ $sudo_cmd 'sudo' if not root and sudo is installed, otherwise http_get uses curl or wget to download a file http_bash downloads file to a temporary location and runs it with bash ``` + +# Troubleshooting systemd + +## Error 226/Namespace + +Most likely a directory that is supposed to be writable doesn't exist. + +## Failed to get repository owner (foobar): no such table: user + +Your `custom/conf/app.ini` has a line like this: + +``` +[database] +DB_TYPE = sqlite3 +PATH = data/gitea.db +``` + +And it should probably look like this instead: + +``` +[database] +DB_TYPE = sqlite3 +PATH = /opt/gitea/data/gitea.db +``` + +## Gitea: Invalid key ID + +``` +Gitea: Invalid key ID +Invalid key ID[key-2]: public key does not exist [id: 2] +fatal: Could not read from remote repository. + +Please make sure you have the correct access rights +``` + +You are connecting to gitea with a different ssh key (usually `id_rsa.pub`) +than the one you uploaded. You can usually fix this by uploading your default key +or by manually specifying which key to use, for example: + +`~/.ssh/config`: +``` +Host git.example.com + User gitea + IdentityFile ~/.ssh/id_rsa +``` + +## Expect user 'foobar' but current user is: gitea + +``` +remote: 2017/10/25 23:53:10 [...s/setting/setting.go:625 NewContext()] [E] Expect user 'aj' but current user is: gitea +remote: error: hook declined to update refs/heads/master +To ssh://git.coolaj86.com:22042/coolaj86/hexdump.js.git + ! [remote rejected] master -> master (hook declined) +error: failed to push some refs to 'ssh://gitea@git.coolaj86.com:22042/coolaj86/hexdump.js.git' +``` + +If you copied a previous installation of gitea over to a new user, you may get this error. + +I haven't yet found where it comes from, but deleting the repository in the UI and re-adding it seems to do the trick +from what I can tell. Remember to `git fetch --all` first before deleting. + +## 203/EXEC + +The downloaded gitea file is not executable + +``` +Oct 28 00:06:19 git-ldsconnect systemd[1]: gitea.service: Main process exited, code=exited, status=203/EXEC +Oct 28 00:06:19 git-ldsconnect systemd[1]: gitea.service: Unit entered failed state. +Oct 28 00:06:19 git-ldsconnect systemd[1]: gitea.service: Failed with result 'exit-code'. +``` + +Try this: + +```bash +sudo chmod +x /opt/gitea/gitea + +sudo systemctl restart gitea +``` + +**But wait, there's more!** + +This could also be due to missing `rx` permissions on a parent directory of the executable file, which could be the result of having an existing but empty `/etc/tmpfiles.d/gitea.conf` (a necessary tmp folder not being generated on boot). \ No newline at end of file