Last modified: 2014-09-23 23:26:36 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T72054, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 70054 - [scap] Syncing wmf-config/PrivateSettings.php syncs symlink and not file contents
[scap] Syncing wmf-config/PrivateSettings.php syncs symlink and not file cont...
Status: NEW
Product: Wikimedia
Classification: Unclassified
Deployment systems (Other open bugs)
wmf-deployment
All All
: Low normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-08-26 17:56 UTC by Bryan Davis
Modified: 2014-09-23 23:26 UTC (History)
7 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Bryan Davis 2014-08-26 17:56:23 UTC
Chad tripped over this today in prod. He made a change to /a/common/wmf-config/PrivateSettings.php (which is a symlink to /a/common/private/PrivateSettings.php) and then ran `sync-file wmf-config/PrivateSettings.php` to sync the file with the cluster.

This resulted in an rsync command similar to this running on each cluster host:

sudo -u mwdeploy -n -- /usr/bin/rsync --archive --delete-delay --delay-updates --compress --delete --exclude=**/.svn/lock --exclude=**/.git/objects --exclude=**/.git/**/objects --exclude=**/cache/l10n/*.cdb --no-perms --include=/wmf-config --include=/wmf-config/PrivateSettings.php --exclude=* tin.eqiad.wmnet::common /usr/local/apache/common-local

Scap is dutifully syncing the file that it was asked to sync, but that file is just a symlink so rsync will only actually sync a symlink and not the contents of the file the symlink points to on tin.

The manual fix that a deployer can use is to run `sync-file private/PrivateSettings.php` instead to sync the actual file rather than the symlink. This seems error prone to say the least however. Scap should do something (at least emit a warning) when asked to sync a symlink. Ideally it could sync both the symlink and the target file but that may be too much magic.
Comment 1 Nik Everett 2014-08-26 18:18:43 UTC
I like warning you here - sometimes you want to sync out a symlink?  Probably.
Comment 2 Antoine "hashar" Musso (WMF) 2014-08-27 15:34:52 UTC
I can imagine how one get tricked in that:

 vim symlink.txt
 sync-file symlink.txt

+1 on emitting a warning that a symlink is being send instead of the actual target.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links