Skip to content

Hanami 2.2 server fails to start with dry-system 1.2 #281

@wuarmin

Description

@wuarmin

Hey @flash-gordon

Describe the bug

If I start the hanami server I get following backtrace:

! Unable to load application: ArgumentError: wrong number of arguments (given 0, expected 1+)
/usr/local/bundle/gems/dry-initializer-3.2.0/lib/dry/initializer/config.rb:112 class_eval:2:in `__dry_initializer_initialize__': wrong number of arguments (given 0, expected 1+) (ArgumentError)
        from /usr/local/bundle/gems/dry-initializer-3.2.0/lib/dry/initializer/mixin/root.rb:11:in `initialize'
        from /usr/local/bundle/gems/dry-auto_inject-1.1.0/lib/dry/auto_inject/strategies/kwargs.rb:68:in `block (2 levels) in define_initialize_with_splat'
        from /usr/local/bundle/gems/dry-auto_inject-1.1.0/lib/dry/auto_inject/strategies/kwargs.rb:19:in `new'
        from /usr/local/bundle/gems/dry-auto_inject-1.1.0/lib/dry/auto_inject/strategies/kwargs.rb:19:in `block (2 levels) in define_new'
        from /usr/local/bundle/gems/dry-system-1.2.0/lib/dry/system/loader.rb:54:in `call'
        from /usr/local/bundle/gems/dry-system-1.2.0/lib/dry/system/component.rb:64:in `instance'
        from /usr/local/bundle/gems/dry-system-1.2.0/lib/dry/system/auto_registrar.rb:34:in `block (2 levels) in call'
        from /usr/local/bundle/gems/dry-core-1.1.0/lib/dry/core/container/item/callable.rb:16:in `call'
        from /usr/local/bundle/gems/dry-core-1.1.0/lib/dry/core/container/resolver.rb:36:in `call'
        from /usr/local/bundle/gems/dry-core-1.1.0/lib/dry/core/container/mixin.rb:132:in `resolve'
        from /usr/local/bundle/gems/dry-system-1.2.0/lib/dry/system/container.rb:493:in `resolve'
        from /usr/local/bundle/gems/dry-system-1.2.0/lib/dry/system/container.rb:327:in `block (2 levels) in finalize!'
        from /usr/local/bundle/gems/dry-system-1.2.0/lib/dry/system/container.rb:327:in `each'
        from /usr/local/bundle/gems/dry-system-1.2.0/lib/dry/system/container.rb:327:in `block in finalize!'
        from /usr/local/bundle/gems/dry-system-1.2.0/lib/dry/system/container.rb:665:in `run_hooks'
        from /usr/local/bundle/gems/dry-system-1.2.0/lib/dry/system/container.rb:322:in `finalize!'
        from /usr/local/bundle/gems/hanami-2.2.1/lib/hanami/slice.rb:330:in `boot'
        from /usr/local/bundle/gems/hanami-2.2.1/lib/hanami/slice_registrar.rb:64:in `each_value'
        from /usr/local/bundle/gems/hanami-2.2.1/lib/hanami/slice_registrar.rb:64:in `each'
        from /usr/local/bundle/gems/hanami-2.2.1/lib/hanami/slice.rb:331:in `boot'
        from /usr/local/bundle/gems/hanami-2.2.1/lib/hanami.rb:214:in `boot'
        from /usr/local/bundle/gems/hanami-2.2.1/lib/hanami/boot.rb:5:in `<top (required)>'
        from /usr/local/lib/ruby/3.3.0/bundled_gems.rb:75:in `require'
        from /usr/local/lib/ruby/3.3.0/bundled_gems.rb:75:in `block (2 levels) in replace_require'
        from config.ru:3:in `block in <main>'
        from /usr/local/bundle/gems/rack-2.2.10/lib/rack/builder.rb:116:in `eval'
        from /usr/local/bundle/gems/rack-2.2.10/lib/rack/builder.rb:116:in `new_from_string'
        from /usr/local/bundle/gems/rack-2.2.10/lib/rack/builder.rb:105:in `load_file'
        from /usr/local/bundle/gems/rack-2.2.10/lib/rack/builder.rb:66:in `parse_file'
        from /usr/local/bundle/gems/puma-6.5.0/lib/puma/configuration.rb:384:in `load_rackup'
        from /usr/local/bundle/gems/puma-6.5.0/lib/puma/configuration.rb:297:in `app'
        from /usr/local/bundle/gems/puma-6.5.0/lib/puma/runner.rb:166:in `load_and_bind'
        from /usr/local/bundle/gems/puma-6.5.0/lib/puma/single.rb:44:in `run'
        from /usr/local/bundle/gems/puma-6.5.0/lib/puma/launcher.rb:196:in `run'
        from /usr/local/bundle/gems/puma-6.5.0/lib/puma/cli.rb:75:in `run'
        from /usr/local/bundle/gems/puma-6.5.0/bin/puma:10:in `<top (required)>'
        from /usr/local/bundle/bin/puma:25:in `load'
        from /usr/local/bundle/bin/puma:25:in `<main>'

To Reproduce

calling bundle update at a Hanami 2.2 project updates dry-system to 1.2 because of
https://github.com/hanami/hanami/blob/2ca35811d4f2c7b0535c5bffdd973db9327f92ca/hanami.gemspec#L39

Expected behavior

The hanami server should start with no errors.

My environment

  • Affects my production application: NO
  • Ruby version: 3.3.5
  • OS: Debian bookworm

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions