Scenario: d2-docker commit IMAGE sometimes generates empty databases.
Reason: Sometimes (very infrequently), pg_dump fails (a real example: pg_dump: error: query failed: ERROR: could not open relation with OID 76698183) but d2-docker commit continues as if nothing happened. That's because the process involves a "pg_dump | gzip" pipe, and bash, by default, does not exit with an error if an intermediate command in a pipe fails.
Solution: Enable flag "pipefail" before executing the pipe.
Issue: ??? (consult with Adrian)
Scenario:
d2-docker commit IMAGE
sometimes generates empty databases.Reason: Sometimes (very infrequently), pg_dump fails (a real example:
pg_dump: error: query failed: ERROR: could not open relation with OID 76698183
) but d2-docker commit continues as if nothing happened. That's because the process involves a "pg_dump | gzip" pipe, and bash, by default, does not exit with an error if an intermediate command in a pipe fails.Solution: Enable flag "pipefail" before executing the pipe.