Skip to content

fix: tolerate zip exit code 18 in web server backup#3854

Open
trex0r wants to merge 1 commit intoDokploy:canaryfrom
trex0r:canary
Open

fix: tolerate zip exit code 18 in web server backup#3854
trex0r wants to merge 1 commit intoDokploy:canaryfrom
trex0r:canary

Conversation

@trex0r
Copy link

@trex0r trex0r commented Mar 1, 2026

Addresses this issue: #3853

The zip command exits with code 18 ("completed with warnings, some files not readable"), which execAsync treats as a fatal error — even though

The fix is to wrap the zip execAsync call in a try/catch that tolerates exit code 18 specifically. All other non-zero exit codes still throw as before

Greptile Summary

Wrapped the zip command in a try/catch block to specifically tolerate exit code 18 (warnings about unreadable files like sockets/pipes), allowing backups to succeed despite non-critical warnings. All other errors continue to be thrown as expected. The fix correctly imports ExecError and uses proper instanceof checking with the exit code comparison.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • Score reflects a focused, well-implemented fix that addresses the specific issue without introducing new risks. The error handling is correct and preserves all other error conditions.
  • No files require special attention

Last reviewed commit: 245ad90

(2/5) Greptile learns from your feedback when you react with thumbs up/down!

@trex0r trex0r requested a review from Siumauricio as a code owner March 1, 2026 17:12
@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Mar 1, 2026
@dosubot dosubot bot added the bug Something isn't working label Mar 1, 2026
@dosubot
Copy link

dosubot bot commented Mar 1, 2026

Related Documentation

Checked 7 published document(s) in 1 knowledge base(s). No updates required.

How did I do? Any feedback?  Join Discord

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 file reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Comment on lines +75 to +85
try {
await execAsync(
`cd ${tempDir} && zip -r ${backupFileName} *.sql filesystem/ > /dev/null 2>&1`,
);
} catch (error) {
// zip exit code 18 = "completed with warnings, some files not readable"
// This happens when sockets/pipes exist under /etc/dokploy/ — the archive is still valid
if (!(error instanceof ExecError && error.exitCode === 18)) {
throw error;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider logging when exit code 18 occurs for better observability

Suggested change
try {
await execAsync(
`cd ${tempDir} && zip -r ${backupFileName} *.sql filesystem/ > /dev/null 2>&1`,
);
} catch (error) {
// zip exit code 18 = "completed with warnings, some files not readable"
// This happens when sockets/pipes exist under /etc/dokploy/ — the archive is still valid
if (!(error instanceof ExecError && error.exitCode === 18)) {
throw error;
}
}
try {
await execAsync(
`cd ${tempDir} && zip -r ${backupFileName} *.sql filesystem/ > /dev/null 2>&1`,
);
} catch (error) {
// zip exit code 18 = "completed with warnings, some files not readable"
// This happens when sockets/pipes exist under /etc/dokploy/ — the archive is still valid
if (!(error instanceof ExecError && error.exitCode === 18)) {
throw error;
}
writeStream.write("Backup completed with warnings (some files not readable)\n");
}

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant