{"record":{"id":"fa27c3b44674c07f","repo":"linera-io/linera-protocol","slug":"end-timestamp-before-1970","errorCode":null,"errorMessage":"End timestamp before 1970","messagePattern":"End timestamp before 1970","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"linera-service/src/cli/main.rs","lineNumber":1450,"sourceCode":"                config,\n                storage_path,\n                max_batch_size,\n            } => {\n                let genesis_config = wallet.genesis_config().clone();\n\n                let context = options\n                    .create_client_context(storage, wallet, keystore)\n                    .await?;\n\n                let chain_id = if let Some(chain_id) = chain_id {\n                    chain_id\n                } else {\n                    context.first_non_admin_chain().await?\n                };\n                info!(\"Starting faucet service using chain {}\", chain_id);\n                let end_timestamp = limit_rate_until.map_or_else(Timestamp::now, |et| {\n                    let micros =\n                        u64::try_from(et.timestamp_micros()).expect(\"End timestamp before 1970\");\n                    Timestamp::from(micros)\n                });\n\n                let config = FaucetConfig {\n                    port,\n                    #[cfg(with_metrics)]\n                    metrics_port,\n                    chain_id,\n                    initial_claim_amount: amount,\n                    daily_claim_amount,\n                    end_timestamp,\n                    genesis_config: Arc::new(genesis_config),\n                    chain_listener_config: config,\n                    storage_path,\n                    max_batch_size,\n                    enable_memory_profiling: options.enable_memory_profiling(),\n                };\n                let faucet = FaucetService::new(config, context).await?;","sourceCodeStart":1432,"sourceCodeEnd":1468,"githubUrl":"https://github.com/linera-io/linera-protocol/blob/6c226ddcb332ef55118dc8d0aafbd093d5420899/linera-service/src/cli/main.rs#L1432-L1468","documentation":"When starting the faucet with --limit-rate-until, the CLI converts the chrono DateTime to microseconds since the Unix epoch with u64::try_from(et.timestamp_micros()). If the timestamp is before 1970-01-01, timestamp_micros() is negative, the conversion fails, and .expect(\"End timestamp before 1970\") panics while building the FaucetConfig.","triggerScenarios":"Passing --limit-rate-until with a date before the Unix epoch (year < 1970), e.g. a mis-typed year like 1969, a zero/empty date parsed as epoch-minus, or a timezone miscalculation that lands the instant pre-1970.","commonSituations":"Typo'd ISO dates (1969 vs 2026); scripts building timestamps from signed deltas that go negative; systems with a wrong clock or locale parsing that yields a pre-epoch DateTime.","solutions":["Use a future date after 1970, ideally well in the future: --limit-rate-until '2027-01-01T00:00:00Z'","If the rate limit is not needed, omit --limit-rate-until (it defaults to Timestamp::now)","Validate the date in your deployment script: reject anything whose year is < 1970 before invoking the faucet"],"exampleFix":"# before\nlinera faucet ... --limit-rate-until 1969-12-31T23:59:59Z\n\n# after\nlinera faucet ... --limit-rate-until 2027-01-01T00:00:00Z","handlingStrategy":"validation","validationCode":"# Reject pre-epoch dates before starting the faucet.\nif [ -n \"$LIMIT_RATE_UNTIL\" ]; then\n  epoch=$(date -d \"$LIMIT_RATE_UNTIL\" +%s 2>/dev/null || echo -1)\n  [ \"$epoch\" -gt 0 ] || { echo \"--limit-rate-until must be after 1970\" >&2; exit 1; }\nfi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Generate timestamps programmatically (date -u -d '+90 days' +%Y-%m-%dT%H:%M:%SZ) rather than typing dates","Add year-range sanity checks to deployment templates","Omit --limit-rate-until when rate limiting is not required"],"tags":["linera","cli","faucet","timestamp","unix-epoch"],"backgroundTag":"invalid-timestamp","analyzedSha":"6c226ddcb332ef55118dc8d0aafbd093d5420899","analyzedAt":"2026-08-22T22:49:09.787Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}