unoverse 0.1.104 → 0.1.105
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -167,15 +167,28 @@
|
|
|
167
167
|
# PACKAGES_PATH any more and docker-compose.yml has no such volume, so the check could
|
|
168
168
|
# only ever report 0 and tell the operator to run a command that would not fix it.
|
|
169
169
|
|
|
170
|
+
# SINCE THE SERVICES RESTARTED, NOT SINCE FIVE MINUTES AGO.
|
|
171
|
+
#
|
|
172
|
+
# A first setup necessarily boots the services before the schema exists — migrations run
|
|
173
|
+
# THROUGH the unoverse container, so there is nothing to run them in until it is up — and
|
|
174
|
+
# db-setup restarts everything afterwards. A fixed five-minute window straddles that
|
|
175
|
+
# restart and reports the pre-migration errors as if they were current: every first
|
|
176
|
+
# deploy ended with 'relation "memories" does not exist' in red, describing a state that
|
|
177
|
+
# had already been fixed two minutes earlier by this very playbook.
|
|
178
|
+
#
|
|
179
|
+
# The question is "is anything wrong NOW", so the window starts when the services did.
|
|
170
180
|
- name: "[12/14] Check for errors in service logs"
|
|
171
181
|
shell: |
|
|
172
182
|
cd /opt/gravity
|
|
173
|
-
|
|
183
|
+
# Newest container start: everything before it belongs to a previous run.
|
|
184
|
+
SINCE=$(docker compose ps -q 2>/dev/null | xargs -r docker inspect -f '{{.State.StartedAt}}' 2>/dev/null | sort | tail -1)
|
|
185
|
+
[ -n "$SINCE" ] || SINCE=5m
|
|
186
|
+
ERRORS=$(docker compose logs --tail=50 --since="$SINCE" 2>&1 | grep -iE 'error|fatal|panic|does not exist|ECONNREFUSED' | grep -v 'NOGROUP' | tail -10)
|
|
174
187
|
if [ -n "$ERRORS" ]; then
|
|
175
188
|
echo "$ERRORS"
|
|
176
189
|
exit 1
|
|
177
190
|
else
|
|
178
|
-
echo "No
|
|
191
|
+
echo "No errors since the services started"
|
|
179
192
|
fi
|
|
180
193
|
register: log_errors
|
|
181
194
|
ignore_errors: yes
|
package/package.json
CHANGED