{"record":{"id":"bb405811fc8e24c2","repo":"hatoo/oha","slug":"aws-credentials-auth-required-when-using-aws","errorCode":null,"errorMessage":"AWS credentials (--auth) required when using --aws-sigv4","messagePattern":"AWS credentials \\(--auth\\) required when using --aws-sigv4","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/main.rs","lineNumber":366,"sourceCode":"\n    // Parse AWS credentials from basic auth if AWS signing is requested\n    let aws_config = if let Some(signing_params) = opts.aws_sigv4 {\n        if let Some(auth) = &opts.basic_auth {\n            let parts: Vec<&str> = auth.split(':').collect();\n            if parts.len() != 2 {\n                anyhow::bail!(\"Invalid AWS credentials format. Expected access_key:secret_key\");\n            }\n            let access_key = parts[0];\n            let secret_key = parts[1];\n            let session_token = opts.aws_session.take();\n            Some(AwsSignatureConfig::new(\n                access_key,\n                secret_key,\n                &signing_params,\n                session_token,\n            )?)\n        } else {\n            anyhow::bail!(\"AWS credentials (--auth) required when using --aws-sigv4\");\n        }\n    } else {\n        None\n    };\n\n    let parse_http_version = |is_http2: bool, version: Option<&str>| match (is_http2, version) {\n        (true, Some(_)) => anyhow::bail!(\"--http2 and --http-version are exclusive\"),\n        (true, None) => Ok(http::Version::HTTP_2),\n        (false, Some(http_version)) => match http_version.trim() {\n            \"0.9\" => Ok(http::Version::HTTP_09),\n            \"1.0\" => Ok(http::Version::HTTP_10),\n            \"1.1\" => Ok(http::Version::HTTP_11),\n            \"2.0\" | \"2\" => Ok(http::Version::HTTP_2),\n            #[cfg(feature = \"http3\")]\n            \"3.0\" | \"3\" => Ok(http::Version::HTTP_3),\n            #[cfg(not(feature = \"http3\"))]\n            \"3.0\" | \"3\" => anyhow::bail!(\n                \"Your Oha instance has not been built with HTTP/3 support. Try recompiling with the feature enabled.\"","sourceCodeStart":348,"sourceCodeEnd":384,"githubUrl":"https://github.com/hatoo/oha/blob/4efba2d113d165aaaf7533f5d2893e7cc57ebfc1/src/main.rs#L348-L384","documentation":"AWS SigV4 signing requires credentials, which oha reads from the --auth option when --aws-sigv4 is set. If --aws-sigv4 is provided but no --auth value exists, run() cannot build AwsSignatureConfig and bails before issuing requests.","triggerScenarios":"Running oha with `--aws-sigv4 \"aws:amz:region:service\"` but omitting `--auth access_key:secret_key`.","commonSituations":"Users assume credentials are picked up from AWS_PROFILE / environment variables like AWS_ACCESS_KEY_ID; oha only reads them from --auth, so environment-based setups hit this bail.","solutions":["Add `--auth <access_key>:<secret_key>` alongside --aws-sigv4.","Supply an optional session token with --aws-session-token for temporary credentials.","If you expected env-var credentials, note oha requires them via --auth for SigV4."],"exampleFix":"// before\noha --aws-sigv4 \"aws:amz:us-east-1:s3\" https://bucket.s3.amazonaws.com/\n// after\noha --aws-sigv4 \"aws:amz:us-east-1:s3\" --auth AKIDEXAMPLE:secretKey https://bucket.s3.amazonaws.com/","handlingStrategy":"validation","validationCode":"if process_args.iter().any(|a| a == \"--aws-sigv4\")\n    && !process_args.iter().any(|a| a == \"--auth\") {\n    eprintln!(\"--aws-sigv4 requires --auth access_key:secret_key\");\n}","typeGuard":null,"tryCatchPattern":"match run(opts).await {\n    Err(e) if e.to_string().contains(\"AWS credentials (--auth) required\") => {\n        eprintln!(\"Supply credentials via --auth <access_key>:<secret_key>\");\n    }\n    Err(e) => return Err(e),\n    Ok(v) => v,\n}","preventionTips":["Remember oha does not read AWS_ACCESS_KEY_ID / AWS_PROFILE env vars for SigV4; use --auth.","Wrap invocation helpers so --aws-sigv4 always injects --auth.","Test the CLI invocation in CI before running long load tests."],"tags":["aws","cli","missing-credentials","sigv4"],"backgroundTag":"missing-credentials","analyzedSha":"4efba2d113d165aaaf7533f5d2893e7cc57ebfc1","analyzedAt":"2026-09-09T16:24:23.306Z","contentChangedAt":"2026-09-09T16:24:23.306Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}