5.4 onedb fsck error


(Artur Kraev) #1
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

Database-Versioning-Problem while Upgrading 5.2 -> 5.4 with Federation and MySQL
(The Rock) #2

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


(Artur Kraev) #3

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.


(Javi Fontán) #4

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

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


(Artur Kraev) #5

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!