Comments (11)
Hey @Nodalailama, can you paste the full stacktrace?
from lockbox.
ActionText::RichText Load (0.6ms) SELECT "action_text_rich_texts".* FROM "action_text_rich_texts" WHERE "action_text_rich_texts"."body_ciphertext" IS NULL ORDER BY "action_text_rich_texts"."id" ASC LIMIT $1 [["LIMIT", 1000]]
↳ app/controllers/parties_controller.rb:24:in show' Query Trace: /Users/nod/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/active_record_query_trace-1.7/lib/active_record_query_trace.rb:107:in
fully_formatted_trace'
/Users/nod/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/active_record_query_trace-1.7/lib/active_record_query_trace.rb:66:in sql' /Users/nod/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-6.0.3.2/lib/active_support/subscriber.rb:145:in
finish'
/Users/nod/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-6.0.3.2/lib/active_support/log_subscriber.rb:107:in finish' /Users/nod/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-6.0.3.2/lib/active_support/notifications/fanout.rb:160:in
finish'
↳ app/controllers/parties_controller.rb:24:in `show'
Completed 500 Internal Server Error in 160ms (ActiveRecord: 2.3ms | Allocations: 56785)
TypeError (can't convert message to string):
My problem is that don't have lot of info with the log ...
from lockbox.
Hey @Nodalailama, that doesn't look like the full trace. Try running it in the Rails console instead of a controller.
from lockbox.
Bonjour,
So, voilà the result:
irb(main):003:0> Lockbox.migrate(ActionText::RichText)
ActionText::RichText Load (0.4ms) SELECT "action_text_rich_texts".* FROM "action_text_rich_texts" WHERE "action_text_rich_texts"."body_ciphertext" IS NULL ORDER BY "action_text_rich_texts"."id" ASC LIMIT $1 [["LIMIT", 1000]]
Query Trace:
/Users/nod/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/active_record_query_trace-1.7/lib/active_record_query_trace.rb:107:in fully_formatted_trace' /Users/nod/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/active_record_query_trace-1.7/lib/active_record_query_trace.rb:66:in
sql'
/Users/nod/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-6.0.3.2/lib/active_support/subscriber.rb:145:in finish' /Users/nod/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-6.0.3.2/lib/active_support/log_subscriber.rb:107:in
finish'
/Users/nod/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-6.0.3.2/lib/active_support/notifications/fanout.rb:160:in `finish'
Traceback (most recent call last):
1: from (irb):3
TypeError (can't convert message to string)
from lockbox.
Try running Rails.backtrace_cleaner.remove_silencers!
and then running migrate again. The trace should include lib/lockbox.rb
.
from lockbox.
Thus:
Traceback (most recent call last):
16: from activerecord (6.0.3.2) lib/active_record/relation/batches.rb:222:in in_batches' 15: from activerecord (6.0.3.2) lib/active_record/relation/batches.rb:222:in
loop'
14: from activerecord (6.0.3.2) lib/active_record/relation/batches.rb:238:in block in in_batches' 13: from activerecord (6.0.3.2) lib/active_record/relation/batches.rb:136:in
block in find_in_batches'
12: from lockbox (0.4.4) lib/lockbox/migrator.rb:102:in block in each_batch' 11: from lockbox (0.4.4) lib/lockbox/migrator.rb:95:in
block in perform'
10: from lockbox (0.4.4) lib/lockbox/migrator.rb:130:in migrate_records' 9: from lockbox (0.4.4) lib/lockbox/migrator.rb:130:in
each'
8: from lockbox (0.4.4) lib/lockbox/migrator.rb:141:in block in migrate_records' 7: from lockbox (0.4.4) lib/lockbox/migrator.rb:141:in
each'
6: from lockbox (0.4.4) lib/lockbox/migrator.rb:142:in block (2 levels) in migrate_records' 5: from lockbox (0.4.4) lib/lockbox/model.rb:227:in
block (3 levels) in encrypts'
4: from lockbox (0.4.4) lib/lockbox/model.rb:249:in block (3 levels) in encrypts' 3: from lockbox (0.4.4) lib/lockbox/model.rb:330:in
block (3 levels) in encrypts'
2: from lockbox (0.4.4) lib/lockbox/encryptor.rb:16:in encrypt' 1: from lockbox (0.4.4) lib/lockbox/encryptor.rb:71:in
check_string'
TypeError (can't convert message to string)
from lockbox.
I have one Post which has a actiontext attached,
I have followed your procedure: add the migration to add the cypher_body then add a initializer with migration: true,
then in rails console, I do Lockbox.migrate(ActionText::RichText).
from lockbox.
Note: my actiontext table use uuid instead of regular id.
from lockbox.
Thanks @Nodalailama, should be fixed now. You can try it out with:
gem 'lockbox', github: 'ankane/lockbox'
from lockbox.
Super, it works. Thank.
from lockbox.
Thanks for confirming, just released version 0.4.5 with the fix.
from lockbox.
Related Issues (20)
- Rotating master key gives ActiveRecord::RecordNotSaved HOT 1
- Decryption using PHP is not Working HOT 4
- Access to the unencrypted attachable when using ActiveStorage HOT 2
- [Question] - Migrating from `attr_encrypted` with `marshal: true` HOT 3
- Lockbox raises MissingAttributeError when encrypted attribute is backed by store_attribute when using select HOT 1
- `Lockbox.rotate` bypasses `default_scope` if passed a model HOT 1
- GCM-SIV HOT 1
- Devise Invalid Credentials after table name changed HOT 3
- Search in encrypted data HOT 1
- Unable to rotate encryption for fields having custom key_table HOT 2
- Idea: console1984 integration
- Missing keyword: :coder error for Rails 7.1 when using `has_encrypted :name, type: :array` HOT 3
- Corrupted strings on save + reload with multi-byte UTF-8 characters with ActionText::RichText on Rails 7.1 HOT 5
- Idea: Don't return virtual attributes in attribute methods unless the ciphertext attribute is present HOT 2
- update_all doesnt work with Lockbox after deleting old column. HOT 2
- How to force migration again.
- Use with bcrypt HOT 1
- Can't use `Lockbox.migrate(User)`: can't convert Date to String (`v.1.3.3`) HOT 1
- How to access encrypted values from rails console? HOT 1
- Create a migration that includes `Lockbox.migrate(User)` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lockbox.