Intrepid has asked for the wisdom of the Perl Monks concerning the following question:

When I installed CPAN::SQLite and set cpan opt use_sqlite to true, the next time I started cpan shell I got this error:

2025-07-08 12:40:23 (3.53 MB/s) - ‘/home/somian/.cpan/sources/modules/ +03modlist.data.gz.tmp11438’ saved [248/248] Database was generated on Mon, 07 Jul 2025 15:41:26 GMT Updating database file ... DBD::SQLite::db commit failed: database is +locked at /usr/local/lib/perl5/site_perl/CPAN/SQLite/Populate.pm line + 663, <DATA> line 268361. DBD::SQLite::db commit failed: database is locked at /usr/local/lib/pe +rl5/site_perl/CPAN/SQLite/Populate.pm line 663, <DATA> line 268361. Catching error: "system /usr/local/bin/perl -MCPAN::SQLite::META=setup +,update,check -e update failed: 2816 at /usr/local/lib/perl5/site_per +l/CPAN/SQLite/META.pm line 318.\cJ" at /usr/local/lib/perl5/5.40.1/CP +AN.pm line 397. CPAN::shell() called at -e line 1

EDIT

Oh, s**t. I had an earlier instance of CPAN's shell running in the background in a terminal. I'm writing this update very quickly so I can say NEVER MIND, before anyone decides to waste their time telling me what's wrong. ;-).


This is on Gnu/Linux, perl 5.40.1, CPAN.pm version 2.36. The error is repeatable; if I set use_sqlite via o conf, I will get the error.

I understand what a locked database is, although I haven't had to learn the specifics of database management (I've long been an "enthusiast" - self-taught - rather than a "professional" who would be required to know databases for w$rk). My questions are: has anyone else seen this error with CPAN? And, What's the magnitude of the performance penalty for not using SQLite with CPAN?

  Soren

Jul 08, 2025 at 18:11 UTC

  • Comment on DBD::SQLite::db commit failed: database is locked; cpan shell error
  • Download Code

Replies are listed 'Best First'.
Re: DBD::SQLite::db commit failed: database is locked; cpan shell error
by cavac (Prior) on Jul 10, 2025 at 06:50 UTC

    Just a little note here for future readers: The SQLite database file used in CPAN::SQLite module gets automatically re-populated if the file is missing. If in doubt, you can just delete the file and start fresh (at the cost of a few seconds when the database is recreated).

    PerlMonks XP is useless? Not anymore: XPD - Do more with your PerlMonks XP
    Also check out my sisters artwork and my weekly webcomics