Problems symlinking files directory

Events happening in the community are now at Drupal community events on www.drupal.org.
ckosloff's picture

I want to symlink files directory as omega8cc recommends.
I have a test site at /data/disk/o1/platforms/002/drupal-7.27.1-dev.
That is what I see in filezilla and it works, because that is where I upload modules, libraries and themes, in the /all directory.
I want to move the site's files directory to static/files/mytestsite/files, and symlink back from there.
I ssh as root to one of my server's IPs and I can navigate up to platforms, here is where the problem starts because:

web01:/data/disk/o1/platforms# ls -al
total 8.0K
drwx--x--x 2 o1 users 4.0K Jan 29 10:23 ./
drwx--x--x 19 o1 users 4.0K Apr 22 11:20 ../
web01:/data/disk/o1/platforms# cd 002
-bash: cd: 002: No such file or directory
web01:/data/disk/o1/platforms# cd /002
-bash: cd: /002: No such file or directory
web01:/data/disk/o1/platforms#

I cannot access the files directory to move it.

Comments

ln -s

ckosloff's picture

ln -s /data/disk/USER/static/foo_files /path/to/platform/sites/foo.com/files
This is what is happening: I can get to first part of command, however I cannot find where the site is under platforms, it does not show.
It is a sub-domain for testing, which I can access via SFTP and octopus.

SOLVED

ckosloff's picture

Here is an excerpt of an email exchange with a friend of mine, also a BOA user. Some paths were modified to generic, since this is public.

Here is what I did.
Finally found the freakin test site at:
/data/disk/o1/distro/002/drupal-7.27.1-dev/sites/my_test_site.com/files
Then downloaded the 'files' directory to my HDD via SFTP with Filezilla, just to be in the safe side, if something went wrong I could always upload it back.
Then went to /data/disk/o1/static, created directory 'files' with mkdir files, inside created directory 'my_test_site'.
Uploaded directory 'files' from my HDD to 'my_test_site', so now it was there.
Next deleted directory 'files' from /data/disk/o1/distro/002/drupal-7.27.1-dev/sites/my_test_site.com.
It is a tricky process, need to remove all files from sub-directories, then remove subdirectories, then the 'files' directory itself.
Next comes the symlink:
web01:/data/disk/o1/static/files/my_test_site# ln -s files /data/disk/o1/distro/002/drupal-7.27.1-dev/sites/my_test_site.com/files -v
/data/disk/o1/distro/002/drupal-7.27.1-dev/sites/my_test_site.com/files' ->files'
Tested and BINGO!
Bear in mind: -v option is just to make sure everything OK, better be in the directory just above the files you are going to symlink, see my command above.
Couple more things.
Use 'rm' to delete files and 'rmdir' to remove directories.
All this could also have been done with the 'mv' command first, to move directory 'files' in test site to static location, but since the paths are so intricate I preferred to help myself with Filezilla.
Filezilla works recursively so it moves directory's whole structure, with subdirectories and files, very useful tool.
Symlink and test are the last steps.
Check your own setup to see if it works for you.

I wish omega8's instructions

ckosloff's picture

I wish omega8's instructions were clearer and more user-friendly, test site was not under 'platform' but under 'distro'. It cost me hours of frustration to figure this out.

There is a terribly outdated

muschpusch's picture

There is a terribly outdated community documentation over here:

https://drupal.org/node/1741624

Feel free to update and add your own stuff.... Please also keep in mind omega8cc is a hosting company sharing it's server stack with us maybe ask acquia or pantheon to share their docs and tech stack ;)

I bow to omega8.cc, they are

ckosloff's picture

I bow to omega8.cc, they are unique for sharing their tech stack and making it public.
I think that it is up to the user community to build updated docs and a knowledge base, that is what I meant.
I take advantage of the occasion to float an idea: how about a phpbb forum to share discussions, articles, videos, etc.?, because the format in Drupal groups is not very friendly either.
I am willing to host it, so I can also learn there.
How about that?

I think current issues are

muschpusch's picture

I think current issues are handled on the github site but the drupal.org issue queue is still active too. There were some good screencasts about how to work with aegir but i can't find them back right now...

Did you check omega8cc learning library?

https://omega8.cc/library/aegir-basics-index

Then of course the 'official' documentation links to the txt files on the project page.

There is also an IRC channel which is... Not dead but pretty quiet. I started updating the community docs a while ago but development is going pretty fast and documenting stuff you don't develop yourself is a pretty annoying task. What would be awesome is documentation of the xdrago shell scripts but i'm no sysadmin just a BOA user... So i only look in their if something is broken... With the drupal groups page we have quit a lot of places to look for info. Imho it's scattered to much already....

I think more important than a

juc1's picture

I think more important than a new forum is better documentation - and "better" means presentation ie I am not saying the info is not out there just that its presentation could be more user-friendly. For me the gold standard of documentation is something like the Linode Library articles - random example =
https://library.linode.com/migration/migrate-server-to-linode

or Digital Ocean articles - random example =
https://www.digitalocean.com/community/articles/how-to-install-git-on-ub...

The key features of this standard are screenshots where appropriate, clear instructions including commands without skipping steps, and a manageable topic in terms of size.

In contrast to this style documentation on Drupal (re BOA or other subjects) such as https://drupal.org/node/1741624 mentioned by muschpusch above tends to have no screenshots and skips quickly to a new topic.

