Questions? Answers.

Have a question? Post it and let the masses answer.
Tags/topics: 
3
Answers
Vote up!
0
Vote down!

Kickstart error on SQLite

Guys,

I installed Drupal Kickstart fixing up php.ini file a few times along the way. I now have demo store at www.meadowbank.biz/drupalks.

I tried to login as admin and get this error

PDOException: SQLSTATE[HY000]: General error: 5 database is locked: INSERT INTO {variable} (name, value) VALUES (?, ?); Array ( [0] => rules_empty_sets [1] => a:66:{

I looked up this error and saw sqlite database as being a problem This is the reason I choose Drupal Kickstart. the following comment was interesting

have ubuntu 10.10 with SQLite 3.7.2, and my simple tests also shows me error you mentioned. My first impression is that in comparison to MySQL-based SQLite-based Drupal is not really usable out-of-the-box.
http://drupal.org/node/1120020

Any progress on the fix?
Thanks

Asked by: parkbenchbruce
on December 23, 2012

Comments

Anyone tried this on a server?
Removing Sqlite Database Locks Using `.backup`

The general strategy here is to create a backup of the database, where the backup does not have the locks, and then swapping out the database with the backup copy. Here's how to do this.

Use the command line sqlite3 program to do the following (assuming the sqlite database file is named .ht.sqlite, as it is by default in Drupal):

$ sqlite3 .ht.sqlite
sqlite> .backup main backup.sqlite
sqlite> .exit
Now you should have a file called backup.sqlite in the same directory. Next, you need to move your old database, and replace it with the backup copy. As far as I understand it, the backup copy does not have the locks, so this swap will essentially eliminate the problem.

$ mv .ht.sqlite old.sqlite
$ mv backup.sqlite .ht.sqlite
At this point you should be able to once again access the database with the sqlite3 command line client. You may also need to chown or chmod the file in order to grant access to the webserver again. But that's all there is to it.

Once you have tested and verified that your database is once again allowing both reads and writes, you can and should delete the old database file.

- parkbenchbruce on December 23, 2012

3 Answers

Vote up!
1
Vote down!

Since you'd never run an actual Drupal installation on SQLite, very little testing is given to Kickstart on SQLite.
I suggest using MySQL to evaluate Commerce Kickstart (or use something like http://simplytest.me/)

Answer by: bojanz
Posted: Dec 24, 2012
Vote up!
0
Vote down!

Bojanz,

Thanks for the suggestion. Sqlite was the reason for trying Drupal Commerce. It has a solution for a project I am working on. I have used Magento with mysql for a few years. They were switching to also have sqlite as an option.

The http://simplytest.me/ looks like a sandbox. I will have a look at importing a sqlite database into it but first I'll try to unlock the sqlite database.

Thanks

Answer by: parkbenchbruce
Posted: Dec 25, 2012
Vote up!
0
Vote down!

Guys,

I unlocked the sqlite. The above comment "As far as I understand it, the backup copy does not have the locks, so this swap will essentially eliminate the problem" worked!

I download .ht.sqlite backed it up then uploaded it after changing the previous file to old.

I might write out the step by steps if anyone needs this

Answer by: parkbenchbruce
Posted: Dec 25, 2012
drupalcommerce Check out the #Drupal Commerce 2.x Roadmap to see where you can get involved: http://t.co/WAc3jmXY2a
drupalcommerce A new blog discussing the new showcase listing http://t.co/FHOzhAg3tl http://t.co/J5C87imjhb
drupalcommerce RT @drupalcon: Thanks @CommerceGuys and @CommerceJohn for your support, and for #CommerceKickstart! Take the tour http://t.co/ivKEYH7k0o
drupalcommerce Updating our extensions directory: 665 new or updated modules, distributions, sandboxes, & themes. http://t.co/6NMMofYo12 #weloveyouguys