Giter VIP home page Giter VIP logo

Comments (11)

ankane avatar ankane commented on May 30, 2024

Hey @Nodalailama, can you paste the full stacktrace?

from lockbox.

Nodalailama avatar Nodalailama commented on May 30, 2024

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.

ankane avatar ankane commented on May 30, 2024

Hey @Nodalailama, that doesn't look like the full trace. Try running it in the Rails console instead of a controller.

from lockbox.

Nodalailama avatar Nodalailama commented on May 30, 2024

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.

ankane avatar ankane commented on May 30, 2024

Try running Rails.backtrace_cleaner.remove_silencers! and then running migrate again. The trace should include lib/lockbox.rb.

from lockbox.

Nodalailama avatar Nodalailama commented on May 30, 2024

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.

Nodalailama avatar Nodalailama commented on May 30, 2024

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.

Nodalailama avatar Nodalailama commented on May 30, 2024

Note: my actiontext table use uuid instead of regular id.

from lockbox.

ankane avatar ankane commented on May 30, 2024

Thanks @Nodalailama, should be fixed now. You can try it out with:

gem 'lockbox', github: 'ankane/lockbox'

from lockbox.

Nodalailama avatar Nodalailama commented on May 30, 2024

Super, it works. Thank.

from lockbox.

ankane avatar ankane commented on May 30, 2024

Thanks for confirming, just released version 0.4.5 with the fix.

from lockbox.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.