So like the Linode "Library" there could be a BOA library aimed at different BOA users - beginners, intermediate etc

Anyway I am putting together some Linode library style articles on BOA basics, hopefully ready soon...

We discussed this in the IRC

ckosloff's picture

We discussed this in the IRC channel.
The forum is just a suggestion to organize documentation, there may be better options.
I have been to Linode's library, it is very outdated, still a good effort, learned a lot there.
Anyway, I am all for better organizing docs and will contribute in any way I can.
Now to the issue that originally started this discussion.
I will have to revise everything I wrote above.
Athough theoretically it is all good and I get no WSOD, reports still howl with errors about the directory not configured properly.
The symlink is there and the perms are right, but still getting errors.
I tried every possible permutation and still SOL with errors.
I am starting to wonder if it is at all possible to symlink without errors.
Anyway I will continue to revise syntax and post here my findings, or write documentation and post it in above link.
Lastly, some of you guys must have run into this symlink thing.
What were your experiences with it?

Yes, checked the syntax for

ckosloff's picture

@muschpusch
Yes, checked the syntax for symlinks in "best recipes for disaster #5" several times.
I will do a last round of testing then submit issue to github, hope to get a response in a timely manner.
Where is this group's issue queue? MIght try that one too.
Thank you.

Screencasts

ckosloff's picture

@muschpusch: I think that you have in mind Victor Cardoso's playlist in YouTube: https://www.youtube.com/playlist?list=PL2ucNtcK94LC9aBCcfAtVsUr3agcmFNwl

@ ckosloff if you created the

juc1's picture

@ ckosloff if you created the platform manually yourself then it is possible that the platform permissions are wrong but I think you said this platform was created by the Octopus script.

reports still howl with errors about the directory not configured properly. The symlink is there and the perms are right, but still getting errors.

I think to get any help you would need to say specifically what errors you are getting.

I am starting to wonder if it is at all possible to symlink without errors...some of you guys must have run into this symlink thing.

I haven't had a problem with creating symlinks, my notes are here.

You checked this already? If

muschpusch's picture

You checked this already?

If you have skipped some recent BOA releases, and you have new default config
option: _PERMISSIONS_FIX=NO in your /root/.barracuda.cnf configuration file,
plus, you are not sure if you follow best practices for managing permissions
as recommended in our docs: https://omega8.cc/node/116 then we recommend
that you change it to _PERMISSIONS_FIX=YES temporarily, or even permanently
if your VPS is fast enough, and then run this powerful script as root:

$ bash /var/xdrago/daily.sh

I still am at a complete

ckosloff's picture

I still am at a complete loss.
Platform was created by script so perms should be OK.
I deleted the old test site that was creating problems and started anew.
Reports showed OK, then moved files dir to ~static, logged in as root from the parent directory:

mv files /data/disk/o1/static/test1_files

move OK, I went bad here because chmoded to 775, realized my mistake after reading above then chmoded to 777.
Symlink syntax should be OK, because the symlink shows in
/data/disk/01/distro/002/drupal-7.27.1-dev/sites/subdomain.foo.com and it points to test1_files in ~static.
Site layout is broken and error message is:
"The specified file temporary://file3ty7oW could not be copied, because the destination directory is not properly configured. This may be caused by a problem with file or directory permissions. More information is available in the system log."
So probably it is a perm or ownership problem.
I noticed that while all dirs except private (owned by o1:www-data), are owned by o1:users, the symlink is owned by root:root, tried to chown but system cannot dereference.
Then tried muschpusch suggestion, edited .barracuda.cnf to YES and ran the script, only got this warning:
chown: cannot access `/data/all///sites': No such file or directory
Apart from that all perms were fixed.
I'll keep trying and expect more suggestions, please help as it is critical for me to solve this problem, my livelihood is at stake.
PS: chowned test1_files in static from o1:www-data to o1:users, and still SOL.

Finally solved

ckosloff's picture

I got help in the IRC channel from juc1 and finally solved.
Problem was that I was symlinking in the wrong direction.
I don't want anybody to be misled by everything that I wrote above in haste, or maybe desperation, so I will write down some simple steps that may be additional help to juc1 tut in above link.
1) Follow instructions in the link posted by muschpusch before doing anything. You must manually chmod 777 files inside your files directory, not the directory itself, as the article explains.
Assuming that you are in your sites' directory and that o1 is your user name (example /data/disk/o1/distro/002/drupal.x.x/sites/testsite.com), the syntax would be:

chmod 777 files/* -Rv

I added the v to have visual confirmation.
2) Move files directory to static (recommended).
Forget Filezilla, moving directory to your HDD is not good idea, perms might be altered depending on location, and it is slow.
The mv command is much faster and accurate:

mv files /data/disk/o1/static/testfiles

The mv command both moves and renames.
3) Check that there is no files directory in your site, not even empty, and that it is present in the static location.
4) Now comes the symlink, it is done from the site's location, so if you are in the example location /data/disk/o1/distro/002/drupal.x.x/sites/testsite.com, syntax would be:

ln -s files /data/disk/o1/static/testfiles -v

You should see visual confirmation and if you do command ls -al you should also see the symlink.
You should not get errors in the status report, if you follow these foolproof steps you should be OK.

BOA

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: