Skip to content

Instantly share code, notes, and snippets.

@karenc
Last active January 1, 2020 21:39
Show Gist options
  • Save karenc/901aa97bf0bfc79c2832ca55632d7108 to your computer and use it in GitHub Desktop.
Save karenc/901aa97bf0bfc79c2832ca55632d7108 to your computer and use it in GitHub Desktop.

CNX Legacy Tips and Tricks

What is (cnx) legacy?

You can go to the legacy site by clicking on the link "CNX Author | Legacy Site" on the top right corner of a page on cnx.

You can also add legacy to the url, for example:

It is running Plone 2.5.5 with Python 2.5.

What is it used for?

It is used for publishing books. Content managers can now revise (publish a new version of) a book using nebuchadnezzar, but they can't publish a new book using it yet. Publishing new books still requires legacy.

How to set it up locally?

cnx-deploy contains ansible playbooks that create the cnx site and the legacy site, zope.yml is the playbook for creating the legacy site.

Look at the vm environment README for more information about using cnx-deploy locally.

Where is the code and where are the logs?

The base directory is in /var/lib/cnx/cnx-buildout/, which is a checkout of the cnx-buildout repo.

The code that we wrote is mostly in ./eggs/, a lot of the plone core code is in ./parts/plone/.

The config files are in ./parts/*/etc/.

The logs are in ./var/log/.

Which servers run legacy?

You can find this out by looking at the cnx-deploy environment inventory file, for example:

https://github.com/openstax/cnx-deploy/blob/master/environments/prod/inventory#L86-L88

[zclient:children]
prod04
prod05

This means that legacy is running on prod04.cnx.org and prod05.cnx.org.

About ZODB and PostgreSQL

By default, zope uses ZODB (Zope Object Database), but we actually store most of the data in postgresql. You can see the majority of the sql in RhaptosModuleStorage.

How to debug an error?

The best way is to look at a previous issue: openstax/cnx#757. The user was unable to access their workspace because of an AttributeError.

Here is a wiki page which includes all the debugging comments in the issue: Legacy Workspace Error

If you are seeing the exact error, there is already a script to fix the user workspace. It is in the solution section at the bottom of the wiki page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment