mdzidic / ovz-web-panel

Automatically exported from code.google.com/p/ovz-web-panel
Other
0 stars 0 forks source link

Error after upgrade to 2.0 (ip_pools table is missing?) #285

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Steps to reproduce:
1. Upgrade from OWP 1.7 to 2.0

Actual result:
It's impossible to reboot a vm, error 500 very often for no apparent reason 
until reboot.
According to the logs, it is the table "ip_pools" that is missing, so how to 
fix it??

Version of the product: 2.0

Server OS: Debian lenny 5 64bit

Browser: Firefox

Additional information:
Log production.log :
{too big}

ActiveRecord::StatementInvalid (Could not find table 'ip_pools'):
    /vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb:29:in `table_structure'
    /vendor/rails/activesupport/lib/active_support/core_ext/object/misc.rb:39:in `returning'
    /vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb:28:in `table_structure'
    /vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:189:in `columns'
    /vendor/rails/activerecord/lib/active_record/base.rb:1220:in `columns'
    /vendor/rails/activerecord/lib/active_record/calculations.rb:281:in `column_for'
    /vendor/rails/activerecord/lib/active_record/calculations.rb:121:in `calculate'
    /vendor/rails/activerecord/lib/active_record/calculations.rb:48:in `count'
    /app/models/virtual_server.rb:293:in `validate'
    /vendor/rails/activerecord/lib/active_record/validations.rb:1030:in `valid_without_callbacks?'
    /vendor/rails/activerecord/lib/active_record/callbacks.rb:286:in `valid?'
    /vendor/rails/activerecord/lib/active_record/validations.rb:1008:in `save_without_dirty'
    /vendor/rails/activerecord/lib/active_record/dirty.rb:79:in `save_without_transactions'
    /vendor/rails/activerecord/lib/active_record/transactions.rb:179:in `send'
    /vendor/rails/activerecord/lib/active_record/transactions.rb:179:in `with_transaction_returning_status'
    /vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:66:in `transaction'
    /vendor/rails/activerecord/lib/active_record/transactions.rb:129:in `transaction'
    /vendor/rails/activerecord/lib/active_record/transactions.rb:138:in `transaction'
    /vendor/rails/activerecord/lib/active_record/transactions.rb:178:in `with_transaction_returning_status'
    /vendor/rails/activerecord/lib/active_record/transactions.rb:146:in `save'
    /vendor/rails/activerecord/lib/active_record/transactions.rb:158:in `rollback_active_record_state!'
    /vendor/rails/activerecord/lib/active_record/transactions.rb:146:in `save'
    /app/models/virtual_server.rb:281:in `real_state'
    /app/controllers/admin/base.rb:17:in `get_virtual_servers_map'
    /vendor/rails/activerecord/lib/active_record/associations/association_collection.rb:359:in `method_missing'
    /vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:212:in `method_missing'
    /vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:212:in `map'
    /vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:212:in `send'
    /vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:212:in `method_missing'
    /vendor/rails/activerecord/lib/active_record/associations/association_collection.rb:359:in `method_missing'
    /app/controllers/admin/base.rb:12:in `get_virtual_servers_map'
    /app/controllers/admin/hardware_servers_controller.rb:35:in `show'
    /vendor/rails/actionpack/lib/action_controller/base.rb:1253:in `send'
    /vendor/rails/actionpack/lib/action_controller/base.rb:1253:in `perform_action_without_filters'
    /vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
    /vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
    /vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
    /usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
    /vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
    /vendor/rails/actionpack/lib/action_controller/rescue.rb:136:in `perform_action_without_caching'
    /vendor/rails/actionpack/lib/action_controller/caching/sql_cache.rb:13:in `perform_action'
    /vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
    /vendor/rails/activerecord/lib/active_record/query_cache.rb:8:in `cache'
    /vendor/rails/actionpack/lib/action_controller/caching/sql_cache.rb:12:in `perform_action'
    /vendor/rails/actionpack/lib/action_controller/base.rb:524:in `send'
    /vendor/rails/actionpack/lib/action_controller/base.rb:524:in `process_without_filters'
    /vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process_without_session_management_support'
    /vendor/rails/actionpack/lib/action_controller/session_management.rb:134:in `process'
    /vendor/rails/actionpack/lib/action_controller/base.rb:392:in `process'
    /vendor/rails/actionpack/lib/action_controller/dispatcher.rb:183:in `handle_request'
    /vendor/rails/actionpack/lib/action_controller/dispatcher.rb:110:in `dispatch_unlocked'
    /vendor/rails/actionpack/lib/action_controller/dispatcher.rb:123:in `dispatch'
    /vendor/rails/actionpack/lib/action_controller/dispatcher.rb:122:in `synchronize'
    /vendor/rails/actionpack/lib/action_controller/dispatcher.rb:122:in `dispatch'
    /vendor/rails/actionpack/lib/action_controller/dispatcher.rb:132:in `dispatch_cgi'
    /vendor/rails/actionpack/lib/action_controller/dispatcher.rb:39:in `dispatch'
    /vendor/rails/railties/lib/webrick_server.rb:103:in `handle_dispatch'
    /vendor/rails/railties/lib/webrick_server.rb:74:in `service'
    /usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
    /usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
    /usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
    /usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
    /usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
    /usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
    /usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
    /usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
    /usr/lib/ruby/1.8/webrick/server.rb:37:in `start'
    /usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
    /vendor/rails/railties/lib/webrick_server.rb:60:in `dispatch'
    /vendor/rails/railties/lib/commands/servers/webrick.rb:66
    /usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
    /usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `require'
    /vendor/rails/activesupport/lib/active_support/dependencies.rb:153:in `require'
    /vendor/rails/activesupport/lib/active_support/dependencies.rb:521:in `new_constants_in'
    /vendor/rails/activesupport/lib/active_support/dependencies.rb:153:in `require'
    /vendor/rails/railties/lib/commands/server.rb:49
    /usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
    /usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `require'
    //script/server:3

