Commit 3d202f0
Give every service both recovery paths, and build the image instead of pulling
Two problems surfaced the first time this compose file was run end to end.
1. The stack did not start at all, and it had nothing to do with healthchecks.
docker-compose.yml mounts ./dspace/config over the config inside the image, so
the image has to be built from this tree. It is not enough to pull a matching
version: this branch carries code no published image contains - for instance
dspace/config/ehcache.xml references
org.dspace.external.provider.orcid.xml.CacheLogger, which is in dspace-api here
but in neither upstream 7.6.5 nor 7.6.8. A pulled image dies with
"Error parsing XML configuration at file:/dspace/config/ehcache.xml", and before
that with "Could not resolve placeholder 'pubmed.apiKey'".
`docker compose up` builds a missing image on its own, so a clean machine never
sees this. The trap is a stale image from an earlier pull silently shadowing the
build, which makes the failure look like a config problem. DSPACE_VER is now
pinned to the pom.xml version instead of the floating dspace-7_x tag so a newer
upstream image cannot take its place, and the file says so in a comment.
2. Only the backend and the frontend could actually recover.
dspacedb and dspacesolr had neither a restart policy nor the autoheal label, so
"the database goes down and comes back on its own" simply did not happen - it
stayed down. Every service now carries both, because they cover different
failures: the restart policy handles a dead process and an exited container,
the sidecar handles a container that still runs while its healthcheck fails.
Verified by breaking each service in a different way:
dspacedb pg_ctl stop -m immediate -> container exited, RestartCount 0 -> 1,
back to healthy on its own
dspacesolr search core unloaded -> failing streak 1..5 -> unhealthy ->
restarted by the sidecar
dspace chaos flag -> unhealthy -> restarted
dspace-angular ng serve killed -> container exited -> restarted
One correction to an earlier claim in this file: a restart does NOT repair an
unloaded Solr core. precreate-core only checks whether the core directory
exists, so it logs "Core search already exists" and leaves the core
unregistered. The comment now says that, and it is precisely the case the
sidecar's restart budget exists for - it gives up and asks for a human instead
of looping.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>1 parent 77102ad commit 3d202f0
2 files changed
Lines changed: 45 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
2 | 22 | | |
3 | 23 | | |
4 | 24 | | |
| |||
46 | 66 | | |
47 | 67 | | |
48 | 68 | | |
49 | | - | |
| 69 | + | |
50 | 70 | | |
51 | 71 | | |
52 | 72 | | |
| |||
137 | 157 | | |
138 | 158 | | |
139 | 159 | | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
140 | 168 | | |
141 | | - | |
| 169 | + | |
142 | 170 | | |
143 | 171 | | |
144 | 172 | | |
| |||
167 | 195 | | |
168 | 196 | | |
169 | 197 | | |
170 | | - | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
171 | 211 | | |
172 | 212 | | |
173 | 213 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
30 | | - | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
0 commit comments