Skip to Content
OperationsTroubleshooting

Troubleshooting

Where to look when the backend misbehaves: how to find every log line of one request, which debug namespaces show what, and, by symptom, what the code does that produces it and where the full explanation lives. Each row states the behaviour; the reasons and the edge cases are on the linked page. Terms are in the Glossary.

Failure & degradation · Process lifecycle · Request lifecycle · API error variants · Deployment

Finding one request in the logs

middleware.logger takes the x-correlation-id request header when it is a UUID and otherwise generates one; the id is bound to every line written through the request’s logger. The backend does not return the id in a response header and does not send it to Repliers or FUB, so to find a request later, send your own UUID in x-correlation-id.

LineWritten byLevelCarries correlationIdWhen
Request: <METHOD> <url>middleware.pinoinfoyes, plus the serialized requestevery request that reaches the logger middlewares
any line logged through the logger token during the request, for example Repliers call without x-repliers-forwarded-forthe child loggeras writtenyes, plus url, endpoint, body, referer, x-forwarded-forwhile the request runs
{ err } with the error’s messagekoa-pino-loggererroryesa value thrown below the logger middlewares, 4xx included
logger.error(err) of the error handlerlogger.global (it runs outside the request’s scope)errornothe same thrown value, a second time
Response: <status> <ms> <METHOD> <url>middleware.pinoinfoyesresponse below 500
request errored with failed with status code <status>middleware.pinoinfoyesresponse of 500 or more
worker lineslogger.global, to which src/worker.ts adds { correlationId } with setBindings for every messageas writtenevery id bound so far: pino appends each binding and skips undefined, so a line carries one correlationId key per webhook message processed so far, the current one last; a people.upsert message has no header and adds nothing, so its lines carry the earlier messages’ idsin the worker process, from the first webhook message until the process ends
the error that StreamWorker.process catchesconsole.errorstderrnoworker handler failure

The webhook handler copies the request’s id into the header of every message it publishes (src/routes/webhooks/boss.ts, src/services/boss/webhook.ts), so a search for that id finds the web-process lines and the worker lines of that message, and also every later worker line of the same process, because the binding is never removed. Within one worker line of a webhook message, that message’s id is the last correlationId key (JSON.parse keeps the last of duplicate keys). Observed with the installed pino 10.3.1: setBindings with a, then b, then undefined gives "correlationId":"a","correlationId":"b" on every following line.

Lines of one failed request (executed 2026-10-20, pino-pretty output reduced to message and the binding; stand-ins: the correlation id 11111111-2222-4333-8444-555555555555 was sent by the probe, the Repliers base URL pointed at a local server that never answers):

INFO Request: GET /api/locations correlationId: 1111…5555 INFO Repliers call without x-repliers-forwarded-for correlationId: 1111…5555 reason: "proxy-disabled" ERROR Repliers API error: undefined correlationId: 1111…5555 ERROR Repliers API error: undefined (no correlationId) INFO request errored correlationId: 1111…5555

The reasons in the second line, and when each applies, are on Client IP forwarding: diagnosing a missing header.

Debug namespaces

DEBUG=repliers:* turns on the debug output (stderr, not the JSON log). Narrow it to the namespace you need; some print whole request objects.

NamespacePrintsSource
repliers:services:repliersthe outbound Repliers request options, the status and the first 1500 characters of each response, the upstream response of a failed callsrc/services/repliers/base.ts
repliers:lib:decorators/cachedNS: <namespace>, ttl: <ms> after each cache miss whose method resolvedsrc/lib/decorators/cached.ts
repliers:scrubber:listingswhether each listing is scrubbed as guest or as usersrc/services/scrubber/listings.ts
repliers:services:eventsCollectionsuccess or failure of each CRM event and notesrc/services/eventsCollection/eventsCollection.ts
repliers:services:autosuggestthe autosuggest requests and the failure of the MLS-number branchsrc/services/autosuggest.ts
repliers:services:boss:webhookthe worker’s webhook processing steps and their errorssrc/services/boss/webhook.ts

Symptoms

Startup

SymptomWhat the code doesCheckDeep dive
AssertionError such as No REPLIERS_API_KEY env variable, and the process exitsasserts in src/config.ts at import, before the preset is mergedthe variable is in the process environment, not only in a presetStartup prerequisites
eventsCollection URLs are relative but SETTINGS_EVENTS_COLLECTOR_URL_HOST is not setURL assembly after the merge throwsset the host, or make the templates absoluteURL assembly
ENOENT for a .pem path, web process onlythe route modules read the JWT key files at importthe path is relative to the backend root, or put the PEM text in the variableIssuing
Fatal with origin: "unhandledRejection" and a NATS ConnectionError; the web process exitswith NATS_ENABLED=true the web process connects at startup and nothing handles a refused connectionNATS is reachable from the web process, or NATS_ENABLED is offWhat stops a step
Worker logs Establishing NATS connection, attempt <n> failed again and againthe retry re-awaits one failed connection promise; it never reconnects, and the worker exits after the last retryfix NATS, then restart the workerProcess lifecycle
Worker ends right after NATS is disabled, not starting workerexpected with NATS_ENABLED unset: no consume loop runsrun the worker only with NATSDeployment
Web process exits after Checking for old/stale webhooksa FUB error during installHooks rejects the top-level awaitFUB credentials, BOSS_SYSTEM, BOSS_SYSTEM_KEY, reachability of FUBWebhook installation

Authentication

SymptomWhat the code doesCheckDeep dive
401 Authentication Error on a strict routeno Authorization headerthe header is sent as Bearer <token>Verifying
A signed-in user gets guest results on a guest-allowed routea header that is not Bearer <token> is dropped silently by the passthrough middleware, so the request is a guestthe header formatAuthentication gotchas
401 Authentication Error: jwt expired, jwt issuer invalid, invalid signaturekoa-jwt verificationtoken lifetime (JWT_EXPIRE, AGENT_JWT_EXPIRE), JWT_ISSUER and the key pair of the issuing deploymentIssuing
401 Token revokedthe token has no string jti, or its jti is in the blocklist after a logout or refreshsign in again; use the token returned by refreshRevocation
A logged-out token still works, or a valid OTP code is rejected, only sometimeswithout REDIS_KEYV_ENABLE=true the blocklist and the OTP store are per processRedis-backed Keyv when more than one web process runsRevocation
403 with Retry-After on loginOTP resend cooldown, also after a failed message sendwait the given secondsSide effects and failures
500 when a token is issuedthe role lookup queries the acl table; a database error fails the requestdatabase reachable, or APP_DISABLE_PERSISTENCE=trueIssuing
403 Insufficient privilegesthe token’s role is not in the route’s list; with persistence off an OTP token has no rolethe acl row of the e-mailAgents and roles
Every authenticated request waits (no timeout is set)with REDIS_KEYV_ENABLE=true and Redis unreachable the revocation lookup waits for a connectionRedis reachabilityFailure outcomes

Search and upstream errors

