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

reword remote-db restart message to avoid command name #975

Merged
merged 1 commit into from
Jan 24, 2025

Conversation

evgeni
Copy link
Member

@evgeni evgeni commented Jan 24, 2025

For some reason calling ForemanMaintain.command_name results in

/usr/share/gems/gems/foreman_maintain-1.8.1/lib/foreman_maintain/concerns/metadata.rb:227:in `evaluate_confines': Recursive confine block call detected (RuntimeError)
    from /usr/share/gems/gems/foreman_maintain-1.8.1/lib/foreman_maintain/concerns/metadata.rb:204:in `present?'
    from /usr/share/gems/gems/foreman_maintain-1.8.1/lib/foreman_maintain/detector.rb:113:in `each'
    from /usr/share/gems/gems/foreman_maintain-1.8.1/lib/foreman_maintain/detector.rb:113:in `find'
    from /usr/share/gems/gems/foreman_maintain-1.8.1/lib/foreman_maintain/detector.rb:113:in `detect_feature'
    from /usr/share/gems/gems/foreman_maintain-1.8.1/lib/foreman_maintain/detector.rb:11:in `feature'
    from /usr/share/gems/gems/foreman_maintain-1.8.1/lib/foreman_maintain/concerns/finders.rb:9:in `feature'
    from /usr/share/gems/gems/foreman_maintain-1.8.1/definitions/features/instance.rb:58:in `downstream'
    from /usr/share/gems/gems/foreman_maintain-1.8.1/lib/foreman_maintain.rb:171:in `pkg_and_cmd_name'
    from /usr/share/gems/gems/foreman_maintain-1.8.1/lib/foreman_maintain.rb:179:in `command_name'
    from /usr/share/gems/gems/foreman_maintain-1.8.1/lib/foreman_maintain/utils/service/remote_db.rb:42:in `restart'
    from /usr/share/gems/gems/foreman_maintain-1.8.1/definitions/features/service.rb:94:in `block (2 levels) in fork_threads_for_services'

At least when the Satellite/Capsule features are not present.

I guess that's because the service feature itself iterates over
existing features?

Either way, I couldn't find a good way to fix this, so let's just not
need command_name here in the message.

For some reason calling ForemanMaintain.command_name results in

    /usr/share/gems/gems/foreman_maintain-1.8.1/lib/foreman_maintain/concerns/metadata.rb:227:in `evaluate_confines': Recursive confine block call detected (RuntimeError)
        from /usr/share/gems/gems/foreman_maintain-1.8.1/lib/foreman_maintain/concerns/metadata.rb:204:in `present?'
        from /usr/share/gems/gems/foreman_maintain-1.8.1/lib/foreman_maintain/detector.rb:113:in `each'
        from /usr/share/gems/gems/foreman_maintain-1.8.1/lib/foreman_maintain/detector.rb:113:in `find'
        from /usr/share/gems/gems/foreman_maintain-1.8.1/lib/foreman_maintain/detector.rb:113:in `detect_feature'
        from /usr/share/gems/gems/foreman_maintain-1.8.1/lib/foreman_maintain/detector.rb:11:in `feature'
        from /usr/share/gems/gems/foreman_maintain-1.8.1/lib/foreman_maintain/concerns/finders.rb:9:in `feature'
        from /usr/share/gems/gems/foreman_maintain-1.8.1/definitions/features/instance.rb:58:in `downstream'
        from /usr/share/gems/gems/foreman_maintain-1.8.1/lib/foreman_maintain.rb:171:in `pkg_and_cmd_name'
        from /usr/share/gems/gems/foreman_maintain-1.8.1/lib/foreman_maintain.rb:179:in `command_name'
        from /usr/share/gems/gems/foreman_maintain-1.8.1/lib/foreman_maintain/utils/service/remote_db.rb:42:in `restart'
        from /usr/share/gems/gems/foreman_maintain-1.8.1/definitions/features/service.rb:94:in `block (2 levels) in fork_threads_for_services'

At least when the Satellite/Capsule features are not present.

I *guess* that's because the service feature itself iterates over
existing features?

Either way, I couldn't find a good way to fix this, so let's just not
need `command_name` here in the message.
@evgeni
Copy link
Member Author

evgeni commented Jan 24, 2025

@ekohl ekohl merged commit 6a3a62b into master Jan 24, 2025
8 checks passed
@ekohl ekohl deleted the reword-remote-db-restart branch January 24, 2025 12:11
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