Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no implicit conversion of Mihari::Models::Rule into Hash (TypeError) #955

Closed
V0lundr opened this issue Dec 31, 2023 · 0 comments · Fixed by #956
Closed

no implicit conversion of Mihari::Models::Rule into Hash (TypeError) #955

V0lundr opened this issue Dec 31, 2023 · 0 comments · Fixed by #956

Comments

@V0lundr
Copy link

V0lundr commented Dec 31, 2023

Hi, when trying to run the rule, I get the following error:

mihari@mihari:~$ mihari search -f 9a52fc3f-578e-44ac-9c15-8080e2338719 -d
/home/mihari/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/mihari-7.0.0/lib/mihari/services/builders.rb:37:in `call': no implicit conversion of Mihari::Models::Rule into Hash (TypeError)

        Rule.new(**data)
                 ^^^^^^
        from /home/mihari/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/mihari-7.0.0/lib/mihari/service.rb:20:in `call'
        from /home/mihari/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/mihari-7.0.0/lib/mihari/commands/search.rb:30:in `block in search'
        from /home/mihari/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/dry-monads-1.6.0/lib/dry/monads/try.rb:29:in `run'
        from /home/mihari/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/dry-monads-1.6.0/lib/dry/monads/try.rb:71:in `[]'
        from /home/mihari/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/mihari-7.0.0/lib/mihari/commands/search.rb:28:in `search'
        from /home/mihari/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/thor-1.3.0/lib/thor/command.rb:28:in `run'
        from /home/mihari/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/thor-hollaback-0.2.1/lib/thor/hollaback.rb:71:in `block in run'
        from /home/mihari/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/hollaback-0.1.1/lib/hollaback/sequence.rb:34:in `call'
        from /home/mihari/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/hollaback-0.1.1/lib/hollaback/sequence.rb:27:in `block (2 levels) in around'
        from /home/mihari/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/mihari-7.0.0/lib/mihari/database.rb:157:in `with_db_connection'
        from /home/mihari/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/mihari-7.0.0/lib/mihari/concerns/database_connectable.rb:12:in `with_db_connection'
        from /home/mihari/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/hollaback-0.1.1/lib/hollaback/callback.rb:16:in `block in build'
        from /home/mihari/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/hollaback-0.1.1/lib/hollaback/sequence.rb:27:in `block in around'
        from /home/mihari/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/hollaback-0.1.1/lib/hollaback/sequence.rb:34:in `call'
        from /home/mihari/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/hollaback-0.1.1/lib/hollaback/sequence.rb:27:in `block (2 levels) in around'
        from /home/mihari/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/mihari-7.0.0/lib/mihari/cli/application.rb:42:in `safe_execute'
        from /home/mihari/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/hollaback-0.1.1/lib/hollaback/callback.rb:16:in `block in build'
        from /home/mihari/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/hollaback-0.1.1/lib/hollaback/sequence.rb:27:in `block in around'
        from /home/mihari/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/hollaback-0.1.1/lib/hollaback/sequence.rb:34:in `call'
        from /home/mihari/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/thor-hollaback-0.2.1/lib/thor/hollaback.rb:71:in `run'
        from /home/mihari/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/thor-1.3.0/lib/thor/invocation.rb:127:in `invoke_command'
        from /home/mihari/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/thor-1.3.0/lib/thor.rb:527:in `dispatch'
        from /home/mihari/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/thor-1.3.0/lib/thor/base.rb:584:in `start'
        from /home/mihari/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/mihari-7.0.0/exe/mihari:9:in `<top (required)>'
        from /home/mihari/.rbenv/versions/3.3.0/bin/mihari:25:in `load'
        from /home/mihari/.rbenv/versions/3.3.0/bin/mihari:25:in `<main>'
/home/mihari/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/dry-monads-1.6.0/lib/dry/monads/right_biased.rb:261:in `value!': value! was called on Try::Error(TypeError: no implicit conversion of Mihari::Models::Rule into Hash) (Dry::Monads::UnwrapError)
        from /home/mihari/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/mihari-7.0.0/lib/mihari/commands/search.rb:36:in `search'
        from /home/mihari/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/thor-1.3.0/lib/thor/command.rb:28:in `run'
        from /home/mihari/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/thor-hollaback-0.2.1/lib/thor/hollaback.rb:71:in `block in run'
        from /home/mihari/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/hollaback-0.1.1/lib/hollaback/sequence.rb:34:in `call'
        from /home/mihari/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/hollaback-0.1.1/lib/hollaback/sequence.rb:27:in `block (2 levels) in around'
        from /home/mihari/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/mihari-7.0.0/lib/mihari/database.rb:157:in `with_db_connection'
        from /home/mihari/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/mihari-7.0.0/lib/mihari/concerns/database_connectable.rb:12:in `with_db_connection'
        from /home/mihari/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/hollaback-0.1.1/lib/hollaback/callback.rb:16:in `block in build'
        from /home/mihari/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/hollaback-0.1.1/lib/hollaback/sequence.rb:27:in `block in around'
        from /home/mihari/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/hollaback-0.1.1/lib/hollaback/sequence.rb:34:in `call'
        from /home/mihari/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/hollaback-0.1.1/lib/hollaback/sequence.rb:27:in `block (2 levels) in around'
        from /home/mihari/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/mihari-7.0.0/lib/mihari/cli/application.rb:42:in `safe_execute'
        from /home/mihari/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/hollaback-0.1.1/lib/hollaback/callback.rb:16:in `block in build'
        from /home/mihari/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/hollaback-0.1.1/lib/hollaback/sequence.rb:27:in `block in around'
        from /home/mihari/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/hollaback-0.1.1/lib/hollaback/sequence.rb:34:in `call'
        from /home/mihari/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/thor-hollaback-0.2.1/lib/thor/hollaback.rb:71:in `run'
        from /home/mihari/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/thor-1.3.0/lib/thor/invocation.rb:127:in `invoke_command'
        from /home/mihari/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/thor-1.3.0/lib/thor.rb:527:in `dispatch'
        from /home/mihari/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/thor-1.3.0/lib/thor/base.rb:584:in `start'
        from /home/mihari/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/mihari-7.0.0/exe/mihari:9:in `<top (required)>'
        from /home/mihari/.rbenv/versions/3.3.0/bin/mihari:25:in `load'
        from /home/mihari/.rbenv/versions/3.3.0/bin/mihari:25:in `<main>'
mihari@mihari:~$

Any help is appreciated. Thanks a lot for this amazing project!

ninoseki added a commit that referenced this issue Jan 1, 2024
ninoseki added a commit that referenced this issue Jan 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant