Repository navigation
Replication: find node files with a space in the name - #2097
Merged
fog-workflows[bot] merged 1 commit intoNov 13, 2026
Merged
Conversation
FOGFTP::exists() split each LIST line on every space and took the 9th field as the name, so "7450 AIO-WIN11-A10-YHP57.CAB" became "7450". The file never existed on the node, rawsize() reported 0, and the image replicator deleted and copied it again every cycle (forum 18313). The recursive delete parsed the same lines. Both now read the name through _listName(), which splits into at most 9 fields and drops a symlink's " -> target". replicateItems() tested the node's getsize.php reply with is_int(). A response body is a string, so that never matched, and every remote size came from the FTP listing. It now accepts an all-digit reply. A reply that is not digits falls back to HTTPS, then FTP, as before. tests/ftp-exists-name-with-spaces runs the shipped exists() against a vsftpd-shaped listing and fails on the old split. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Forum 18313: the image replicator copied the same files again every cycle.
A name with a space never existed on the node.
FOGFTP::exists()split each LIST line on every space and took the 9th field as the name. So7450 AIO-WIN11-A10-YHP57.CABbecame7450.rawsize()then reported 0, and the replicator deleted the file and copied it again on every cycle. The poster's log shows this for every file with a space (718000218 != 0). The recursive delete parsed the same lines. Both now read the name through_listName(), which splits into at most 9 fields and drops a symlink's-> target.The HTTP remote size was never used.
replicateItems()tested the node'sgetsize.phpreply withis_int().FOGURLRequests::process()returns the body as a string, so that test never matched, and every remote size came from the FTP listing. It now accepts an all-digit reply. A reply that is not digits still falls back to HTTPS, then FTP. Behavior change: the replicator now trustsgetsize.phpfirst, which was the intended order.Both bugs are the same in 1.5.10.
The same log also shows files with no space reporting the same smaller node size every hour, on both nodes. This PR does not claim to explain that. The poster has been asked for
ls -land the lftp transfer log.tests/ftp-exists-name-with-spaces.test.phpruns the shippedexists()against a vsftpd-shaped listing. It fails on the old split. Both phpstan passes are clean.🤖 Generated with Claude Code