Project

General

Profile

Troubleshooting » History » Version 4

Redmine Admin, 10/31/2026 07:01 PM
deploy-publish.sh

1 4 Redmine Admin
*Chapter 7 of the dmz-web documentation · headings are numbered like the cheat sheets · index: [[Wiki]]*
2 1 Redmine Admin
3 4 Redmine Admin
{{>toc}}
4
5
## 7.1 What is up right now?
6
7 2 Redmine Admin
```bash
8 1 Redmine Admin
~/deploy/check-sites.sh                          # every site-* container: status + HTTP answer through NPM
9
podman ps --format 'table {{.Names}}\t{{.Status}}\t{{.Networks}}'
10
systemctl --user list-units 'net-*' 'db-*' 'site-*' 'nginx-proxy-manager*' --no-pager
11 2 Redmine Admin
systemctl --user --failed                        # anything that died
12 1 Redmine Admin
```
13 2 Redmine Admin
14 4 Redmine Admin
## 7.2 What is defined (even if not running)?
15 2 Redmine Admin
16
```bash
17 1 Redmine Admin
ls ~/.config/containers/systemd/                 # the live units = the list of sites
18
systemctl --user list-unit-files 'net-*' 'db-*' 'site-*' 'nginx-proxy-manager*'
19
podman ps -a                                     # containers incl. stopped/exited
20
podman volume ls ; podman network ls ; podman secret ls
21
/usr/libexec/podman/quadlet -dryrun -user 2>&1 | grep -iE 'error|warn'   # unit syntax problems
22
```
23 2 Redmine Admin
24
A site = `net-<name>.network` + `db-<name>.container` + `site-<name>.container`
25 1 Redmine Admin
(+ `.volume` files). If the files are there and `podman ps` doesn't show the
26 2 Redmine Admin
containers, the services are stopped or failed — see next.
27 1 Redmine Admin
28 4 Redmine Admin
## 7.3 Bringing a site back
29 2 Redmine Admin
30
Order matters (network → db → site); `Requires=`/`After=` do it for you when
31
you start the site unit, but starting them one by one shows where it fails:
32
33
```bash
34 1 Redmine Admin
systemctl --user start net-<name>-network.service
35
systemctl --user start db-<name>.service   && sleep 5 && podman logs --tail 20 db-<name>
36
systemctl --user start site-<name>.service && sleep 5 && podman logs --tail 20 site-<name>
37
systemctl --user status site-<name>.service --no-pager
38
journalctl --user -u site-<name>.service -e --no-pager | tail -30
39
```
40 2 Redmine Admin
41
Typical causes: image pull failed (no egress / registry down) → `podman pull <image>`;
42 1 Redmine Admin
secret missing → `podman secret ls` (a container whose `Secret=` is missing
43 2 Redmine Admin
won't start); volume removed → the DB initialises **empty** on next start, stop
44
immediately and restore from backup; `Restart=always` loop → `podman logs`.
45
46 4 Redmine Admin
## 7.4 NPM says 502 / site unreachable but container is up
47 2 Redmine Admin
48
```bash
49 1 Redmine Admin
podman inspect nginx-proxy-manager | jq '.[0].NetworkSettings.Networks | keys'   # must list net-<name>
50
podman network inspect net-<name> | jq '.[0].containers | map(.name)'            # db, site, nginx-proxy-manager
51
podman exec nginx-proxy-manager sh -c 'getent hosts site-<name>; curl -sI http://site-<name>/ | head -1'
52
```
53 2 Redmine Admin
54
NPM not in the network → the live `nginx-proxy-manager.container` lost the
55 1 Redmine Admin
`Network=` line (see [[NPM]]) → fix the unit, `cp`, `daemon-reload`,
56 2 Redmine Admin
`restart nginx-proxy-manager.service`. Name doesn't resolve inside NPM → NPM
57
joined the network after it started → same restart. Restarting NPM interrupts
58
**all** sites for ~10–20 s.
59
60 4 Redmine Admin
## 7.5 Snipe-IT shows HTTP 500 — how do I find out why?
61 3 Redmine Admin
62
The long `#67 /var/www/html/vendor/...` list is only the request path. The cause is
63
the `production.ERROR:` line above it:
64
65
```bash
66
podman exec site-snipeit sh -c 'grep -nE "production\.(ERROR|CRITICAL)" /var/www/html/storage/logs/laravel.log | cut -c1-400 | tail -8'
67
```
68
69
* `Email "${MAIL_ENV_FROM_ADDR}" does not comply with addr-spec of RFC 2822` → From/Reply-To
70
  were never set; the image's placeholder is not an address. Set `MAIL_FROM_ADDR` and
71
  `MAIL_REPLYTO_ADDR` in the unit (Snipe-IT chapter, "Mail"). It only breaks the email step;
72 1 Redmine Admin
  the record itself (e.g. the new user) is saved.
73 3 Redmine Admin
* `Table 'snipeit.password_resets' doesn't exist` from `auth:clear-resets`, repeating every
74
  15 minutes → the scheduler is running against a database whose tables were not created yet
75
  (pre-flight "Create database tables" not clicked). In this install the errors stopped once
76
  the tables existed. Check: `podman exec db-snipeit sh -c 'mariadb -uroot -p"$MYSQL_ROOT_PASSWORD" -e "show tables from snipeit like \"password%\""'`.
77
78 4 Redmine Admin
## 7.6 Snipe-IT mail: `451 4.4.4 ... ATTR5` from Exchange
79 3 Redmine Admin
80
Seen in the tinker test above when the recipient was external. It is **not** an authentication
81
or TLS problem and not a Snipe-IT setting: Exchange accepted the connection, then refused a
82 1 Redmine Admin
message to a recipient outside the tenant. First thing to establish is whether internal works:
83 3 Redmine Admin
send the test to `sysadmin@mdsdefense.com` (passes here). If internal passes and external
84
fails, look at the connector / relay permission in Exchange, not at the unit. If **internal
85
also** fails, compare the From address with Redmine's (Administration → Settings → Email
86
notifications → "Emission email address") and the host's egress IP with the connector's IP list
87
(`curl -s https://api.ipify.org` on the host).
88
89 4 Redmine Admin
## 7.7 Does it come back after a reboot?
90 2 Redmine Admin
91 1 Redmine Admin
Yes, by design, if three things hold:
92
93 2 Redmine Admin
1. **Lingering** for websvcmaster (the user manager starts at boot without a login):
94
   `loginctl show-user websvcmaster | grep Linger` → `Linger=yes` (root: `loginctl enable-linger websvcmaster`).
