crowbarctl backup fails and locks the database

  • 7017857
  • 20-Jul-2016
  • 17-Feb-2017

Environment

SUSE OpenStack Cloud 6

Situation

Command 'crowbarctl backup' fails:
root@admin:~ # crowbarctl backup create -U <user> -P <password> test_backup
/usr/lib64/ruby/2.1.0/net/protocol.rb:158:in `rescue in rbuf_fill': Net::ReadTimeout (Net::ReadTimeout)
        from /usr/lib64/ruby/2.1.0/net/protocol.rb:152:in `rbuf_fill'
        from /usr/lib64/ruby/2.1.0/net/protocol.rb:134:in `readuntil'
        from /usr/lib64/ruby/2.1.0/net/protocol.rb:144:in `readline'
        from /usr/lib64/ruby/2.1.0/net/http/response.rb:39:in `read_status_line'
        from /usr/lib64/ruby/2.1.0/net/http/response.rb:28:in `read_new'
        from /usr/lib64/ruby/2.1.0/net/http.rb:1408:in `block in transport_request'
        from /usr/lib64/ruby/2.1.0/net/http.rb:1405:in `catch'
        from /usr/lib64/ruby/2.1.0/net/http.rb:1405:in `transport_request'
        from /usr/lib64/ruby/2.1.0/net/http.rb:1378:in `request'
        from /usr/lib64/ruby/2.1.0/net/http.rb:1371:in `block in request'
        from /usr/lib64/ruby/2.1.0/net/http.rb:853:in `start'
        from /usr/lib64/ruby/2.1.0/net/http.rb:1369:in `request'

Afterwards the database is locked:
E, [2016-04-19T15:25:47.780900 #7229:0x007ff2daa7cc48] ERROR -- SQLite3::BusyException: database is locked: begin transaction
F, [2016-04-19T15:25:47.782003 #7229:0x007ff2daa7cc48] FATAL --
ActiveRecord::StatementInvalid (SQLite3::BusyException: database is locked: begin transaction):

Resolution

Restarting crowbar with 'systemctl restart crowbar' will kill the  background job and allow new backup run. Using 'crowbarctl -t 180 backup' to increase the timeout is also a valid workaround.

Cause

The database is being held by a previous task that is still processed on the server side in the background. At some point this task would have finished and new backup job would be able to run again. It is specific due to use of sqlite and plan is to move to another database.

Feedback service temporarily unavailable. For content questions or problems, please contact Support.