Description
This documentation-only issue adds a symptom-first troubleshooting guide for Soroban host, authorization, storage, transaction, RPC, CLI, build, and environment failures encountered while developing or operating PayStream.
It complements the PayStream contract error catalog. It does not redefine the contract's Error enum.
Requirements and Context
Create:
Organize each entry as:
- Symptom / exact message pattern
- What layer produced it
- Likely causes
- How to confirm the cause
- Safe fix
- Whether retrying is appropriate
- Related PayStream documentation
Do not infer a cause from a numeric code alone. Verify HostError categories, transaction result codes, and SDK statuses using official Stellar/Soroban documentation and the repository's pinned tool versions.
Error-layer distinction
Begin with a short decision guide distinguishing:
- PayStream
Error(Contract, #N);
- nested token/router/oracle contract errors;
Error(Auth, ...);
Error(Storage, ...);
Error(WasmVm, ...);
- budget/resource/footprint failures;
- simulation/preparation failures;
- RPC transport and server failures;
- transaction-submission statuses;
- final transaction result codes;
- local Rust/Cargo/Stellar CLI failures.
Explain that Error(Contract, #N) is not automatically a PayStream error. A nested contract may use the same numeric code.
Required project-specific entries
Nested authorization and Error(Contract, #9)
Document PayStream's historical failure pattern:
- the prior design called token
approve() from inside subscribe();
- that nested authorization design produced persistent
HostError: Error(Contract, #9) failures in this project;
- the adopted fix requires the subscriber to call the token contract's
approve directly in a separate prior transaction;
subscribe() must not reintroduce internal approval.
Do not claim every contract error #9 is caused by nested auth. Require diagnostic context and contract provenance.
require_auth() failures
Cover missing/wrong signers, source-account versus required-authorizer confusion, incomplete authorization entries, expired authorization/time bounds, contract versus account authorization, simulation-produced auth, and stale rebuilt transactions.
Include safe confirmation steps without exposing secret keys or signed envelopes.
Submission and confirmation states
Cover exact statuses/result conditions supported by the pinned SDK/RPC, including where applicable:
PENDING;
TRY_AGAIN_LATER;
DUPLICATE;
ERROR/FAILED;
NOT_FOUND while confirmation is propagating;
- bad sequence such as
tx_bad_seq/TxBadSeq;
- expired time bounds;
- insufficient fee/resource fee;
- unknown submission outcome.
For each, explain whether to poll by hash, wait with bounded backoff, rebuild with a fresh sequence, stop, or avoid duplicate submission.
Reference keeper/retry.js, but verify the guide matches merged behavior. Never recommend blind resubmission when a prior transaction may already have succeeded.
Resource and footprint failures
Cover common symptoms for CPU/instruction budget, memory limits, transaction size/operation limits, read/write footprint mismatch, archived ledger entries, and stale simulation resource estimates.
Use exact names only after confirming them against official sources/tool output.
Storage expiration and archival
Explain persistent-storage TTL, archived/expired state symptoms, restoration requirements, RPC versus missing-state failures, and that current PayStream code may not explicitly extend TTL.
Windows MinGW crate-type issue
Document exactly:
For native tests:
For contract builds:
crate-type = ["cdylib", "rlib"]
Explain the MinGW DLL export ordinal limitation and that contributors must restore the build configuration before producing Wasm.
Soroban SDK pin
Document:
- PayStream is pinned to
soroban-sdk = "27.0.3";
- contributors must not upgrade to
27.0.5;
- the project encountered a missing
soroban-ledger-snapshot dependency for 27.0.5 on crates.io;
- dependency changes require a separate verified issue/PR.
Include non-mutating commands for confirming resolved versions.
Approval expiration ledger
Document:
- approval is a separate token-contract transaction;
expiration_ledger must not exceed current ledger plus 3,000,000;
- higher values are rejected;
- expired token approval differs from internal
allowance_remaining;
- clients should query a current ledger sequence and use a bounded future value.
Token allowance versus internal allowance
Explain both independent layers:
Subscription.allowance_remaining;
- token-contract allowance granted to PayStream.
Changing one does not change the other. Do not suggest every allowance symptom is fixed by another approval.
Commands and examples
Use PowerShell-compatible commands. Examples must use secret placeholders, never print secret keys, clearly label testnet addresses, match Stellar CLI 27.1.0 and Soroban SDK 27.0.3, and distinguish reads from state changes.
Sources and maintenance
For external errors/statuses:
- link official Stellar/Soroban documentation;
- record verification date and SDK/CLI version;
- quote sparingly;
- require re-verification when CLI, SDK, RPC API, or protocol versions change.
Discoverability
Add relative links from:
Suggested Execution
- Branch name:
docs/hosterror-troubleshooting-guide
- Files to touch:
docs/TROUBLESHOOTING.md
docs/DEVELOPMENT.md
docs/ARCHITECTURE.md
docs/ERROR_CODES.md only for an optional cross-link
- Example commit message:
docs(errors): add HostError and build troubleshooting guide
Test and Commit Steps
- Collect real PayStream failure patterns from history, issues, tests, and keeper behavior.
- Verify external statuses and codes against official sources.
- Write each symptom → layer → cause → confirmation → fix → retry entry.
- Check commands against pinned versions where practical.
- Search for unsafe or conflicting guidance:
rg "Error\(Contract|TRY_AGAIN_LATER|DUPLICATE|bad.seq|crate-type|27\.0\.5|3,000,000|KEEPER_SECRET" docs README.md keeper src
- Verify links and formatting:
Test-Path "docs/TROUBLESHOOTING.md"
Select-String -Path "docs/DEVELOPMENT.md","docs/ARCHITECTURE.md" -Pattern "TROUBLESHOOTING.md"
git diff --check
- Commit with:
git add docs/TROUBLESHOOTING.md docs/DEVELOPMENT.md docs/ARCHITECTURE.md docs/ERROR_CODES.md
git commit -m "docs(errors): add HostError and build troubleshooting guide"
Only stage docs/ERROR_CODES.md if changed.
Guidelines
- Comment with the proposed source list and real PayStream symptoms to request assignment.
- Do not start or open a PR until assigned by a maintainer.
- The PR description must include
Closes #<issue-number>.
- Keep the PR documentation-only.
- Do not diagnose errors solely by numeric code.
- Do not conflate PayStream, nested-contract, host, RPC, and transaction failures.
- Do not recommend blind transaction retries.
- Preserve the separate token-approval architecture and SDK pin.
- Never expose secret keys, signatures, or signed envelopes.
- Follow Conventional Commits and repository branch conventions.
Complexity
High (200 pts)
Description
This documentation-only issue adds a symptom-first troubleshooting guide for Soroban host, authorization, storage, transaction, RPC, CLI, build, and environment failures encountered while developing or operating PayStream.
It complements the PayStream contract error catalog. It does not redefine the contract's
Errorenum.Requirements and Context
Create:
Organize each entry as:
Do not infer a cause from a numeric code alone. Verify HostError categories, transaction result codes, and SDK statuses using official Stellar/Soroban documentation and the repository's pinned tool versions.
Error-layer distinction
Begin with a short decision guide distinguishing:
Error(Contract, #N);Error(Auth, ...);Error(Storage, ...);Error(WasmVm, ...);Explain that
Error(Contract, #N)is not automatically a PayStream error. A nested contract may use the same numeric code.Required project-specific entries
Nested authorization and
Error(Contract, #9)Document PayStream's historical failure pattern:
approve()from insidesubscribe();HostError: Error(Contract, #9)failures in this project;approvedirectly in a separate prior transaction;subscribe()must not reintroduce internal approval.Do not claim every contract error #9 is caused by nested auth. Require diagnostic context and contract provenance.
require_auth()failuresCover missing/wrong signers, source-account versus required-authorizer confusion, incomplete authorization entries, expired authorization/time bounds, contract versus account authorization, simulation-produced auth, and stale rebuilt transactions.
Include safe confirmation steps without exposing secret keys or signed envelopes.
Submission and confirmation states
Cover exact statuses/result conditions supported by the pinned SDK/RPC, including where applicable:
PENDING;TRY_AGAIN_LATER;DUPLICATE;ERROR/FAILED;NOT_FOUNDwhile confirmation is propagating;tx_bad_seq/TxBadSeq;For each, explain whether to poll by hash, wait with bounded backoff, rebuild with a fresh sequence, stop, or avoid duplicate submission.
Reference
keeper/retry.js, but verify the guide matches merged behavior. Never recommend blind resubmission when a prior transaction may already have succeeded.Resource and footprint failures
Cover common symptoms for CPU/instruction budget, memory limits, transaction size/operation limits, read/write footprint mismatch, archived ledger entries, and stale simulation resource estimates.
Use exact names only after confirming them against official sources/tool output.
Storage expiration and archival
Explain persistent-storage TTL, archived/expired state symptoms, restoration requirements, RPC versus missing-state failures, and that current PayStream code may not explicitly extend TTL.
Windows MinGW crate-type issue
Document exactly:
For native tests:
For contract builds:
Explain the MinGW DLL export ordinal limitation and that contributors must restore the build configuration before producing Wasm.
Soroban SDK pin
Document:
soroban-sdk = "27.0.3";27.0.5;soroban-ledger-snapshotdependency for27.0.5on crates.io;Include non-mutating commands for confirming resolved versions.
Approval expiration ledger
Document:
expiration_ledgermust not exceed current ledger plus3,000,000;allowance_remaining;Token allowance versus internal allowance
Explain both independent layers:
Subscription.allowance_remaining;Changing one does not change the other. Do not suggest every allowance symptom is fixed by another approval.
Commands and examples
Use PowerShell-compatible commands. Examples must use secret placeholders, never print secret keys, clearly label testnet addresses, match Stellar CLI
27.1.0and Soroban SDK27.0.3, and distinguish reads from state changes.Sources and maintenance
For external errors/statuses:
Discoverability
Add relative links from:
docs/DEVELOPMENT.md;docs/ARCHITECTURE.md;docs/ERROR_CODES.mdif docs(errors): build full error catalog reference #41 is merged.Suggested Execution
docs/hosterror-troubleshooting-guidedocs/TROUBLESHOOTING.mddocs/DEVELOPMENT.mddocs/ARCHITECTURE.mddocs/ERROR_CODES.mdonly for an optional cross-linkdocs(errors): add HostError and build troubleshooting guideTest and Commit Steps
rg "Error\(Contract|TRY_AGAIN_LATER|DUPLICATE|bad.seq|crate-type|27\.0\.5|3,000,000|KEEPER_SECRET" docs README.md keeper srcOnly stage
docs/ERROR_CODES.mdif changed.Guidelines
Closes #<issue-number>.Complexity
High (200 pts)