infiniflow/ragflow · error · Error
WhatsApp session is not running.
Error message
WhatsApp session is not running.
What it means
Catch-all: any exception during validate_connector_settings that is not a gitlab-auth/authz/get error — most often network-layer failures (DNS, TLS, proxy, connection refused) or URL misconfiguration — is re-raised as UnexpectedValidationError with the original message embedded.
Source
Thrown at api/channels/whatsapp/gateway-node/index.js:326
this.events.push(event);
this.messageStore.set(key.id, message);
this.broadcast({ type: 'event', data: event });
if (this.events.length > 1000) {
const dropped = this.events.slice(0, this.events.length - 500);
this.events = this.events.slice(-500);
for (const oldEvent of dropped) {
if (oldEvent.kind === 'message' && oldEvent.message_id) {
this.messageStore.delete(oldEvent.message_id);
}
}
}
this.lastSnapshotAt = now();
}
}
async send(payload) {
if (!this.sock) {
throw new Error('WhatsApp session is not running.');
}
const jid = normalizeJid(payload.chat_id);
if (!jid) {
throw new Error(`Invalid chat_id: ${payload.chat_id}`);
}
const text = String(payload.text || '');
const options = {};
if (payload.reply_to_message_id) {
const quoted = this.messageStore.get(String(payload.reply_to_message_id));
if (quoted) {
options.quoted = quoted;
}
}
await this.sock.sendMessage(jid, { text }, options);
this.lastSnapshotAt = now();
}
async stop() {View on GitHub (pinned to 554fb1133a)
Solutions
- Read the embedded {e} message — it names the real cause (SSLError, ConnectionError, etc.)
- Verify reachability from the indexer host: curl -v <gitlab_instance_url>/api/v4/version with the token
- For private CAs set REQUESTS_CA_BUNDLE to the CA bundle path
- Correct the gitlab_instance_url credential to the scheme+host only (python-gitlab appends /api/v4 itself)
Example fix
# before: double /api/v4 and plain http behind TLS terminator connector_credential = GitlabCredentialConfig(url="https://git.acme.com/api/v4") # after: scheme + host only connector_credential = GitlabCredentialConfig(url="https://git.acme.com")
Defensive patterns
Strategy: try-catch
Validate before calling
import socket, ssl, requests
def gitlab_reachable(base_url: str) -> bool:
try:
requests.get(base_url.rstrip('/') + "/api/v4/version", timeout=5,
verify=True)
return True
except (requests.SSLError, requests.ConnectionError):
return False Try / catch
from common.data_source.exceptions import UnexpectedValidationError
try:
connector.validate_connector_settings()
except UnexpectedValidationError as e:
logger.error("raw cause: %s", e.__cause__) # inspect original exception
if isinstance(e.__cause__, (requests.SSLError, requests.ConnectionError)):
schedule_retry_with_backoff() # network issue → retry later
else:
raise Prevention
- Add the private CA to the trust store or set REQUESTS_CA_BUNDLE for self-hosted instances
- Store only scheme+host in gitlab_instance_url; python-gitlab appends the API path
- Wrap validate in retries with backoff for transient DNS/TLS failures
When it happens
Trigger: gitlab_instance_url unreachable/wrong (self-hosted host down, bad scheme, http vs https), SSL cert verification failure against a private CA, corporate proxy blocking the egress, python-gitlab raising requests.ConnectionError/SSLError, or a response that is not valid JSON (auth portal hijacking the API).
Common situations: Self-hosted GitLab behind an internal CA without the CA cert in the trust store, instance URL entered without https:// or pointing to the web root plus /api/v4 duplicated, transient DNS failures, GitLab returning an HTML login page with 200 which breaks json parsing.
Related errors
- main() returned a non-JSON-serializable value.
- main() must be defined or exported.
- main() must return a value. Use null for an empty result.
- Invalid chat_id: ${payload.chat_id}
- main() must be defined or exported.
AI-assisted analysis of infiniflow/ragflow@554fb1133a (2026-08-15).
Data as JSON: /api/errors/54c792838bf12262.
Report an issue: GitHub.