Troubleshooting
MissingCredentials
If Client::from_env() or Client::builder().credentials_from_env()? returns MissingCredentials, confirm the right environment variables are present.
Market data:
ALPACA_DATA_API_KEYALPACA_DATA_SECRET_KEY
Trading:
ALPACA_TRADE_API_KEYALPACA_TRADE_SECRET_KEY
Wrong Base URL
If requests go to the wrong environment:
alpaca-tradereadsALPACA_TRADE_BASE_URLalpaca-tradedefaults to paper trading unless you switch to.live()alpaca-dataalways targets the production market data endpoint
alpaca-mock Starts But Orders Fail
Common causes:
ALPACA_DATA_API_KEY/ALPACA_DATA_SECRET_KEYare not set for market-data-backed mock flows- auth headers are missing on trading routes
- an HTTP fault was injected through
/admin/faults/http - the submitted limit has not yet reached the expected mid or composite-mid fill threshold
Check:
curl http://127.0.0.1:3847/health
curl http://127.0.0.1:3847/admin/state
Notes:
/admin/faults/httpis one-shot and clears after the next authenticated trading request- stock and single-option limit orders fill at mid price once that mid is reached
- multi-leg limit orders fill at composite mid price once that composite mid is reached
Docs Site Build Issues
Rebuild with:
python3 tools/docs/generate-doc-site
npm ci --prefix website
npm run build --prefix website
Downstream cargo publish --dry-run Fails Before First Release
Before the first real crates.io publication, dependent workspace crates can fail dry-run because upstream workspace crates are not yet available on crates.io.
Expected publish order:
alpaca-corealpaca-rest-httpalpaca-dataalpaca-tradealpaca-mockalpaca-timealpaca-optionalpaca-facade
Published Crate Name Versus Source Directory
If docs or release automation mention alpaca-rest-http while the repository
tree uses crates/alpaca-http, that is expected. The source directory name and
the published crate name are intentionally different.
Real API Tests Skip Or Fail Outside Market Conditions
Some live tests depend on paper trading state or current market conditions. Use the documented release-confidence subset that matches the current environment, and do not replace live verification with fake data branches.