95
2. Every unit has `[Install] WantedBy=default.target` — Quadlet units are
96
   *enabled by that section*, not by `systemctl enable` (which doesn't work on
97 1 Redmine Admin
   generated units). Check: `grep -L 'WantedBy=default.target' ~/.config/containers/systemd/*.container`
98 2 Redmine Admin
   → must print nothing.
99
3. `Restart=always` in `[Service]` so a crash is retried.
100 1 Redmine Admin
101 2 Redmine Admin
Dry test without rebooting: `systemctl --user stop site-<name>.service db-<name>.service && systemctl --user start default.target`
102
→ both come back. Real test: reboot the host, then `check-sites.sh` after ~2 min
103
(MariaDB + Puma + Apache need a moment).
104
105 4 Redmine Admin
## 7.8 After a host reboot — checklist
106 2 Redmine Admin
107
```bash
108 1 Redmine Admin
loginctl show-user websvcmaster | grep Linger     # yes
109
systemctl --user --failed                         # empty
110
~/deploy/check-sites.sh                           # all 200/30x
111
firewall-cmd --list-all                           # (root) 81/444 + 8181 rich rules still there
112 2 Redmine Admin
```
113
114 4 Redmine Admin
## 7.9 Data safety reminders
115 2 Redmine Admin
116
* Secrets live only in `~/.local/share/containers/storage/secrets/` — back up
117
  that directory (or re-create the secrets from your password store); without
118
  `snipeit-app-key` the Snipe-IT DB is unreadable, without the DB secrets the
119
  containers won't start.
120
* Volumes: `podman volume export <vol> > file.tar` / `podman volume import <vol> file.tar`,
121
  plus DB dumps ([[WordPress]], [[Redmine]], [[Snipe-IT]]).
122
* `podman system reset` or removing `~/.local/share/containers` deletes
123
  **everything** above; never run it on this host.
124
125
---
126
_Source: `dmz-web-podman-cheatsheet.md` v1.2 in the `dmz-web-deploy` repo ([[Releases]]). Edit the wiki and the repo copy together._