After an upgrade I'm facing the problem that gitea is not available anymore:
[root@nixos:~]# curl http://localhost:3000
html/template: "home" is undefined
[root@nixos:~]# systemctl status gitea.service
● gitea.service - gitea
Loaded: loaded (/nix/store/vqkav8yj9bzjwa293x8ck93sh1qsa8ap-unit-gitea.service/gitea.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2020-10-12 17:30:59 CEST; 20min ago
Main PID: 985 (.gitea-wrapped)
Tasks: 10 (limit: 9284)
Memory: 34.8M
CPU: 5.050s
CGroup: /system.slice/gitea.service
└─985 /nix/store/x31i07hfhmfmw0cxs98y5ldgqhvb3v3v-gitea-1.11.8-bin/bin/gitea web
Oct 12 17:38:00 nixos gitea[985]: [Macaron] 2020-10-12 17:38:00: Completed GET / 500 Internal Server Error in 790.442µs
Oct 12 17:40:59 nixos gitea[985]: 2020/10/12 17:40:59 ...ces/mirror/mirror.go:301:Update() [T] Doing: Update
Oct 12 17:40:59 nixos gitea[985]: 2020/10/12 17:40:59 .../xorm/session_raw.go:78:queryRows() [I] [SQL] SELECT `id`, `repo_id`, `interval`, `enable_prune`, `updated_unix`, `next_update_unix` FROM `mirror` WHERE (next_update_unix<=?) AND (>
Oct 12 17:49:32 nixos gitea[985]: [Macaron] 2020-10-12 17:49:32: Started GET / for [::1]
Oct 12 17:49:32 nixos gitea[985]: 2020/10/12 17:49:32 ...s/context/context.go:330:func1() [D] Session ID: 834c78dbb0f6ea3b
Oct 12 17:49:32 nixos gitea[985]: 2020/10/12 17:49:32 ...s/context/context.go:331:func1() [D] CSRF Token: WvUqaZNo0rCXpAuXq9JXLgb_7Es6MTYwMjUxNzc3MjMxMzc4MjA5Nw
Oct 12 17:49:32 nixos gitea[985]: 2020/10/12 17:49:32 ...s/context/context.go:139:HTML() [D] Template: home
Oct 12 17:49:32 nixos gitea[985]: [Macaron] 2020-10-12 17:49:32: Completed GET / 500 Internal Server Error in 340.23µs
Oct 12 17:50:59 nixos gitea[985]: 2020/10/12 17:50:59 ...ces/mirror/mirror.go:301:Update() [T] Doing: Update
Oct 12 17:50:59 nixos gitea[985]: 2020/10/12 17:50:59 .../xorm/session_raw.go:78:queryRows() [I] [SQL] SELECT `id`, `repo_id`, `interval`, `enable_prune`, `updated_unix`, `next_update_unix` FROM `mirror` WHERE (next_update_unix<=?) AND (
[root@nixos:~]# cat /etc/nixos/configuration.nix
{ config, pkgs, lib, ... }:
{
imports = [
./lxd.nix
];
system.autoUpgrade = {
enable = true;
allowReboot = true;
};
nix.gc = {
automatic = true;
options = "-d";
};
time.timeZone = "Europe/Berlin";
services.gitea = {
enable = true;
disableRegistration = true;
rootUrl = "https://git.domain.ltd";
};
systemd.services.gitea.serviceConfig = lib.mkForce {
Type = "simple";
User = config.services.gitea.user;
Group = "gitea";
WorkingDirectory = config.services.gitea.stateDir;
ExecStart = "${pkgs.gitea}/bin/gitea web";
Restart = "always";
};
networking.firewall.extraCommands = ''
ip6tables -A INPUT -p tcp -s 2a01:x:x:x::2/64 --dport 3000 -j ACCEPT
iptables -A INPUT -p tcp -s 10.254.210.0/24 --dport 3000 -j ACCEPT
'';
networking.firewall.extraStopCommands = ''
ip6tables -A INPUT -p tcp -s 2a01:x:x:x::2/64 --dport 3000 -j ACCEPT
iptables -D INPUT -p tcp -s 10.254.210.0/24 --dport 3000 -j ACCEPT
'';
}
Notify maintainers
@srhb
Metadata
[root@nixos:~]# nix-shell -p nix-info --run "nix-info -m"
- system: `"x86_64-linux"`
- host os: `Linux 5.4.0-48-generic, NixOS, 20.03.3107.067d8e6c9f4 (Markhor)`
- multi-user?: `yes`
- sandbox: `yes`
- version: `nix-env (Nix) 2.3.6`
- channels(root): `"nixos-20.03.3107.067d8e6c9f4"`
- nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
ping @Ma27 @etu who also may use this module.
I guess the problem is caused by overwriting systemd.services.gitea.serviceConfig. This causes that app.ini is not reconstructed and so the wrong STATIC_ROOT_PATH is set.