Tag Archives: Cyn.in

Deploying Cyn.in 3.1.3 on CentOS 5.4

Last week we were upgrading Cyn.in to the latest version. After a few days of testing on a local server it was time to deploy it to the server.

Since Cyn.in needs quite some RAM to operate normally, we chose Virpus VPS instance with 2 gigs of RAM, running CentOS 5.4.

Running buildout on the server produced this error:

...
Modules/constants.c: In function ‘LDAPinit_constants’:
Modules/constants.c:184: error: ‘LDAP_OPT_X_TLS_NEWCTX’ undeclared (first use in this function)
Modules/constants.c:184: error: (Each undeclared identifier is reported only once
Modules/constants.c:184: error: for each function it appears in.)

After a bit of googling around it seemed that the problem was caused by a bug in python-ldap. A quick look at CHANGES revealed that 2.3.10 version of python-ldap mentions work being done around LDAP_OPT_X_TLS_NEWCTX. Maybe it was fixed in the next version, 2.3.11?

I tried pinning the version of python-ldap to 2.3.11 and buildout finished without errors. Great!

Adding the following lines to buildout.cfg makes buildout more repeatable and future-proof:

versions = versions

[versions]
python-ldap = 2.3.11

Upgrade Cyn.in 2.1 to 3.1.3

We started using Cyn.in for internal documentation repository about 2 years ago. We are a small team of developers and we don’t use all of it’s features, but we still do use it daily and have grown to love it. It’s just great to have a place to store all little bits and pieces of information and have it searchable quickly.

Now it was time to upgrade it so we keep up with the community around it in case anything goes wrong. Here’s how we did it.

Prepare a new version of Cyn.in

Obviously you first need to get the newest version of Cyn.in up and running locally. Following Cynapse’s guide on buildout helps you do it without much pain. When you have the environment ready, start up Zope and try if your Cyn.in installation works on a plain Plone instance.

Upgrade Data.fs

When you have confirmed that Cyn.in works it’s time to upgrade the actual data.

  • Shutdown Zope and remove everything in var/filestorage/ folder.
  • Copy Data.fs from your old Cyn.in installation into var/filestorage/ folder.
  • Start Zope.
  • Go to http://localhost:8080/<plone_instance_id>/portal_migration and migrate Plone content to the latest Plone version
  • Go to http://localhost:8080/<plone_instance_id>/portal_quickinstaller and reinstall ubify.site_policy.

The reinstall will fail at this point. We had to perform the following (ugly) patches for reinstall to work:

  • In file src/ubify.policy/ubify/policy/migration/onetimeinstall.py comment out line 114:
- logger.info("Unable to assign collection portlet for smartview : %s" % (item["id"],))
+ # logger.info("Unable to assign collection portlet for smartview : %s" % (item["id"],))
+ pass
  • In file eggs/Products.CMFQuickInstallerTool-2.1.7-py2.4.egg/Products/CMFQuickInstallerTool/QuickInstallerTool.py comment out lines 550 and 592:
- msg=str(res)
+ # msg=str(res)

- res += str(r)+'\n'
+ # res += str(r)+'\n'
+ pass

That’s it. After a successful reinstall of ubify.policy we were able to use our old data in a new version of Cyn.in. Only a matter of deploying the new version along with migrated Data.fs to the server and we were able to start using it. Hooray!