Internal error: Could not find table 'ip_pools'
Rendering /opt/ovz-web-panel/public/500.html (500 Internal Server Error)

Processing Admin::TasksController#status (for xx.xxx.xxx.xx at 2011-04-24 
00:12:30) [GET]
  Parameters: {"action"=>"status", "controller"=>"admin/tasks", "_dc"=>"1303596746021"}
Completed in 8ms (View: 0, DB: 3) | 200 OK 
[http://node1.server.com/admin/tasks/status?_dc=1303596746021]

Original issue reported on code.google.com by r.lye...@gmail.com on 23 Apr 2011 at 10:47

GoogleCodeExporter commented 9 years ago
I have some questions:
1. Are you using Debian unstable (sid) repository?
2. Installer log file needed. Please provide the content of 
/tmp/ovz-web-panel.log
3. Try to repeat database upgrade procedure: cd /opt/ovz-web-panel/ && rake 
db:migrate RAILS_ENV="production"

Original comment by sibprogrammer on 24 Apr 2011 at 1:17

GoogleCodeExporter commented 9 years ago
1. No.

2. /tmp/ovz-web-panel.log :
#############################################
Sat Apr 23 22:40:45 CEST 2011 -----------------------------------
Sat Apr 23 22:40:45 CEST 2011 OpenVZ Web Panel Installer.
Sat Apr 23 22:40:45 CEST 2011 -----------------------------------
Sat Apr 23 22:40:45 CEST 2011 Checking environment...
Sat Apr 23 22:40:45 CEST 2011 System info: Linux node1.server.com 2.6.24-12-pve 
#1 SMP PREEMPT Mon Sep 20 13:02:41 CEST 2010 x86_64 GNU/Linux
Sat Apr 23 22:40:45 CEST 2011 Detecting distrib ID...
Sat Apr 23 22:40:45 CEST 2011 Checking presence of the command: lsb_release
Sat Apr 23 22:40:45 CEST 2011 Detected distrib ID: Debian
Sat Apr 23 22:40:45 CEST 2011 OpenVZ hardware node detected.
Sat Apr 23 22:40:45 CEST 2011 Resolving dependencies...
Sat Apr 23 22:42:51 CEST 2011 Checking presence of the command: ruby
Sat Apr 23 22:42:51 CEST 2011 Ruby version: 1.8.7
Sat Apr 23 22:42:51 CEST 2011 Checking presence of the command: gem
Sat Apr 23 22:42:51 CEST 2011 RubyGems version: 1.2.0
Sat Apr 23 22:42:51 CEST 2011 Checking Ruby SQLite3 support: ruby -e "require 
'rubygems'" -e "require 'sqlite3/database'"
Sat Apr 23 22:42:51 CEST 2011
Sat Apr 23 22:42:51 CEST 2011 Installation...
Sat Apr 23 22:42:51 CEST 2011 Downloading: wget -nc -P /opt/ovz-web-panel/ 
http://ovz-web-panel.googlecode.com/files/ovz-web-panel-2.0.tgz
Sat Apr 23 22:42:53 CEST 2011 Unpacking: tar --strip 2 -C /opt/ovz-web-panel/ 
-xzf /opt/ovz-web-panel//ovz-web-panel-2.0.tgz --exclude=*.log 
--exclude=config/database.yml --exclude=db/*.sqlite3 --exclude=config/certs/*
Sat Apr 23 22:42:53 CEST 2011 Removing downloaded archive: rm -f 
/opt/ovz-web-panel//ovz-web-panel-2.0.tgz
Sat Apr 23 22:42:53 CEST 2011 Removing deprecated files...
Sat Apr 23 22:42:53 CEST 2011 Upgrading database...
Sat Apr 23 22:42:56 CEST 2011 Syncing physical servers state...
Sat Apr 23 22:43:00 CEST 2011 Installation finished.
Sat Apr 23 22:43:00 CEST 2011 Product was installed into: /opt/ovz-web-panel/
Sat Apr 23 22:43:00 CEST 2011
Sat Apr 23 22:43:00 CEST 2011 Stopping services...
Sat Apr 23 22:43:00 CEST 2011 Starting services...
Sat Apr 23 22:43:07 CEST 2011 Panel should be available at:
Sat Apr 23 22:43:07 CEST 2011 http://node1.server.com:3000
Sat Apr 23 22:43:07 CEST 2011 Default credentials: admin/admin
Sat Apr 23 22:43:07 CEST 2011 -----------------------------------
#############################################

3. When i try to repeat database upgrade :

#############################################
root@node1:~# cd /opt/ovz-web-panel/ && rake db:migrate RAILS_ENV="production"
(in /opt/ovz-web-panel)
==  AddLimitBackupsToRole: migrating ==========================================
-- add_column(:roles, :limit_backups, :integer, {:default=>-1})
rake aborted!
An error has occurred, all later migrations canceled:

SQLite3::SQLException: duplicate column name: limit_backups: ALTER TABLE 
"roles" ADD "limit_backups" integer DEFAULT -1

(See full trace by running task with --trace)
#############################################

Can I downgrade to owp 1.7 meanwhile? knowing that I have a backup of the file 
"production.sqlite3" I've done in version 1.7

Thank's in advance!

Original comment by r.lye...@gmail.com on 24 Apr 2011 at 7:51

GoogleCodeExporter commented 9 years ago
Execute the command:
sqlite3 db/production.sqlite3 'select * from schema_migrations'

Migration with number 20110206111020 should absent. Insert it manually:
sqlite3 db/production.sqlite3 'insert into schema_migrations values 
("20110206111020")'

Then do db upgrade again:
cd /opt/ovz-web-panel/ && rake db:migrate RAILS_ENV="production"

Original comment by sibprogrammer on 25 Apr 2011 at 12:49

GoogleCodeExporter commented 9 years ago
root@node1:/opt/ovz-web-panel# sqlite3 db/production.sqlite3 'select * from 
schema_migrations'
-bash: sqlite3: command not found

Any idea?

Original comment by r.lye...@gmail.com on 25 Apr 2011 at 9:47

GoogleCodeExporter commented 9 years ago
apt-get install sqlite3

Original comment by sibprogrammer on 25 Apr 2011 at 2:03

GoogleCodeExporter commented 9 years ago
Perfect !

Thank you ! my problem is solved.

Original comment by r.lye...@gmail.com on 25 Apr 2011 at 2:11

GoogleCodeExporter commented 9 years ago

Original comment by sibprogrammer on 25 Apr 2011 at 2:27