# Bug DREAM-126 - Some previews in the Lookbook do not work

Project: Stream Design System
Status: closed
URL: https://community.openproject.org/work_packages/DREAM-126

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Module |  |
| Target versions | 14.5.0 |
| Observed in versions | 14.4.0 |
| Sprint |  |
| Backlog bucket |  |
| Bug found in version (deprecated) | 14.4.x |
| Requires doc change | No |
| Accessibility | No |
| Pull preview |  |
| List |  |
| Labels |  |

## People

| Attribute | Value |
| --- | --- |
| Assignee | Oliver Günther |
| Accountable | Oliver Günther |
| Product manager |  |
| Developers | OP Dev Dream Team |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Planning

| Attribute | Value |
| --- | --- |
| Relevance |  |

## Costs

| Attribute | Value |
| --- | --- |
| Votes |  |
| Work |  |
| Labor costs |  |

## Description

### Steps to reproduce

*   Open some lookbook components, e.g.
    
    *   [https://qa.openproject-edge.com/lookbook/inspect/OpenProject/Progress/modal/work\_based](https://qa.openproject-edge.com/lookbook/inspect/OpenProject/Progress/modal/work_based)
        
    *   [https://qa.openproject-edge.com/lookbook/inspect/OpenProject/Progress/modal/status\_based](https://qa.openproject-edge.com/lookbook/inspect/OpenProject/Progress/modal/status_based)
        
    *   [https://qa.openproject-edge.com/lookbook/inspect/OpenProject/Shares/share\_dialog/project\_query](https://qa.openproject-edge.com/lookbook/inspect/OpenProject/Shares/share_dialog/project_query)
        
    *   https://qa.openproject-edge.com/lookbook/inspect/OpenProject/Shares/share\_dialog/work\_package
        
    *   [https://qa.openproject-edge.com/lookbook/inspect/OpenProject/Users/avatar/default](https://qa.openproject-edge.com/lookbook/inspect/OpenProject/Users/avatar/default)
        
    *   https://qa.openproject-edge.com/lookbook/inspect/OpenProject/Users/avatar/sizes
        

### What is the buggy behavior?

It shows a &quot;Factory not registered&quot; error instead of the preview of the components.

### What is the expected behavior?

There should be a proper preview instead of an error message.

### Screenshots and other files (one example)

<img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/173441/content">

###   

### Backtrace (one example - is different for different fails)

```text

KeyError

Factory not registered: "user"

vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/hash_with_indifferent_access.rb [line 196]

#   counters.fetch('foo')          # => 1
#   counters.fetch(:bar, 0)        # => 0
#   counters.fetch(:bar) { |key| 0 } # => 0
#   counters.fetch(:zoo)           # => KeyError: key not found: "zoo"
def fetch(key, *extras)
  super(convert_key(key), *extras)
end
# Same as <tt>Hash#dig</tt> where the key passed as argument can be
# either a string or a symbol:
#

Full stack trace:
/app/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/hash_with_indifferent_access.rb:196:in `fetch'
/app/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/hash_with_indifferent_access.rb:196:in `fetch'
/app/vendor/bundle/ruby/3.3.0/gems/factory_bot-6.4.6/lib/factory_bot/registry.rb:23:in `find'
/app/vendor/bundle/ruby/3.3.0/gems/factory_bot-6.4.6/lib/factory_bot/decorator.rb:10:in `method_missing'
/app/vendor/bundle/ruby/3.3.0/gems/factory_bot-6.4.6/lib/factory_bot/internal.rb:70:in `factory_by_name'
/app/vendor/bundle/ruby/3.3.0/gems/factory_bot-6.4.6/lib/factory_bot/factory_runner.rb:12:in `run'
/app/vendor/bundle/ruby/3.3.0/gems/factory_bot-6.4.6/lib/factory_bot/strategy_syntax_method_registrar.rb:28:in `block in define_singular_strategy_method'
/app/lookbook/previews/open_project/users/avatar_component_preview.rb:11:in `default'
/app/vendor/bundle/ruby/3.3.0/gems/lookbook-2.3.2/lib/lookbook/preview.rb:48:in `public_send'
/app/vendor/bundle/ruby/3.3.0/gems/lookbook-2.3.2/lib/lookbook/preview.rb:48:in `render_args'
/app/vendor/bundle/ruby/3.3.0/gems/lookbook-2.3.2/lib/lookbook/entities/preview_entity.rb:10:in `render_args'
/app/vendor/bundle/ruby/3.3.0/gems/lookbook-2.3.2/lib/lookbook/preview_controller_actions.rb:16:in `render_scenario_to_string'
/app/vendor/bundle/ruby/3.3.0/gems/actionpack-7.1.3.4/lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
/app/vendor/bundle/ruby/3.3.0/gems/actionpack-7.1.3.4/lib/abstract_controller/base.rb:224:in `process_action'
/app/vendor/bundle/ruby/3.3.0/gems/actionpack-7.1.3.4/lib/action_controller/metal/rendering.rb:165:in `process_action'
/app/vendor/bundle/ruby/3.3.0/gems/actionpack-7.1.3.4/lib/abstract_controller/callbacks.rb:259:in `block in process_action'
/app/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/callbacks.rb:121:in `block in run_callbacks'
/app/vendor/bundle/ruby/3.3.0/gems/turbo-rails-2.0.6/lib/turbo-rails.rb:24:in `with_request_id'
/app/vendor/bundle/ruby/3.3.0/gems/turbo-rails-2.0.6/app/controllers/concerns/turbo/request_id_tracking.rb:10:in `turbo_tracking_request_id'
/app/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/callbacks.rb:130:in `block in run_callbacks'
/app/vendor/bundle/ruby/3.3.0/gems/actiontext-7.1.3.4/lib/action_text/rendering.rb:23:in `with_renderer'
/app/vendor/bundle/ruby/3.3.0/gems/actiontext-7.1.3.4/lib/action_text/engine.rb:69:in `block (4 levels) in <class:Engine>'
/app/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/callbacks.rb:130:in `instance_exec'
/app/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/callbacks.rb:130:in `block in run_callbacks'
/app/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/callbacks.rb:141:in `run_callbacks'
/app/vendor/bundle/ruby/3.3.0/gems/actionpack-7.1.3.4/lib/abstract_controller/callbacks.rb:258:in `process_action'
/app/vendor/bundle/ruby/3.3.0/gems/actionpack-7.1.3.4/lib/action_controller/metal/rescue.rb:25:in `process_action'
/app/vendor/bundle/ruby/3.3.0/gems/actionpack-7.1.3.4/lib/action_controller/metal/instrumentation.rb:74:in `block in process_action'
/app/vendor/bundle/ruby/3.3.0/gems/appsignal-3.10.0/lib/appsignal/hooks/active_support_notifications.rb:19:in `block in instrument'
/app/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/notifications/instrumenter.rb:58:in `instrument'
/app/vendor/bundle/ruby/3.3.0/gems/appsignal-3.10.0/lib/appsignal/hooks/active_support_notifications.rb:18:in `instrument'
/app/vendor/bundle/ruby/3.3.0/gems/actionpack-7.1.3.4/lib/action_controller/metal/instrumentation.rb:73:in `process_action'
/app/vendor/bundle/ruby/3.3.0/gems/actionpack-7.1.3.4/lib/action_controller/metal/params_wrapper.rb:261:in `process_action'
/app/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.3.4/lib/active_record/railties/controller_runtime.rb:32:in `process_action'
/app/vendor/bundle/ruby/3.3.0/gems/actionpack-7.1.3.4/lib/abstract_controller/base.rb:160:in `process'
/app/vendor/bundle/ruby/3.3.0/gems/actionview-7.1.3.4/lib/action_view/rendering.rb:40:in `process'
/app/vendor/bundle/ruby/3.3.0/gems/lookbook-2.3.2/app/controllers/concerns/lookbook/targetable_concern.rb:99:in `block in inspector_data'
/app/vendor/bundle/ruby/3.3.0/gems/lookbook-2.3.2/app/controllers/concerns/lookbook/targetable_concern.rb:98:in `map'
/app/vendor/bundle/ruby/3.3.0/gems/lookbook-2.3.2/app/controllers/concerns/lookbook/targetable_concern.rb:98:in `inspector_data'
/app/vendor/bundle/ruby/3.3.0/gems/lookbook-2.3.2/app/controllers/concerns/lookbook/with_panels_concern.rb:18:in `block in main_panels'
/app/vendor/bundle/ruby/3.3.0/gems/lookbook-2.3.2/app/controllers/concerns/lookbook/with_panels_concern.rb:17:in `map'
/app/vendor/bundle/ruby/3.3.0/gems/lookbook-2.3.2/app/controllers/concerns/lookbook/with_panels_concern.rb:17:in `main_panels'
/app/vendor/bundle/ruby/3.3.0/gems/lookbook-2.3.2/app/controllers/lookbook/inspector_controller.rb:14:in `show'
/app/vendor/bundle/ruby/3.3.0/gems/actionpack-7.1.3.4/lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
/app/vendor/bundle/ruby/3.3.0/gems/actionpack-7.1.3.4/lib/abstract_controller/base.rb:224:in `process_action'
/app/vendor/bundle/ruby/3.3.0/gems/actionpack-7.1.3.4/lib/action_controller/metal/rendering.rb:165:in `process_action'
/app/vendor/bundle/ruby/3.3.0/gems/actionpack-7.1.3.4/lib/abstract_controller/callbacks.rb:259:in `block in process_action'
/app/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/callbacks.rb:121:in `block in run_callbacks'
/app/vendor/bundle/ruby/3.3.0/gems/turbo-rails-2.0.6/lib/turbo-rails.rb:24:in `with_request_id'
/app/vendor/bundle/ruby/3.3.0/gems/turbo-rails-2.0.6/app/controllers/concerns/turbo/request_id_tracking.rb:10:in `turbo_tracking_request_id'
/app/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/callbacks.rb:130:in `block in run_callbacks'
/app/vendor/bundle/ruby/3.3.0/gems/actiontext-7.1.3.4/lib/action_text/rendering.rb:23:in `with_renderer'
/app/vendor/bundle/ruby/3.3.0/gems/actiontext-7.1.3.4/lib/action_text/engine.rb:69:in `block (4 levels) in <class:Engine>'
/app/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/callbacks.rb:130:in `instance_exec'
/app/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/callbacks.rb:130:in `block in run_callbacks'
/app/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/callbacks.rb:141:in `run_callbacks'
/app/vendor/bundle/ruby/3.3.0/gems/actionpack-7.1.3.4/lib/abstract_controller/callbacks.rb:258:in `process_action'
/app/vendor/bundle/ruby/3.3.0/gems/actionpack-7.1.3.4/lib/action_controller/metal/rescue.rb:25:in `process_action'
/app/vendor/bundle/ruby/3.3.0/gems/actionpack-7.1.3.4/lib/action_controller/metal/instrumentation.rb:74:in `block in process_action'
/app/vendor/bundle/ruby/3.3.0/gems/appsignal-3.10.0/lib/appsignal/hooks/active_support_notifications.rb:19:in `block in instrument'
/app/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/notifications/instrumenter.rb:58:in `instrument'
/app/vendor/bundle/ruby/3.3.0/gems/appsignal-3.10.0/lib/appsignal/hooks/active_support_notifications.rb:18:in `instrument'
/app/vendor/bundle/ruby/3.3.0/gems/actionpack-7.1.3.4/lib/action_controller/metal/instrumentation.rb:73:in `process_action'
/app/vendor/bundle/ruby/3.3.0/gems/actionpack-7.1.3.4/lib/action_controller/metal/params_wrapper.rb:261:in `process_action'
/app/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.3.4/lib/active_record/railties/controller_runtime.rb:32:in `process_action'
/app/vendor/bundle/ruby/3.3.0/gems/actionpack-7.1.3.4/lib/abstract_controller/base.rb:160:in `process'
/app/vendor/bundle/ruby/3.3.0/gems/actionview-7.1.3.4/lib/action_view/rendering.rb:40:in `process'
/app/vendor/bundle/ruby/3.3.0/gems/actionpack-7.1.3.4/lib/action_controller/metal.rb:227:in `dispatch'
/app/vendor/bundle/ruby/3.3.0/gems/actionpack-7.1.3.4/lib/action_controller/metal.rb:309:in `dispatch'
/app/vendor/bundle/ruby/3.3.0/gems/actionpack-7.1.3.4/lib/action_dispatch/routing/route_set.rb:49:in `dispatch'
/app/vendor/bundle/ruby/3.3.0/gems/actionpack-7.1.3.4/lib/action_dispatch/routing/route_set.rb:32:in `serve'
/app/vendor/bundle/ruby/3.3.0/gems/actionpack-7.1.3.4/lib/action_dispatch/journey/router.rb:51:in `block in serve'
/app/vendor/bundle/ruby/3.3.0/gems/actionpack-7.1.3.4/lib/action_dispatch/journey/router.rb:131:in `block in find_routes'
/app/vendor/bundle/ruby/3.3.0/gems/actionpack-7.1.3.4/lib/action_dispatch/journey/router.rb:124:in `each'
/app/vendor/bundle/ruby/3.3.0/gems/actionpack-7.1.3.4/lib/action_dispatch/journey/router.rb:124:in `find_routes'
/app/vendor/bundle/ruby/3.3.0/gems/actionpack-7.1.3.4/lib/action_dispatch/journey/router.rb:32:in `serve'
/app/vendor/bundle/ruby/3.3.0/gems/actionpack-7.1.3.4/lib/action_dispatch/routing/route_set.rb:882:in `call'
/app/vendor/bundle/ruby/3.3.0/gems/railties-7.1.3.4/lib/rails/engine.rb:536:in `call'
/app/vendor/bundle/ruby/3.3.0/gems/railties-7.1.3.4/lib/rails/railtie.rb:226:in `public_send'
/app/vendor/bundle/ruby/3.3.0/gems/railties-7.1.3.4/lib/rails/railtie.rb:226:in `method_missing'
/app/vendor/bundle/ruby/3.3.0/gems/actionpack-7.1.3.4/lib/action_dispatch/routing/mapper.rb:22:in `block in <class:Constraints>'
/app/vendor/bundle/ruby/3.3.0/gems/actionpack-7.1.3.4/lib/action_dispatch/routing/mapper.rb:51:in `serve'
/app/vendor/bundle/ruby/3.3.0/gems/actionpack-7.1.3.4/lib/action_dispatch/journey/router.rb:51:in `block in serve'
/app/vendor/bundle/ruby/3.3.0/gems/actionpack-7.1.3.4/lib/action_dispatch/journey/router.rb:131:in `block in find_routes'
/app/vendor/bundle/ruby/3.3.0/gems/actionpack-7.1.3.4/lib/action_dispatch/journey/router.rb:124:in `each'
/app/vendor/bundle/ruby/3.3.0/gems/actionpack-7.1.3.4/lib/action_dispatch/journey/router.rb:124:in `find_routes'
/app/vendor/bundle/ruby/3.3.0/gems/actionpack-7.1.3.4/lib/action_dispatch/journey/router.rb:32:in `serve'
/app/vendor/bundle/ruby/3.3.0/gems/actionpack-7.1.3.4/lib/action_dispatch/routing/route_set.rb:882:in `call'
/app/vendor/bundle/ruby/3.3.0/bundler/gems/omniauth-fe862f986b2e/lib/omniauth/builder.rb:64:in `call'
/app/vendor/bundle/ruby/3.3.0/bundler/gems/omniauth-fe862f986b2e/lib/omniauth/strategy.rb:425:in `call_app!'
/app/vendor/bundle/ruby/3.3.0/bundler/gems/omniauth-openid-connect-d63f5967514d/lib/omniauth/strategies/openid_connect.rb:118:in `other_phase'
/app/vendor/bundle/ruby/3.3.0/bundler/gems/omniauth-openid-connect-d63f5967514d/lib/omniauth/strategies/openid_connect/backchannel_logout.rb:17:in `other_phase'
/app/vendor/bundle/ruby/3.3.0/bundler/gems/omniauth-fe862f986b2e/lib/omniauth/strategy.rb:190:in `call!'
/app/vendor/bundle/ruby/3.3.0/bundler/gems/omniauth-fe862f986b2e/lib/omniauth/strategy.rb:169:in `call'
/app/vendor/bundle/ruby/3.3.0/bundler/gems/omniauth-fe862f986b2e/lib/omniauth/builder.rb:64:in `call'
/app/vendor/bundle/ruby/3.3.0/bundler/gems/omniauth-fe862f986b2e/lib/omniauth/strategy.rb:425:in `call_app!'
/app/vendor/bundle/ruby/3.3.0/gems/omniauth-saml-1.10.3/lib/omniauth/strategies/saml.rb:86:in `other_phase'
/app/vendor/bundle/ruby/3.3.0/bundler/gems/omniauth-fe862f986b2e/lib/omniauth/strategy.rb:190:in `call!'
/app/vendor/bundle/ruby/3.3.0/bundler/gems/omniauth-fe862f986b2e/lib/omniauth/strategy.rb:169:in `call'
/app/vendor/bundle/ruby/3.3.0/bundler/gems/omniauth-fe862f986b2e/lib/omniauth/builder.rb:64:in `call'
/app/vendor/bundle/ruby/3.3.0/bundler/gems/omniauth-fe862f986b2e/lib/omniauth/builder.rb:64:in `call'
/app/vendor/bundle/ruby/3.3.0/gems/rack-attack-6.7.0/lib/rack/attack.rb:103:in `call'
/app/vendor/bundle/ruby/3.3.0/gems/rack-2.2.9/lib/rack/tempfile_reaper.rb:15:in `call'
/app/vendor/bundle/ruby/3.3.0/gems/rack-attack-6.7.0/lib/rack/attack.rb:127:in `call'
/app/vendor/bundle/ruby/3.3.0/gems/rack-2.2.9/lib/rack/static.rb:161:in `call'
/app/vendor/bundle/ruby/3.3.0/gems/rack-2.2.9/lib/rack/tempfile_reaper.rb:15:in `call'
/app/vendor/bundle/ruby/3.3.0/gems/rack-2.2.9/lib/rack/etag.rb:27:in `call'
/app/vendor/bundle/ruby/3.3.0/gems/rack-2.2.9/lib/rack/deflater.rb:44:in `call'
/app/vendor/bundle/ruby/3.3.0/gems/rack-2.2.9/lib/rack/conditional_get.rb:27:in `call'
/app/vendor/bundle/ruby/3.3.0/gems/rack-2.2.9/lib/rack/head.rb:12:in `call'
/app/vendor/bundle/ruby/3.3.0/gems/actionpack-7.1.3.4/lib/action_dispatch/http/permissions_policy.rb:36:in `call'
/app/vendor/bundle/ruby/3.3.0/gems/actionpack-7.1.3.4/lib/action_dispatch/http/content_security_policy.rb:33:in `call'
/app/vendor/bundle/ruby/3.3.0/gems/rack-2.2.9/lib/rack/session/abstract/id.rb:266:in `context'
/app/vendor/bundle/ruby/3.3.0/gems/rack-2.2.9/lib/rack/session/abstract/id.rb:260:in `call'
/app/vendor/bundle/ruby/3.3.0/gems/actionpack-7.1.3.4/lib/action_dispatch/middleware/cookies.rb:689:in `call'
/app/vendor/bundle/ruby/3.3.0/gems/actionpack-7.1.3.4/lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
/app/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/callbacks.rb:101:in `run_callbacks'
/app/vendor/bundle/ruby/3.3.0/gems/actionpack-7.1.3.4/lib/action_dispatch/middleware/callbacks.rb:28:in `call'
/app/vendor/bundle/ruby/3.3.0/gems/appsignal-3.10.0/lib/appsignal/rack/abstract_middleware.rb:95:in `call_app'
/app/vendor/bundle/ruby/3.3.0/gems/appsignal-3.10.0/lib/appsignal/rack/abstract_middleware.rb:90:in `instrument_app_call'
/app/vendor/bundle/ruby/3.3.0/gems/appsignal-3.10.0/lib/appsignal/rack/abstract_middleware.rb:113:in `instrument_app_call_with_exception_handling'
/app/vendor/bundle/ruby/3.3.0/gems/appsignal-3.10.0/lib/appsignal/rack/abstract_middleware.rb:55:in `call'
/app/vendor/bundle/ruby/3.3.0/gems/actionpack-7.1.3.4/lib/action_dispatch/middleware/debug_exceptions.rb:29:in `call'
/app/vendor/bundle/ruby/3.3.0/gems/actionpack-7.1.3.4/lib/action_dispatch/middleware/show_exceptions.rb:31:in `call'
/app/vendor/bundle/ruby/3.3.0/gems/rack-cors-2.0.2/lib/rack/cors.rb:102:in `call'
/app/vendor/bundle/ruby/3.3.0/gems/lograge-0.14.0/lib/lograge/rails_ext/rack/logger.rb:18:in `call_app'
/app/vendor/bundle/ruby/3.3.0/gems/railties-7.1.3.4/lib/rails/rack/logger.rb:24:in `block in call'
/app/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/tagged_logging.rb:135:in `block in tagged'
/app/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/tagged_logging.rb:39:in `tagged'
/app/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/tagged_logging.rb:135:in `tagged'
/app/vendor/bundle/ruby/3.3.0/gems/activesupport-7.1.3.4/lib/active_support/broadcast_logger.rb:240:in `method_missing'
/app/vendor/bundle/ruby/3.3.0/gems/railties-7.1.3.4/lib/rails/rack/logger.rb:24:in `call'
/app/vendor/plugins/openproject-multitenancy/lib/multitenancy/elevators/mapped_domain_elevator.rb:106:in `block in call_tenant' 
```

### Environment information

**qa.openproject-edge.com**
