Skip to main content

Troubleshooting (FAQ)

Organized as "symptom → cause → fix". Connection failures, auth failures, garbled text and unresolvable variables are the four big categories.

Connection / Send Failures​

SymptomLikely causeFix
"No base address" reportedGroup has no environment bound, or the environment lacks that protocol's Pre-URLBind an environment, add the protocol's Pre-URL
WS/gRPC/MQTT won't connectPre-URL scheme wrong (protocol is classified by scheme)ws uses ws/wss, grpc uses grpc/grpcs, mqtt uses mqtt/mqtts
TCP/UDP won't connectHost and port swappedHost takes the address, port is separate
TLS errorsEncrypted scheme but no certificate configuredImport a client certificate, or turn off TLS verification as needed
Long connection drops suddenlyReclaimed automatically when idleReconnect before use; close old sessions promptly when debugging in batches (quota is capped)

Auth (401 / 403)​

SymptomCauseFix
401 even with a tokenThe pre-send script didn't run (script execution disabled)Confirm "execute scripts" is on
{{authToken}} stays literal (not replaced){{}} can't read runtime-stored tokensUse a pre-send script with sdk.env.get to inject the header (see recipes, scenario 1)
Next request can't get the token after loginThe two requests are in different groups / environmentsPut them in the same group bound to the same environment (runtime variables are scoped per environment)

Garbled Text / Encoding​

SymptomCauseFix
Garbled Chinese in the responseServer returns non-UTF-8 (e.g. GBK)Decode with the matching charset; reproduce via /charset/gbk
Decryption returns an Error: ... stringInvalid/empty ciphertext, or key/iv differs from encryption ($crypto failures only return an error string, never throw/abort)Keep encryption/decryption key & iv identical; check whether the return string starts with Error: (Chinese plaintext round-trips fine, verified)
Script reports Script aborted requestAn uncaught JS exception in the script (common: non-ASCII header values in headers.set, or property access on undefined)Wrap risky calls in try/catch; put UTF-8 content in body/query params and keep header values ASCII
Weird base64 result in scriptsPassed a Uint8Array/bytes to $codec/sdk.utils (gets String()-ed into "97,98,99" before encoding)Always pass strings; both $codec.base64Encode/Decode and sdk.utils.base64Encode/Decode are UTF-8-aware string↔string — pick one

Scripts Not Taking Effect​

SymptomCauseFix
Pre-send script changed the body but the wire doesn't show itNo "assignment" rewriterequest.body = new string (assignment replaces the whole body)
Post-response rewrite invisibleHow to rewriteresponse.body = new string; the UI/result view shows the new content after rewriting
Script reported as "no entry point, skipped"Wrong function nameMust be named onRequest / onResponse
Scripts can't read each other's valuesUnfamiliar with the sharing mechanismScripts in the same chain share globalThis — pass values via globalThis.xxx
AES "encryption failed" in scriptsWrong argument shape$crypto.encryptAES takes positional strings, not an object {text,key,iv}
Script fails with require: 未找到库 [...]The library key is wrong, or a user script library was renamed/deletedCopy the require statement from the library manager (identifier form survives renames); built-in keys are @libs/base64 / @libs/hex; require in comments is ignored and never bundles

Variable Resolution Cheat Sheet​

  • {{name}}: resolves environment configuration variables / per-send variables only; it cannot read values stored at runtime by scripts.
  • Reading variables inside scripts: all three layers are readable — use this for cross-request token passing.
  • To make extracted values usable by {{}} too: enable the "write extraction back to environment" setting.

Details: concepts, the variable system.

Still Stuck?​

  • Get the "minimal working case" running first with /echo (HTTP) or /ws/echo (WS), then add auth/scripts step by step.
  • Debug one step at a time: can the request leave at all (can't connect → check Pre-URL/host/port) → do scripts execute (is script execution on) → do variables resolve (which layer)?
  • Script-related errors can be cross-checked against the Script API Reference.