Ansible-playbook-provisioned plone client - Permission denied when attempting to launch client

Sending to /dev/null is my lazy quick and dirty solution just to prove that it works.
The log file is much better, probably split it into a buildout.error.log for stderr and a buildout.log for stdout.

This unfortunately can happen in multiple places -- like a big packages update. We can fix it on the buildout, but not everywhere. So, this really needs to get fixed by Ansible.

agreed

I ran into this issue today on a Digital Ocean, 512MB, Ubuntu 14.04, Ansible 2.3.0.0.

I tried changing the main.yml line to @pigeonflight's

shell: bin/buildout > /dev/null 2>&1

But the error is essentially the same.

TASK [plone.plone_server : Run buildout - output goes to /usr/local/plone-5.0/zeoserver/buildout.log] ******************************************************
fatal: [ibew.stevepiercy.us]: FAILED! => {"changed": true, "cmd": "bin/buildout > /dev/null 2>&1", "delta": "0:00:17.152622", "end": "2017-05-21 22:29:38.031577", "failed": true, "rc": 1, "start": "2017-05-21 22:29:20.878955", "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []}
        to retry, use: --limit @/Users/stevepiercy/projects/ibew-plone/ansible-playbook/playbook.retry

I've tried running Ansible five times now, but still the problem persists.

I've also tried appending the --limit argument for a full command of ansible-playbook playbook.yml -K --limit @/Users/stevepiercy/projects/ibew-plone/ansible-playbook/playbook.retry.

I'm going to try a 16.04 later tonight.

Anyone got any suggestions? Ping @smcmahon

To answer my own question, I realized that I ought to actually read that log file. Duh! Lo and behold:

Getting distribution for 'lxml==3.5.0'.
x86_64-linux-gnu-gcc: internal compiler error: Killed (program cc1)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.8/README.Bugs> for instructions.
Building lxml version 3.5.0.
Building without Cython.
Using build configuration of libxslt 1.1.28
Compile failed: command 'x86_64-linux-gnu-gcc' failed with exit status 4
error: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 4
An error occurred when trying to install lxml 3.5.0. Look above this message for any errors that were output by easy_install.
While:
  Installing client1.
  Getting distribution for 'lxml==3.5.0'.
Error: Couldn't install: lxml 3.5.0

And I recalled that someone was trying this on DO before and found that the 512MB droplet was too small to install lxml. I'm going to resize it to a 1GB instance and try again.

You can install lxml on a 512 MB DO droplet, but you need to give it some swap space. The default instructions on DO's KB article are sufficient.

Thanks @fulv. Good to know. I went with temporarily increasing it to 1GB without changing the disk size, running the Ansible playbook again (this time successfully), then shrank the image back down to 512MB. This process seems easier and quicker. Additionally this article said that swap on SSDs can cause issues with hardware degradation, and I'd like to be a good citizen.

1 Like

Might be nice to document this someplace like docs.plone.org or in the Ansible playbook docs

This should go into the docs in the playbook repo, we fetch these during build.

IMHO in general, we should see (speaking here long term) which benefit is has to stay with 512 MB.

Sure it is possible and it is a bit cheaper, true this would be a plus, on the other site telling people to setup swap or increasing and shrinking later is not that user friendly :slight_smile:
For sure is you are less experienced, for those people it is way better, smother and less confronting to go straight for the 1 G.
Plone is not a static site generator....
One other point is also that Plone 5 got 'heavier' a site creation in a vanilla Plone 5, asks more resources than the same on Plone 4. True that is not important for this topic here, but still from interest if you look at the big picture in long term about hardware specs and resources :slight_smile:

1 Like

Submitted PR

1 Like

@svx IMO we should be making the extra effort for plone to work on free tier or cheap tier with minimal effort even if it doesn't work as well. If someone can trial something or run a small site of their own for free or next to free then they are MUCH more likely to be committed to investing more money to make it run properly. or telling their boss that this is the right CMS to use and spending $$$ on a integrator and hosting and support contracts. Then we all win.

Of course, but not working "as well" doesn't mean it didn't complete the installation at all and gave you an obscure/opaque error.

Encountering an error even though you followed instructions is more off-putting than knowing up front that you should pay $5 (or try it on a local computer of your own...)

Since its a popular hosting option is there anyway to make this installation easier?

  • I'm guessing ansible installing the swap is out of the question?
  • or perhaps we can have a precompiled wheel or egg for lxml just for that platform?
  • or is there a way to fiddle with the compile arguments in the buildout to make it compile within 512mb?

@tkimnguyen I was more reacting to the implication that we should recommend users don't install on 512 as a way to prevent this problem. The updated manual looks like a better solution.

1 Like

These are good suggestions.

If someone is able to make a PR for the Ansible playbook, that would be ideal, but it would of course have to be an option, not something done generally.

Letting ansible add swap space seems perfectly reasonable to me. Here is how it could work:

  1. Add an option to the ansible-playbook, e.g. add_swapfile.
  2. This option could be either boolean or allow specifying a size.
  3. Documentation-wise, it could be added to https://github.com/plone/ansible-playbook/blob/master/docs/system.rst
  4. Set the default here: https://github.com/plone/ansible-playbook/blob/master/roles/default_config/defaults/main.yml
  5. It might need its own role in order to keep the main playbook clean and be executed at the end of pre_tasks.
  6. Enable it by default only in the sample-very-small.yml template.
  7. The role would need to handle the various supported OS flavors.

By default, I would skip adding it to /etc/fstab, that way the swap file only remains active until the next reboot and we can call ourselves good citizens. As far as I can see, the only thing it's needed for is building lxml. If there is any reason why it would make sense to make the swap file permanent, that could be an additional option.

2 Likes

I'm not sure what others do but I tend to use swap with plone because there is so much code loaded and lots never used that I find it makes better use of memory to have infrequent parts of plone is swap. A small permanent swap might work better if the cache is set right. I haven't tested this empirically however.

By not making the swap file permanent I was (and @stevepiercy was, too) referring to the note that's on all DO tutorial pages:

Although swap is generally recommended for systems utilizing traditional spinning hard drives, using swap with SSDs can cause issues with hardware degradation over time. Due to this consideration, we do not recommend enabling swap on DigitalOcean or any other provider that utilizes SSD storage. Doing so can impact the reliability of the underlying hardware for you and your neighbors.

If you need to improve the performance of your server, we recommend upgrading your Droplet. This will lead to better results in general and will decrease the likelihood of contributing to hardware issues that can affect your service.

(e.g.: How To Add Swap on Ubuntu 14.04 | DigitalOcean)

1 Like

That is based on the idea that you actually swap things in an out.
I'm saying a typical Plone use of memory is something like 180MB code + 200MB of ZODB cache per process for example. My guess is that probably only 50MB of that code is used regularly. So that means you can have a larger cache (or 2 threads) and eventually the remaining 150MB of code in RAM will end up in swap and never get loaded so no harm done. As long as you manage your cache limits to ensure that never ends up in swap. I'm not sure its possible to manage the limits in such a way as to ensure this for a generic case that would be need for an ansible droplet.
Of course another solution is to find out what thats in that 180MB thats loaded on a plone site that has no requests and find a way to unload crap we don't need :slight_smile:

@fulv but you are probably right that the safest bet is to use swap just during initial buildout. It's a good enhancement that mean people won't complain anymore :slight_smile:

1 Like

Worth mentioning: linode has a $5 per month tier with 1GB ram.