Project

General

Profile

Actions

Bug #1785

closed

host creation failes because of SQLite database locked

Added by Frederic Schaer almost 12 years ago. Updated almost 12 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
Database
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

Hi,

This concerns host creation/virtual machine creation on a libvirt compute ressource (at least).
When I try to create a new and very basic host on a libvirt compute ressource, or on a libvirt hypervisor (deprecated), I get most of the time the following sqlite exception :

SQLite3::BusyException: database is locked: INSERT INTO "hosts" ("created_at", "uuid", "last_report", "source_file_id", "puppet_ca_proxy_id", "name", "sp_mac", "root_pass", "last_compile", "managed", "build", "domain_id", "use_image", "certname", "medium_id", "puppet_proxy_id", "ip", "updated_at", "owner_id", "model_id", "operatingsystem_id", "hostgroup_id", "environment_id", "puppet_status", "serial", "sp_subnet_id", "ptable_id", "sp_ip", "environment", "sp_name", "installed_at", "comment", "image_id", "image_file", "last_freshcheck", "mac", "architecture_id", "subnet_id", "disk", "owner_type", "compute_resource_id", "enabled") VALUES ('2012-07-27 09:05:02.422605', 'ZZZZZZZ', NULL, NULL, 1, 'XXXXXXX', '', NULL, NULL, 't', 't', 1, NULL, NULL, 6, 1, 'YYYYYYY', '2012-07-27 09:05:02.422605', 1, NULL, 4, 2, 1, 0, NULL, NULL, 1, '', NULL, '', NULL, '', NULL, NULL, NULL, '52:54:00:94:84:2b', 1, 1, '', 'User', 1, 't')

Despite this exception, foreman still:
- creates the dhcp lease
- creates the VM in the hypervisor
- (starts the VM)

There is no rollback.

Host doesn't appear in the foreman hosts off course, so I have to manually cleanup stuff and start over again.
Please note I'm still in the process of discovering foreman+puppet, and that there are only 3 machines in the foreman DB.
Also, the server on which foreman is running is a virtual machine (because I'm testing), and its charge is almost 0.

I tried several times to create the host (after manual cleanup) : sometimes it works, so this LOCK does not seem to be a constant issue (but it's more present than absent, for me at least)

Regard

Actions #1

Updated by Ohad Levy almost 12 years ago

  • Status changed from New to Feedback
  • Assignee deleted (Ohad Levy)

this is a known limitation of sqlite, e.g. when one process writes to the db, all the rest is locked.

normally, this does not happen with 3 clients, but more around 30+.

try upgrading to another real db, I don't expect you have the issues then.

Actions #2

Updated by Frederic Schaer almost 12 years ago

Hi,

Ah ok... I'll then try a regular DB.
Just for you to know, this doesn't happen on the same setup using v0.4 from the epel repository.

I'll update the ticket when I have tested a MySQL DB.
Regards

Actions #3

Updated by Ohad Levy almost 12 years ago

I cant explain why your db is locked, but it could only mean one thing --> something else is using it.

maybe you have some other foreman process sending reports, cronjobs etc.

Actions #4

Updated by Frederic Schaer almost 12 years ago

I did test : effectively, no more issue with mysql.
I also seemed to have better success with a connection pool defined to 3 instead of 5, in the database.yml.

Regards

Actions #5

Updated by Ohad Levy almost 12 years ago

  • Status changed from Feedback to Resolved
Actions

Also available in: Atom PDF