db:migrate corrupts sqlite3 database
I have a tracks-20-sqlite3 and after I run the rake db:migrate script the app errors on a corrupted file.
The same happens when one does run migrate on the blank sqlite3 db.
The same happens when one does run migrate on the blank sqlite3 db.
/!\ FAILSAFE /!\ Mon Dec 03 10:16:57 -0500 2012
Status: 500 Internal Server Error
SQLite3::CorruptException: database disk image is malformed: INSERT INTO "sessions" ("session_id", "updated_at", "data") VALUES('c1b26947951be9228385227f2dd9e537', '2012-12-03 15:16:57', 'BAh7BiIOcmV0dXJuLXRvIgYv
')
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/connection_adapters/abstract_adapter.rb:227:in `log'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/connection_adapters/sqlite_adapter.rb:172:in `execute'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/connection_adapters/sqlite_adapter.rb:418:in `catch_schema_changes'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/connection_adapters/sqlite_adapter.rb:172:in `execute'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/connection_adapters/abstract/database_statements.rb:259:in `insert_sql'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/connection_adapters/sqlite_adapter.rb:186:in `insert_sql'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/connection_adapters/abstract/database_statements.rb:44:in `insert_without_query_dirty'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/connection_adapters/abstract/query_cache.rb:19:in `insert'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/base.rb:2961:in `create_without_timestamps'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/timestamp.rb:53:in `create_without_callbacks'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/callbacks.rb:266:in `create'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/base.rb:2927:in `create_or_update_without_callbacks'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/callbacks.rb:250:in `create_or_update'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/base.rb:2577:in `save_without_validation'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/validations.rb:1089:in `save_without_dirty'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/dirty.rb:79:in `save_without_transactions'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/transactions.rb:229:in `send'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/transactions.rb:229:in `with_transaction_returning_status'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/connection_adapters/abstract/database_statements.rb:136:in `transaction'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/transactions.rb:182:in `transaction'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/transactions.rb:228:in `with_transaction_returning_status'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/transactions.rb:196:in `save'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/transactions.rb:208:in `rollback_active_record_state!'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/transactions.rb:196:in `save'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/session_store.rb:300:in `set_session'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/base.rb:1482:in `silence'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/session_store.rb:297:in `set_session'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.14/lib/action_controller/session/abstract_store.rb:191:in `call'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/query_cache.rb:29:in `call'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/query_cache.rb:9:in `cache'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/query_cache.rb:28:in `call'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.14/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.14/lib/action_controller/failsafe.rb:26:in `call'
/usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/lock.rb:11:in `call'
/usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/lock.rb:11:in `synchronize'
/usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/lock.rb:11:in `call'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.14/lib/action_controller/dispatcher.rb:106:in `call'
/usr/lib/ruby/gems/1.8/gems/rails-2.3.14/lib/rails/rack/static.rb:31:in `call'
/usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/urlmap.rb:47:in `call'
/usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/urlmap.rb:41:in `each'
/usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/urlmap.rb:41:in `call'
/usr/lib/ruby/gems/1.8/gems/rails-2.3.14/lib/rails/rack/log_tailer.rb:17:in `call'
/usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/content_length.rb:13:in `call'
/usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/chunked.rb:15:in `call'
/usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/handler/mongrel.rb:67:in `process'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:159:in `process_client'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `each'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `process_client'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `initialize'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `new'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `initialize'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `new'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `run'
/usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/handler/mongrel.rb:38:in `run'
/usr/lib/ruby/gems/1.8/gems/rails-2.3.14/lib/commands/server.rb:111
./script/server:3:in `require'
./script/server:3
Leave a comment
on 2012-12-07 22:30 *
By kajkandler
I upgrade from 2.0 to 2.1
So the answer to postfix is no
Wow, where did the database.yml go that I posted days ago (before I fell sick)? Well, I'll post it later again
$ ps aux | grep postfix
kkandler 16538 0.0 0.0 2435116 560 s000 R+ 9:27PM 0:00.00 grep postfix
So the answer to postfix is no
Wow, where did the database.yml go that I posted days ago (before I fell sick)? Well, I'll post it later again
on 2012-12-07 22:35 *
By kajkandler
My database.yml small changes to the default (I'm upgrading production (I'm a user not a developer of this package)
I tried with ---> same result
development:
adapter: mysql
database: tracks
# set this if you are storing utf8 in your mysql database to handle strings
# like "Réné".Not needed for sqlite. For PostgreSQL use encoding: unicode
# encoding: utf8
host: localhost
username: root
password:
test: &TEST
adapter: sqlite3
database: ":memory:"
production:
adapter: sqlite3
database: db/tracks-20-blank.db
# set this if you are storing utf8 in your mysql database to handle strings
# like "Réné".Not needed for sqlite. For PostgreSQL use encoding: unicode
# encoding: utf8
host: localhost
username: root
password:
cucumber:
<<: *TEST
selenium:
<<: *TEST
I tried with ---> same result
# host: localhost
# username: root
# password:
on 2012-12-08 21:59 *
By kajkandler
@Dan I did try that too, but it is still the same result?
Is there a particular sqlite3 version you are using?
I see also a corrupted file when I apply the upgrade to the 2.1 blank sqlite3 db, which I'd expected to be a no-op. Shall I attach this file for inspection?
I'm a ruby newbie, but as I understand there are different update scripts executed by the rake upgrade. Can I somehow isolate the different scripts to see which one is causing the trouble (or if all of them do)?
Is there a particular sqlite3 version you are using?
I see also a corrupted file when I apply the upgrade to the 2.1 blank sqlite3 db, which I'd expected to be a no-op. Shall I attach this file for inspection?
I'm a ruby newbie, but as I understand there are different update scripts executed by the rake upgrade. Can I somehow isolate the different scripts to see which one is causing the trouble (or if all of them do)?
How about when you try a nonexistent or completely empty file? It should create the database from scratch.
The host, username, and password fields are ignored when using sqlite, so as you have seen, they are not your problem.
I doubt the sqlite version is the issue, but feel free to post yours obtained by running
You can run the migrations one by one with
Can we see some of the specs of your environment? Please paste the output of
The host, username, and password fields are ignored when using sqlite, so as you have seen, they are not your problem.
I doubt the sqlite version is the issue, but feel free to post yours obtained by running
sqlite3 --version
. I'm running 3.7.7 in my 2.1 instance.You can run the migrations one by one with
bundle exec rake db:migrate STEP=1 RAILS_ENV=production
. (You can also play around in the development environment if you complete that section of your database.yml. Then you won't have to type "RAILS_ENV=production" after every command, since development is the default environment.)Can we see some of the specs of your environment? Please paste the output of
bundle exec script/about RAILS_ENV=production
, and attach a copy of your Gemfile.lock.
on 2012-12-30 21:41 *
By zoombody
Status changed from New to Invalid
Status changed from New to Invalid
Closing for lack of feedback. @kajkandler, please reopen if you are still seeing the issue and would like to pursue it further.