Skip to content

Avoid repeated logging of the same problem#14

Merged
rogercampos merged 1 commit intomainfrom
chore/simple-logging
Feb 13, 2026
Merged

Avoid repeated logging of the same problem#14
rogercampos merged 1 commit intomainfrom
chore/simple-logging

Conversation

@rogercampos
Copy link
Copy Markdown
Contributor

I saw an error running e2e locally. After investigation, the root cause was this: https://github.com/factorialco/factorial/pull/88951

However, before the real error the log also showed 8 different reports of errors from captain hook (see at the end). This is because the original error was an ArgumentError, and although totally unrelated with that cause, this gem was rescuing, printing the log, and re-raising. Not only that, it did it 8 times, one per registered hook.

I think there's no value in this rescue-log-reraise, if there's a problem let the exception bubble up and be reported normally, as any other kind of exception.

[dc689af8-946c-405e-92ae-ea001e992e4c] [CY_DEV]   ↳ components/people_groups/app/interactors/people_groups/refresh_memberships.rb:60:in `old_members'
  [dc689af8-946c-405e-92ae-ea001e992e4c] [CY_DEV]   PeopleGroups::PeopleGroupMembership Insert (0.4ms)  INSERT INTO `people_groups_people_group_memberships`
  (`people_group_id`,`access_id`,`created_at`,`updated_at`) VALUES (1, 2, '2026-02-12 14:15:27.965005', '2026-02-12 14:15:27.965005') AS `people_groups_people_group_memberships_values`
  [dc689af8-946c-405e-92ae-ea001e992e4c] [CY_DEV]   ↳ components/people_groups/app/interactors/people_groups/refresh_memberships.rb:72:in `create_memberships!'
  [dc689af8-946c-405e-92ae-ea001e992e4c] [CY_DEV]   PeopleGroups::PeopleGroupMembership Load (0.3ms)  SELECT `people_groups_people_group_memberships`.`id`,
  `people_groups_people_group_memberships`.`people_group_id`, `people_groups_people_group_memberships`.`access_id` FROM `people_groups_people_group_memberships` WHERE
  `people_groups_people_group_memberships`.`people_group_id` = 1 AND `people_groups_people_group_memberships`.`access_id` = 2
  [dc689af8-946c-405e-92ae-ea001e992e4c] [CY_DEV]   ↳ components/people_groups/app/interactors/people_groups/refresh_memberships.rb:103:in `publish_events'
  [dc689af8-946c-405e-92ae-ea001e992e4c] [CY_DEV] [ActiveJob] Enqueued WorkingConditions::EventHandlers::PeopleAssignment::PeopleGroupChanged (Job ID: e2b2fc34-b282-43ef-a476-fab852f49cfc) to
  Sidekiq(default) with arguments: {:people_group_id=>1, :membership_id=>1, :access_id=>2, :company_id=>1, :metadata=>{:current_actor=>{:company_id=>1, :company_ids=>nil}}},
  "PeopleGroups::Events::PeopleGroupJoined"
  [dc689af8-946c-405e-92ae-ea001e992e4c] [CY_DEV]   TRANSACTION (1.6ms)  ROLLBACK
  [dc689af8-946c-405e-92ae-ea001e992e4c] [CY_DEV]   ↳ app/services/handle_transaction.rb:80:in `ensure_open_transaction'
  Argument error running hook: Repositories::Hooks::EntityLimitHook with method: update_members, args: [], kwargs: {:dto=><Features::Dtos::FeatureMembership::UpdateMembers add_access_ids=[2]
  add_employee_ids=[] company_id=1 feature_id="expenses_per_user_pricing_create_expenses" remove_access_ids=[] remove_employee_ids=[]>,
  :policy_context=>#<Permissions::PolicyContexts::Company:0x00000001558fb870 @cache={}, @oauth_context=nil, @api_key_context=nil, @company=#<Company id: 1, name: "Everyday Software", created_at: "2026-02-12
  14:15:24.000000000 +0000", updated_at: "2026-02-12 14:15:26.000000000 +0000", locale: "en", awareness_attribution_id: nil, interest_attribution_id: nil, goal_attribution_id: nil, tos: true, yearly_hours:
  1882, flag: nil, onboarded_on: "2026-02-12", company_enrichment_id: nil, number_employees: nil, investigated_company_size: nil, subscription_id: 2, to_be_deleted: nil, sector: nil, knows_flex_benefits:
  nil, offers_health: nil, offers_restaurant: nil, offers_transport: nil, offers_kindergarten: nil, benefits_broker_id: nil, manager_visibility: "no_visibility", gdpr_tos: true, account_owner_id: nil,
  payroll_management: nil, operations_owner_id: nil, payroll_company_metadata_id: nil, marketing_remote_id: nil, marketing_remote_last_updated: nil, attendance_manager_visibility: "no_visibility",
  has_attendance: false, payroll_status: "none", quipu_id: nil, has_clock_in: true, has_geolocation: false, attendance_secret_key: "IU5HHLPKDXUBLHYY6XQBXG57525MAVKX", has_qr_code: false, slug: nil,
  brand_color: nil, header_font: nil, body_font: nil, country_factorial_domain: nil, has_desktop_clock_in_blocked: nil, tos_accepted_at: "2026-02-12 14:15:24.000000000 +0000", has_trial_company: nil,
  generated_trial_company: nil, production_company_id: nil, delete_data: false, headquarter_id: 1, regular_access_delay_in_days: 0, industry: nil, discarded_at: nil, public_email: nil, owner_id: nil,
  time_aware_contract_hours_calculation_starts_at: "3000-01-01", worked_time_materialized_on: nil, undeletable_reason: nil, contract_hours_rest_days_calculation_starts_at: "2025-09-01",
  employee_company_identifier_strategy: nil>>}
  Argument error running hook: Repositories::Hooks::ValidateDtoHook with method: update_members, args: [], kwargs: {:dto=><Features::Dtos::FeatureMembership::UpdateMembers add_access_ids=[2]
  add_employee_ids=[] company_id=1 feature_id="expenses_per_user_pricing_create_expenses" remove_access_ids=[] remove_employee_ids=[]>,
  :policy_context=>#<Permissions::PolicyContexts::Company:0x00000001558fb870 @cache={}, @oauth_context=nil, @api_key_context=nil, @company=#<Company id: 1, name: "Everyday Software", created_at: "2026-02-12
  14:15:24.000000000 +0000", updated_at: "2026-02-12 14:15:26.000000000 +0000", locale: "en", awareness_attribution_id: nil, interest_attribution_id: nil, goal_attribution_id: nil, tos: true, yearly_hours:
  1882, flag: nil, onboarded_on: "2026-02-12", company_enrichment_id: nil, number_employees: nil, investigated_company_size: nil, subscription_id: 2, to_be_deleted: nil, sector: nil, knows_flex_benefits:
  nil, offers_health: nil, offers_restaurant: nil, offers_transport: nil, offers_kindergarten: nil, benefits_broker_id: nil, manager_visibility: "no_visibility", gdpr_tos: true, account_owner_id: nil,
  payroll_management: nil, operations_owner_id: nil, payroll_company_metadata_id: nil, marketing_remote_id: nil, marketing_remote_last_updated: nil, attendance_manager_visibility: "no_visibility",
  has_attendance: false, payroll_status: "none", quipu_id: nil, has_clock_in: true, has_geolocation: false, attendance_secret_key: "IU5HHLPKDXUBLHYY6XQBXG57525MAVKX", has_qr_code: false, slug: nil,
  brand_color: nil, header_font: nil, body_font: nil, country_factorial_domain: nil, has_desktop_clock_in_blocked: nil, tos_accepted_at: "2026-02-12 14:15:24.000000000 +0000", has_trial_company: nil,
  generated_trial_company: nil, production_company_id: nil, delete_data: false, headquarter_id: 1, regular_access_delay_in_days: 0, industry: nil, discarded_at: nil, public_email: nil, owner_id: nil,
  time_aware_contract_hours_calculation_starts_at: "3000-01-01", worked_time_materialized_on: nil, undeletable_reason: nil, contract_hours_rest_days_calculation_starts_at: "2025-09-01",
  employee_company_identifier_strategy: nil>>}
  Argument error running hook: Repositories::Hooks::TenantPolicyHook with method: update_members, args: [], kwargs: {:dto=><Features::Dtos::FeatureMembership::UpdateMembers add_access_ids=[2]
  add_employee_ids=[] company_id=1 feature_id="expenses_per_user_pricing_create_expenses" remove_access_ids=[] remove_employee_ids=[]>,
  :policy_context=>#<Permissions::PolicyContexts::Company:0x00000001558fb870 @cache={}, @oauth_context=nil, @api_key_context=nil, @company=#<Company id: 1, name: "Everyday Software", created_at: "2026-02-12
  14:15:24.000000000 +0000", updated_at: "2026-02-12 14:15:26.000000000 +0000", locale: "en", awareness_attribution_id: nil, interest_attribution_id: nil, goal_attribution_id: nil, tos: true, yearly_hours:
  1882, flag: nil, onboarded_on: "2026-02-12", company_enrichment_id: nil, number_employees: nil, investigated_company_size: nil, subscription_id: 2, to_be_deleted: nil, sector: nil, knows_flex_benefits:
  nil, offers_health: nil, offers_restaurant: nil, offers_transport: nil, offers_kindergarten: nil, benefits_broker_id: nil, manager_visibility: "no_visibility", gdpr_tos: true, account_owner_id: nil,
  payroll_management: nil, operations_owner_id: nil, payroll_company_metadata_id: nil, marketing_remote_id: nil, marketing_remote_last_updated: nil, attendance_manager_visibility: "no_visibility",
  has_attendance: false, payroll_status: "none", quipu_id: nil, has_clock_in: true, has_geolocation: false, attendance_secret_key: "IU5HHLPKDXUBLHYY6XQBXG57525MAVKX", has_qr_code: false, slug: nil,
  brand_color: nil, header_font: nil, body_font: nil, country_factorial_domain: nil, has_desktop_clock_in_blocked: nil, tos_accepted_at: "2026-02-12 14:15:24.000000000 +0000", has_trial_company: nil,
  generated_trial_company: nil, production_company_id: nil, delete_data: false, headquarter_id: 1, regular_access_delay_in_days: 0, industry: nil, discarded_at: nil, public_email: nil, owner_id: nil,
  time_aware_contract_hours_calculation_starts_at: "3000-01-01", worked_time_materialized_on: nil, undeletable_reason: nil, contract_hours_rest_days_calculation_starts_at: "2025-09-01",
  employee_company_identifier_strategy: nil>>}
  Argument error running hook: Repositories::Hooks::WebhookTriggerHook with method: update_members, args: [], kwargs: {:dto=><Features::Dtos::FeatureMembership::UpdateMembers add_access_ids=[2]
  add_employee_ids=[] company_id=1 feature_id="expenses_per_user_pricing_create_expenses" remove_access_ids=[] remove_employee_ids=[]>,
  :policy_context=>#<Permissions::PolicyContexts::Company:0x00000001558fb870 @cache={}, @oauth_context=nil, @api_key_context=nil, @company=#<Company id: 1, name: "Everyday Software", created_at: "2026-02-12
  14:15:24.000000000 +0000", updated_at: "2026-02-12 14:15:26.000000000 +0000", locale: "en", awareness_attribution_id: nil, interest_attribution_id: nil, goal_attribution_id: nil, tos: true, yearly_hours:
  1882, flag: nil, onboarded_on: "2026-02-12", company_enrichment_id: nil, number_employees: nil, investigated_company_size: nil, subscription_id: 2, to_be_deleted: nil, sector: nil, knows_flex_benefits:
  nil, offers_health: nil, offers_restaurant: nil, offers_transport: nil, offers_kindergarten: nil, benefits_broker_id: nil, manager_visibility: "no_visibility", gdpr_tos: true, account_owner_id: nil,
  payroll_management: nil, operations_owner_id: nil, payroll_company_metadata_id: nil, marketing_remote_id: nil, marketing_remote_last_updated: nil, attendance_manager_visibility: "no_visibility",
  has_attendance: false, payroll_status: "none", quipu_id: nil, has_clock_in: true, has_geolocation: false, attendance_secret_key: "IU5HHLPKDXUBLHYY6XQBXG57525MAVKX", has_qr_code: false, slug: nil,
  brand_color: nil, header_font: nil, body_font: nil, country_factorial_domain: nil, has_desktop_clock_in_blocked: nil, tos_accepted_at: "2026-02-12 14:15:24.000000000 +0000", has_trial_company: nil,
  generated_trial_company: nil, production_company_id: nil, delete_data: false, headquarter_id: 1, regular_access_delay_in_days: 0, industry: nil, discarded_at: nil, public_email: nil, owner_id: nil,
  time_aware_contract_hours_calculation_starts_at: "3000-01-01", worked_time_materialized_on: nil, undeletable_reason: nil, contract_hours_rest_days_calculation_starts_at: "2025-09-01",
  employee_company_identifier_strategy: nil>>}
  Argument error running hook: Repositories::Hooks::BoundaryHook with method: update_members, args: [], kwargs: {:dto=><Features::Dtos::FeatureMembership::UpdateMembers add_access_ids=[2] add_employee_ids=[]
   company_id=1 feature_id="expenses_per_user_pricing_create_expenses" remove_access_ids=[] remove_employee_ids=[]>, :policy_context=>#<Permissions::PolicyContexts::Company:0x00000001558fb870 @cache={},
  @oauth_context=nil, @api_key_context=nil, @company=#<Company id: 1, name: "Everyday Software", created_at: "2026-02-12 14:15:24.000000000 +0000", updated_at: "2026-02-12 14:15:26.000000000 +0000", locale:
  "en", awareness_attribution_id: nil, interest_attribution_id: nil, goal_attribution_id: nil, tos: true, yearly_hours: 1882, flag: nil, onboarded_on: "2026-02-12", company_enrichment_id: nil,
  number_employees: nil, investigated_company_size: nil, subscription_id: 2, to_be_deleted: nil, sector: nil, knows_flex_benefits: nil, offers_health: nil, offers_restaurant: nil, offers_transport: nil,
  offers_kindergarten: nil, benefits_broker_id: nil, manager_visibility: "no_visibility", gdpr_tos: true, account_owner_id: nil, payroll_management: nil, operations_owner_id: nil,
  payroll_company_metadata_id: nil, marketing_remote_id: nil, marketing_remote_last_updated: nil, attendance_manager_visibility: "no_visibility", has_attendance: false, payroll_status: "none", quipu_id: nil,
   has_clock_in: true, has_geolocation: false, attendance_secret_key: "IU5HHLPKDXUBLHYY6XQBXG57525MAVKX", has_qr_code: false, slug: nil, brand_color: nil, header_font: nil, body_font: nil,
  country_factorial_domain: nil, has_desktop_clock_in_blocked: nil, tos_accepted_at: "2026-02-12 14:15:24.000000000 +0000", has_trial_company: nil, generated_trial_company: nil, production_company_id: nil,
  delete_data: false, headquarter_id: 1, regular_access_delay_in_days: 0, industry: nil, discarded_at: nil, public_email: nil, owner_id: nil, time_aware_contract_hours_calculation_starts_at: "3000-01-01",
  worked_time_materialized_on: nil, undeletable_reason: nil, contract_hours_rest_days_calculation_starts_at: "2025-09-01", employee_company_identifier_strategy: nil>>}
  Argument error running hook: Repositories::Hooks::ResourceHook with method: update_members, args: [], kwargs: {:dto=><Features::Dtos::FeatureMembership::UpdateMembers add_access_ids=[2] add_employee_ids=[]
   company_id=1 feature_id="expenses_per_user_pricing_create_expenses" remove_access_ids=[] remove_employee_ids=[]>, :policy_context=>#<Permissions::PolicyContexts::Company:0x00000001558fb870 @cache={},
  @oauth_context=nil, @api_key_context=nil, @company=#<Company id: 1, name: "Everyday Software", created_at: "2026-02-12 14:15:24.000000000 +0000", updated_at: "2026-02-12 14:15:26.000000000 +0000", locale:
  "en", awareness_attribution_id: nil, interest_attribution_id: nil, goal_attribution_id: nil, tos: true, yearly_hours: 1882, flag: nil, onboarded_on: "2026-02-12", company_enrichment_id: nil,
  number_employees: nil, investigated_company_size: nil, subscription_id: 2, to_be_deleted: nil, sector: nil, knows_flex_benefits: nil, offers_health: nil, offers_restaurant: nil, offers_transport: nil,
  offers_kindergarten: nil, benefits_broker_id: nil, manager_visibility: "no_visibility", gdpr_tos: true, account_owner_id: nil, payroll_management: nil, operations_owner_id: nil,
  payroll_company_metadata_id: nil, marketing_remote_id: nil, marketing_remote_last_updated: nil, attendance_manager_visibility: "no_visibility", has_attendance: false, payroll_status: "none", quipu_id: nil,
   has_clock_in: true, has_geolocation: false, attendance_secret_key: "IU5HHLPKDXUBLHYY6XQBXG57525MAVKX", has_qr_code: false, slug: nil, brand_color: nil, header_font: nil, body_font: nil,
  country_factorial_domain: nil, has_desktop_clock_in_blocked: nil, tos_accepted_at: "2026-02-12 14:15:24.000000000 +0000", has_trial_company: nil, generated_trial_company: nil, production_company_id: nil,
  delete_data: false, headquarter_id: 1, regular_access_delay_in_days: 0, industry: nil, discarded_at: nil, public_email: nil, owner_id: nil, time_aware_contract_hours_calculation_starts_at: "3000-01-01",
  worked_time_materialized_on: nil, undeletable_reason: nil, contract_hours_rest_days_calculation_starts_at: "2025-09-01", employee_company_identifier_strategy: nil>>}
  Argument error running hook: Repositories::Hooks::PolicyHook with method: update_members, args: [], kwargs: {:dto=><Features::Dtos::FeatureMembership::UpdateMembers add_access_ids=[2] add_employee_ids=[]
  company_id=1 feature_id="expenses_per_user_pricing_create_expenses" remove_access_ids=[] remove_employee_ids=[]>, :policy_context=>#<Permissions::PolicyContexts::Company:0x00000001558fb870 @cache={},
  @oauth_context=nil, @api_key_context=nil, @company=#<Company id: 1, name: "Everyday Software", created_at: "2026-02-12 14:15:24.000000000 +0000", updated_at: "2026-02-12 14:15:26.000000000 +0000", locale:
  "en", awareness_attribution_id: nil, interest_attribution_id: nil, goal_attribution_id: nil, tos: true, yearly_hours: 1882, flag: nil, onboarded_on: "2026-02-12", company_enrichment_id: nil,
  number_employees: nil, investigated_company_size: nil, subscription_id: 2, to_be_deleted: nil, sector: nil, knows_flex_benefits: nil, offers_health: nil, offers_restaurant: nil, offers_transport: nil,
  offers_kindergarten: nil, benefits_broker_id: nil, manager_visibility: "no_visibility", gdpr_tos: true, account_owner_id: nil, payroll_management: nil, operations_owner_id: nil,
  payroll_company_metadata_id: nil, marketing_remote_id: nil, marketing_remote_last_updated: nil, attendance_manager_visibility: "no_visibility", has_attendance: false, payroll_status: "none", quipu_id: nil,
   has_clock_in: true, has_geolocation: false, attendance_secret_key: "IU5HHLPKDXUBLHYY6XQBXG57525MAVKX", has_qr_code: false, slug: nil, brand_color: nil, header_font: nil, body_font: nil,
  country_factorial_domain: nil, has_desktop_clock_in_blocked: nil, tos_accepted_at: "2026-02-12 14:15:24.000000000 +0000", has_trial_company: nil, generated_trial_company: nil, production_company_id: nil,
  delete_data: false, headquarter_id: 1, regular_access_delay_in_days: 0, industry: nil, discarded_at: nil, public_email: nil, owner_id: nil, time_aware_contract_hours_calculation_starts_at: "3000-01-01",
  worked_time_materialized_on: nil, undeletable_reason: nil, contract_hours_rest_days_calculation_starts_at: "2025-09-01", employee_company_identifier_strategy: nil>>}
  Argument error running hook: Repositories::Hooks::TraceHook with method: update_members, args: [], kwargs: {:dto=><Features::Dtos::FeatureMembership::UpdateMembers add_access_ids=[2] add_employee_ids=[]
  company_id=1 feature_id="expenses_per_user_pricing_create_expenses" remove_access_ids=[] remove_employee_ids=[]>, :policy_context=>#<Permissions::PolicyContexts::Company:0x00000001558fb870 @cache={},
  @oauth_context=nil, @api_key_context=nil, @company=#<Company id: 1, name: "Everyday Software", created_at: "2026-02-12 14:15:24.000000000 +0000", updated_at: "2026-02-12 14:15:26.000000000 +0000", locale:
  "en", awareness_attribution_id: nil, interest_attribution_id: nil, goal_attribution_id: nil, tos: true, yearly_hours: 1882, flag: nil, onboarded_on: "2026-02-12", company_enrichment_id: nil,
  number_employees: nil, investigated_company_size: nil, subscription_id: 2, to_be_deleted: nil, sector: nil, knows_flex_benefits: nil, offers_health: nil, offers_restaurant: nil, offers_transport: nil,
  offers_kindergarten: nil, benefits_broker_id: nil, manager_visibility: "no_visibility", gdpr_tos: true, account_owner_id: nil, payroll_management: nil, operations_owner_id: nil,
  payroll_company_metadata_id: nil, marketing_remote_id: nil, marketing_remote_last_updated: nil, attendance_manager_visibility: "no_visibility", has_attendance: false, payroll_status: "none", quipu_id: nil,
   has_clock_in: true, has_geolocation: false, attendance_secret_key: "IU5HHLPKDXUBLHYY6XQBXG57525MAVKX", has_qr_code: false, slug: nil, brand_color: nil, header_font: nil, body_font: nil,
  country_factorial_domain: nil, has_desktop_clock_in_blocked: nil, tos_accepted_at: "2026-02-12 14:15:24.000000000 +0000", has_trial_company: nil, generated_trial_company: nil, production_company_id: nil,
  delete_data: false, headquarter_id: 1, regular_access_delay_in_days: 0, industry: nil, discarded_at: nil, public_email: nil, owner_id: nil, time_aware_contract_hours_calculation_starts_at: "3000-01-01",
  worked_time_materialized_on: nil, undeletable_reason: nil, contract_hours_rest_days_calculation_starts_at: "2025-09-01", employee_company_identifier_strategy: nil>>}
  [dc689af8-946c-405e-92ae-ea001e992e4c] [CY_DEV] fail to execute /Users/roger.campos/code/factorial/backend/cypress/app_commands/component_command.rb: missing keyword: :payload
  [dc689af8-946c-405e-92ae-ea001e992e4c] [CY_DEV] /Users/roger.campos/code/factorial/backend/components/event_system/app/public/pub_sub/typed_event.rb:17:in `initialize'
  /Users/roger.campos/.local/share/mise/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/sorbet-runtime-0.5.12196/lib/types/private/abstract/declare.rb:37:in `new'
  /Users/roger.campos/.local/share/mise/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/sorbet-runtime-0.5.12196/lib/types/private/abstract/declare.rb:37:in `block in declare_abstract'
  /Users/roger.campos/code/factorial/backend/components/event_system/app/public/pub_sub/subscriber.rb:63:in `block (2 levels) in subscribe'
  /Users/roger.campos/.local/share/mise/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/activesupport-7.2.2.2/lib/active_support/notifications/fanout.rb:134:in `block in finish'
  /Users/roger.campos/.local/share/mise/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/activesupport-7.2.2.2/lib/active_support/notifications/fanout.rb:25:in `block in iterate_guarding_exceptions'
  /Users/roger.campos/.local/share/mise/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/activesupport-7.2.2.2/lib/active_support/notifications/fanout.rb:24:in `each'

@rogercampos rogercampos merged commit 97479ab into main Feb 13, 2026
1 check passed
@rogercampos rogercampos deleted the chore/simple-logging branch February 13, 2026 09:53
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 this pull request may close these issues.

2 participants