| Problems with added/updated pages in article tree in postgres setting | Daniel Holbach | 18/10/15 18:26 | Hello everybody, for https://developer.ubuntu.com we use Django CMS and we're very happy with it. Recently we added the functionality for us to import markdown docs from bzr branches of projects, so we can have cronjobs update articles for us whenever things changed in some of the upstream projects we are interested in. It took me some time to complete it, but we got it working. Locally I used sqlite (the default) and was happy. Once it was deployed to staging, the import worked as well, but the articles which were added or updated by the script ended up in a different place in the article tree. After some time I could reproduce this with a local postgres installation. We are currently tracking the issue here: https://bugs.launchpad.net/developer-ubuntu-com/+bug/1506861 I'm a bit lost and don't quite know how to debug this. I put together a test-case for this and it's basically: $ bzr branch lp:~developer-ubuntu-com-dev/developer-ubuntu-com/debug-md-importer $ cd debug-md-importer $ virtualenv ./env $ ./env/bin/pip install -r requirements.txt $ ./env/bin/pip install django psycopg2 Then apply a diff like http://pastebin.ubuntu.com/12798510/ to developer_portal/settings.py and run $ sudo apt install python-pip python-dev libpq-dev postgresql postgresql-contrib $ sudo -u postgres psql -c "CREATE USER developerportal_user WITH PASSWORD '123abc';" To see the issue in action then run: $ ./postgres-retry.sh in a postgres setting and $ ./sqlite-retry.sh in the sqlite setting. The scripts will create a new db from scratch, run the importer with debug messages and run runserver for you, so you can easily check in the pages list how the structure changed. Current state of things: sqlite does fine and postgres has the article tree messed up. All the relevant code for this problem can be found in developer_portal/management/commands/import-external-docs-branches.py If anyone could give me a pointer, it'd be much much appreciated. Thanks a lot in advance. Have a great day, Daniel |
| Re: Problems with added/updated pages in article tree in postgres setting | Jonas Obrist | 18/10/15 18:34 | Hi Daniel, I've tried to grab the code to have a look at it, but I'm not really familiar with bzr. I tried the bzr branch command you posted, but I get this: bzr branch lp:~developer-ubuntu-com-dev/developer-ubuntu-com/debug-md-importer Permission denied (publickey). Jonas |
| Re: Problems with added/updated pages in article tree in postgres setting | Daniel Holbach | 19/10/15 00:04 | Hello Jonas, first of all: thanks for your offer of help. Could it be that you told bzr which Launchpad login you have (bzr launchpad-login), but your SSH key in Launchpad is not the one you currently use (https://launchpad.net/~/+editsshkeys)? In any case, I uploaded the contents of the branch to http://daniel.holba.ch/temp/debug-md-importer.tar.xz - that might speed things up a bit. Thanks again and have a great day, Daniel |
| Re: Problems with added/updated pages in article tree in postgres setting | Daniel Holbach | 03/11/15 06:30 | Hello, for those who are interested in the subject, the discussion seems to be going on here now: https://stackoverflow.com/questions/33284171
|