SymptomWhat the code doesCheckDeep dive
400 with a Joi message in userMessagerequest validation, first error onlythe parameter named in the messageValidation
4xx Repliers API error: <status> with an info objectthe Repliers status is relayed and its body is in infoinfo says what Repliers rejected; a 401 or 403 there concerns the backend’s Repliers key, not the userError variants
500 undefined - Repliers API error: undefined - <path>Repliers did not answer within REPLIERS_TIMEOUT or the connection failedupstream reachability; how long the call waitedFailure outcomes
500 Internal Server Error from an autosuggest routeMapbox or Google did not answer; the client’s .catch throws a TypeErrorprovider reachability, MAPBOX_TIMEOUT / GOOGLE_MAPS_TIMEOUT_MSFailure outcomes
Whole autosuggest request fails while only one provider is downthe branches are joined with Promise.all; only the MLS-number branch is caughtwhich upstream failed, from the error lineBranch register
Slow responses without any erroroutbound Repliers calls wait in the process-wide throttle; the wait is not loggedREPLIERS_API_LIMIT and REPLIERS_API_INTERVAL_MS against the trafficRetry layers
Listings carry only status, permissions, address, duplicates, boardIda search without fields is sent upstream with just those fivesend the fields you needScrubbing: ordering
A listing never appears in resultsthe restricted list (not:mlsNumber), the allowed-status policy, and the forced displayInternetEntireListing=Y narrow every searchsettings.restrictedListings, allowedListingsStandardStatusesRestricted listings, policy
410 for a listing detailvalidateAvailability refuses a restricted, not-entirely-displayable or hidden-status listingAPP_HIDE_UNAVAILABLE_LISTINGS_* settingsDetail, similar & history

Visibility

SymptomWhat the code doesCheckDeep dive
Values read !scrubbed!guest masking on displayPublic=N; strings and numbers get the same sentinelwhether the request carried a tokenWho gets scrubbed
A guest sees data that should be maskedthe scrubber acts only on listings whose boardId is in SETTINGS_SCRUBBING_BOARDIDS; SETTINGS_SCRUBBING_FORCE_DISPLAY_PUBLIC_YES turns masking offthe endpoint’s row and the board listVisibility register
A signed-in user sees a masked address or no mapdisplayAddressOnInternet=N and displayOnMap=N apply to every callerthe listing’s permissionsPermission fields

Delayed or missing sync

SymptomWhat the code doesCheckDeep dive
A FUB change never reaches the Repliers clientthe web process stores a job row and publishes it; only the worker writes the clientthe row’s status in webhooks (webhooks) or people_sync (agent sync): PENDING, SUCCESS or the error textOutcomes
Rows stay PENDINGNATS is disabled (DummyNats stores nothing), the worker is not running, or the publish failed after the insert; nothing re-publishes a rowNATS_ENABLED on both processes, the worker processWorker handoffs
Status {"error":"No tags found"} on every jobthe person needs a tag from BOSS_WEBHOOK_CLIENT_TAGS_CSV; an empty value lets no one passthe tag listVariation
The same job fails and is retried over and overevery thrown error is naked and redelivered by the serverthe status text; the server’s consumer limitsThe NATS worker
No webhook requests arrivewebhooks are registered only by a web process with BOSS_WEBHOOK_ENABLED=true; each start deletes what FUB lists first, and a signal deletes the process’s own idsthe startup log lines of installHooks, FUB’s webhook listWebhook installation
An engagement event is missing in FUBBOSS_ENABLED=false, a guest on a route without allowIncognito, a selector that returns null, or a CRM failure that reaches only the debug logDEBUG=repliers:services:eventsCollection; the route’s rowEngagement reporting

Stale data

SymptomWhat the code doesCheckDeep dive
A count, location list, building or statistic does not change upstream changes@cached results live until their TTL; only the featured list is ever cleared by codethe namespace’s TTL variableCache state
Two identical requests give different resultswithout Redis each process has its own cachesREDIS_KEYV_ENABLEKeyv stores
The browser keeps an old answersendCached sets Cache-Control: private, max-age=<remaining seconds>the response headerCache-Control
A featured list is stalecleared on favorite add and delete through this backend; changes made elsewhere wait for the TTLCACHE_FEATURED_LISTINGS_TTLCache state
lastUpdatedOn does not match any listing (Not in OSS)the value is synthetic: now minus a random 2 to 5 minutes, cachednothing to fix upstreamCache state
A configuration change has no effectconfiguration is read once at startup; a preset key beats the same environment variablerestart; the presetConfiguration resolution

Verified against portal-backend 997ae3e, 2026-10-20.

Last updated on