infiniflow/ragflow · error · ValueError

Provided Google OAuth credentials are missing both tokens an

Error message

Provided Google OAuth credentials are missing both tokens and a client configuration.

What it means

Error "Provided Google OAuth credentials are missing both tokens and a client configuration." thrown in infiniflow/ragflow.

Source

Thrown at common/data_source/google_util/oauth_flow.py:119

    print(json.dumps(token_dict, indent=2))
    print()

    return token_dict


def ensure_oauth_token_dict(credentials: dict[str, Any], source: DocumentSource) -> dict[str, Any]:
    """Return a dict that contains OAuth tokens, running the flow if only a client config is provided."""
    if "refresh_token" in credentials and "token" in credentials:
        return credentials

    client_config: dict[str, Any] | None = None
    if "installed" in credentials:
        client_config = {"installed": credentials["installed"]}
    elif "web" in credentials:
        client_config = {"web": credentials["web"]}

    if client_config is None:
        raise ValueError("Provided Google OAuth credentials are missing both tokens and a client configuration.")

    return _run_local_server_flow(client_config, source)

View on GitHub (pinned to 554fb1133a)

Solutions

  1. Provide OAuth tokens or a client configuration in the credentials payload.
  2. Re-run the OAuth flow to regenerate a complete credential set.

Example fix

credentials = {'client_config': {...}, 'refresh_token': '...'}

When it happens

Trigger: Thrown at common/data_source/google_util/oauth_flow.py:119 when the library encounters an invalid state.

Common situations: The stored Google OAuth credential contains neither tokens nor client configuration; regenerating the credential prevents this error.


AI-assisted analysis of infiniflow/ragflow@554fb1133a (2026-08-15). Data as JSON: /api/errors/749787f1b4cc8fd4. Report an issue: GitHub.