5.4 onedb fsck error

Sqlite database backup stored in /var/lib/one/one.db_2017-7-20_19:9:19.bck
Use 'onedb restore' to restore the DB.


undefined local variable or method `apps_fix' for #<BackEndSQLite:0x000000016ccdd8>
/usr/lib/one/ruby/onedb/fsck/marketplaceapp.rb:81:in `fix_marketplaceapp'
/usr/lib/one/ruby/onedb/fsck.rb:415:in `fsck'
/usr/lib/one/ruby/onedb/onedb.rb:280:in `fsck'
/usr/bin/onedb:397:in `block (2 levels) in <main>'
/usr/lib/one/ruby/cli/command_parser.rb:449:in `call'
/usr/lib/one/ruby/cli/command_parser.rb:449:in `run'
/usr/lib/one/ruby/cli/command_parser.rb:76:in `initialize'
/usr/bin/onedb:286:in `new'
/usr/bin/onedb:286:in `<main>'

Error running fsck version 5.4.0
The database will be restored
Sqlite database backup restored in one.db

Did you verify your ruby gems were updated prior to the database upgrade attempt?

All gems are updated during the upgrade process.
Problem is here: https://github.com/OpenNebula/one/blob/38cb96edcd6018ff7c0027fc578b54e8289f0699/src/onedb/fsck/marketplaceapp.rb#L81
The reason is that the apps_fix variable is not declared in function fix_marketplaceapp or any of parent scopes.

You are right, there is a bug in that line.

Can you try changing apps_fix with @fixes_marketplaceapp and run fsck again?

Now new error:

undefined local variable or method `markets_fix' for #<BackEndSQLite:0x00000001f6be08>
/usr/lib/one/ruby/onedb/fsck/marketplace.rb:85:in `fix_marketplace'
/usr/lib/one/ruby/onedb/fsck.rb:421:in `fsck'
/usr/lib/one/ruby/onedb/onedb.rb:280:in `fsck'
/usr/bin/onedb:397:in `block (2 levels) in <main>'
/usr/lib/one/ruby/cli/command_parser.rb:449:in `call'
/usr/lib/one/ruby/cli/command_parser.rb:449:in `run'
/usr/lib/one/ruby/cli/command_parser.rb:76:in `initialize'
/usr/bin/onedb:286:in `new'
/usr/bin/onedb:286:in `<main>'

Error running fsck version 5.4.0

Fix for new error: markets_fix -> @fixes_marketplace

After that all works fine

@jfontan thank you!