Skip to content

Index out of bounds in brupop-agent in agent/src/apiclient.rs:237:89 #774

Description

@Broders

Image I'm using: 1.6.0
Bottlerocket OS I'm using: bottlerocket-aws-k8s-1.32-x86_64-v1.39.0-0968c061

Issue:

Hello, the brupop-agent crashes with a panic in agent/src/apiclient.rs:237:89 due to an index out of bounds: the len is 1 but the index is 1 error.

thread 'main' panicked at agent/src/apiclient.rs:237:89:
index out of bounds: the len is 1 but the index is 1

I couldn´t figure out why this error occured, it worked for weeks until now. Bottlerocket is new to me.

if I enable DEBUG via values.yml I get these before the container dies:

2025-08-07T08:43:40.282815Z DEBUG agent::apiclient::api: Invoking apiclient: ["raw", "-u", "/os"]
at agent/src/apiclient.rs:267
in agent::apiclient::api::invoke_apiclient with args: ["raw", "-u", "/os"]
in agent::apiclient::api::get_os_info
in agent::agentclient::shadow_status_with_refreshed_system_matadata with shadow_error_info: ShadowErrorInfo { crash_count: 0, state_transition_failure_timestamp: None }
in agent::agentclient::initialize_metadata_shadow
in agent::agentclient::initialize_shadow_if_not_initialized
in agent::agentclient::run
2025-08-07T08:43:40.284426Z DEBUG hyper::proto::h1::io: parsed 7 headers
at /src/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/hyper-0.14.32/src/proto/h1/io.rs:211
2025-08-07T08:43:40.284439Z DEBUG hyper::proto::h1::conn: incoming body is chunked encoding
at /src/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/hyper-0.14.32/src/proto/h1/conn.rs:224
thread 'main' panicked at agent/src/apiclient.rs:237:89:
index out of bounds: the len is 1 but the index is 1
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

I aktivated rust_backtrace

stack backtrace:
0: rust_begin_unwind
1: core::panicking::panic_fmt
2: core::panicking::panic_bounds_check
3: agent::apiclient::api::extract_status_code_from_error
4: <tokio_retry::future::RetryIf<I,A,C> as core::future::future::Future>::poll
5: agent::apiclient::api::invoke_apiclient::{{closure}}::{{closure}}
6: <tracing::instrument::Instrumented as core::future::future::Future>::poll
7: agent::apiclient::api::invoke_apiclient::{{closure}}
8: agent::apiclient::api::get_os_info::{{closure}}::{{closure}}
9: <tracing::instrument::Instrumented as core::future::future::Future>::poll
10: agent::apiclient::get_os_info::{{closure}}
11: agent::agentclient::BrupopAgent::shadow_status_with_refreshed_system_matadata::{{closure}}::{{closure}}
12: <tracing::instrument::Instrumented as core::future::future::Future>::poll
13: agent::agentclient::BrupopAgent::shadow_status_with_refreshed_system_matadata::{{closure}}
14: <tracing::instrument::Instrumented as core::future::future::Future>::poll
15: <tokio_retry::future::RetryIf<I,A,C> as core::future::future::Future>::poll
16: agent::agentclient::BrupopAgent::initialize_shadow_if_not_initialized::{{closure}}::{{closure}}
17: <tracing::instrument::Instrumented as core::future::future::Future>::poll
18: agent::agentclient::BrupopAgent::run::{{closure}}::{{closure}}::{{closure}}
19: <tracing::instrument::Instrumented as core::future::future::Future>::poll
20: <core::future::poll_fn::PollFn as core::future::future::Future>::poll
21: tokio::runtime::park::CachedParkThread::block_on
22: tokio::runtime::context::runtime::enter_runtime
23: tokio::runtime::runtime::Runtime::block_on
24: agent::main
note: Some details are omitted, run with RUST_BACKTRACE=full for a verbose backtrace.

I tried:

  • redeployment via ArgoCD

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions