phacility/phabricator · warning · Exception
Write rate must be more than 0 bytes/sec.
Error message
Write rate must be more than 0 bytes/sec.
What it means
Thrown by 'bin/harbormaster write-log' after stdin has been read, when --rate is given with a value of 0 or less. The rate artificially paces log writes (str_split into rate-sized chunks) to exercise live streaming; a non-positive rate cannot pace anything, so a plain Exception aborts the command.
Source
Thrown at src/applications/harbormaster/management/HarbormasterManagementWriteLogWorkflow.php:68
$log = HarbormasterBuildLog::initializeNewBuildLog($target);
$log->openBuildLog();
echo tsprintf(
"%s\n\n __%s__\n\n",
pht('Opened a new build log:'),
PhabricatorEnv::getURI($log->getURI()));
echo tsprintf(
"%s\n",
pht('Reading log content from stdin...'));
$content = file_get_contents('php://stdin');
$rate = $args->getArg('rate');
if ($rate) {
if ($rate <= 0) {
throw new Exception(
pht(
'Write rate must be more than 0 bytes/sec.'));
}
echo tsprintf(
"%s\n",
pht('Writing log, slowly...'));
$offset = 0;
$total = strlen($content);
$pieces = str_split($content, $rate);
$bar = id(new PhutilConsoleProgressBar())
->setTotal($total);
foreach ($pieces as $piece) {
$log->append($piece);
$bar->update(strlen($piece));View on GitHub (pinned to 5720a38cfe)
Solutions
- Use a positive integer rate in bytes/sec, e.g. '--rate 1024'
- Omit --rate entirely to write at full speed
- Validate computed rate values in scripts before passing them through
Example fix
# before $ bin/harbormaster write-log --target 33 --rate 0 # after $ bin/harbormaster write-log --target 33 --rate 1024
Defensive patterns
Strategy: validation
Validate before calling
if ($rate !== null && $rate <= 0) {
// reject before invoking write-log; omit --rate for unlimited speed
} Prevention
- Omit --rate instead of passing 0 or -1 when you want full-speed writes
- Sanitize computed rate values in wrapper scripts (positive integers only)
When it happens
Trigger: Running 'bin/harbormaster write-log --target 33 --rate 0' or with any negative rate; a script computing the rate from a division that yields 0.
Common situations: Passing --rate 0 or -1 intending 'no limit' (the flag should simply be omitted); computed rate values that underflow to zero in wrapper scripts.
Related errors
- Choose a build log to rebuild with "--id", or rebuild all lo
- You can not specify both "--id" and "--all". Choose one or t
- Unable to load build log "%s".
- Choose a build target to attach the log to with "--target".
- Storage type "%s" is unknown. Supported types are: %s.
AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21).
Data as JSON: /api/errors/5f5c326fdde2f42c.
Report an issue: GitHub.