First time here? Check out the FAQ!
1

Settings gone after upgrade

Hi, I installed 0.7.42 via pypy and configured it.

After I was happy, I decided I should upgrade to git master, so I:

  1. Cloned askbot-devel
  2. Installed it
  3. Ran all the migrations
  4. Collected static files

Everything seemed to be successful, besides the static files, as I mentioned in another question, but the settings are gone; and if I try to, say, change the skin, I get database errors because of duplicate keys.

Any idea?

siovene's avatar
431
siovene
asked 2012-10-30 00:36:26 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

2 Answers

1

The problem was stale memcached cache. I restarted it and things are fine now.

siovene's avatar
431
siovene
answered 2012-10-30 13:50:59 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments
1

This sounds like a bug in our settings module or a sequence corruption in the database, however there are solutions to these issues.

If you are using multiple processes to run your webapp, the issue could be caused by two or more processes trying to save the same value into the database, which would in this case violate a unique constraint. This can be worked around by installing a common cache system like "redis" or reducing number of processes on your app to one until we find the real fix.

Another possibility (if you are using postgresql database) is that the primary key sequence became corrupted. This could be that the current value for the primary key sequence in that table livesettings_setting is below the ID of some existing row. In this case you will get a duplicate key violation also.

Evgeny's avatar
13.2k
Evgeny
answered 2012-10-30 11:50:27 -0500, updated 2012-10-30 11:51:12 -0500
edit flag offensive 0 remove flag delete link

Comments

Thanks Evgeny. Any idea if I can actually recover the settings? I've looked at the livesetting_setting and _longsetting tables in mysql, and they are there.

siovene's avatar siovene (2012-10-30 13:23:23 -0500) edit

See if the values are there, i.e. that the tables are not empty.

Evgeny's avatar Evgeny (2012-10-30 13:33:42 -0500) edit

The values are there.

siovene's avatar siovene (2012-10-30 13:43:48 -0500) edit
1

Ah! Restarting memcached solved the problem! :)

siovene's avatar siovene (2012-10-30 13:50:24 -0500) edit
add a comment see more comments