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?

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
siovene's avatar
431
siovene
asked 12 years ago

Comments

see more comments

2 Answers

1

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

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
siovene's avatar
431
siovene
answered 12 years ago
link

Comments

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.

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
Evgeny's avatar
13.2k
Evgeny
answered 12 years ago, updated 12 years ago
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 (12 years ago)

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

Evgeny's avatar Evgeny (12 years ago)

The values are there.

siovene's avatar siovene (12 years ago)
1

Ah! Restarting memcached solved the problem! :)

siovene's avatar siovene (12 years ago)
see more comments