-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MalformedError('No key could be detected.') When Using BigQuery Tool in LangGraph Cloud Deployment #3325
Comments
@johannescastner the error message that suggests that the issue is that credentials cannot be found. It could be a bad error message from the google client, but could we dig into that first to confirm that this is really not the case? Could you:
|
Hi @eyurtsev (Eugene Yurtsev), Thank you for your guidance so far. I’ve done additional debugging based on your suggestions, and here’s an update on what I’ve tried and observed: Exposing the Full Stack Trace :
However, despite this line being executed, the full stack trace is not appearing in the logs . The only error message logged is:
This makes it difficult to pinpoint the exact location of the error.
Unfortunately, this approach also failed with the same error (No key could be detected.). Additionally, the run could not be cancelled, and it kept consuming OpenAI credits until I had to delete the deployment to stop it 3. Character Length of the JSON String :
This strongly suggests that the issue lies with the deployment environment rather than the Google Cloud credentials themselves. Is there a character length maximum for environment variables in LangGraph Cloud? |
There's no specific character length maximum for an individual environment variable. However, the entire secrets data and metadata cannot exceed 1 MB.
No, no known issues.
No, not that I know of, but let's hold on this possibility for now.
As a a test, put in some bogus value for
Test this out with a smaller string. Print out results. See if they match. I'll also test this out. |
I just tested this and the |
Checked other resources
Example Code
Error Message and Stack Trace (if applicable)
Description
I am encountering a persistent
MalformedError('No key could be detected.')
error when deploying an agent with a BigQuery tool (list_bigquery_tables
) to LangGraph Cloud. The same code works flawlessly in a local environment, which suggests the issue lies within the LangGraph Cloud deployment or its interaction with external APIs like BigQuery.Steps to Reproduce
Deploy the following minimal code to LangGraph Cloud.
Set the required secrets (GOOGLE_CLOUD_CREDENTIALS_JSON and OPENAI_API_KEY) in the LangGraph Cloud environment.
Trigger the list_bigquery_tables tool by asking the agent to list tables in the linkedin_raw dataset.
Expected Behavior
The tool should successfully list all tables in the specified dataset and return their names.
Actual Behavior
The tool fails with the following error:
Error listing tables: No key could be detected.
Troubleshooting Steps Taken
Validated Secrets : Confirmed that GOOGLE_CLOUD_CREDENTIALS_JSON and OPENAI_API_KEY are correctly set in LangGraph Cloud.
Tested Locally : Verified that the code works locally with the same service account credentials.
Added Logging : Enhanced logging to capture the entire execution flow, including project ID, dataset reference, and table listing.
Checked Permissions : Ensured the service account has the BigQuery Admin role.
Hypotheses
LangGraph Cloud Restrictions :
LangGraph Cloud might block or limit outbound HTTP requests to external APIs like BigQuery 4.
There could be constraints on the size or format of responses returned by tools.
Agent-Tool Integration :
The agent might mishandle the tool's response, leading to a malformed output 3.
There could be a mismatch between the expected and actual response formats.
Request for Assistance
Could the maintainers of LangGraph Cloud provide clarification on the following points?
Are there any restrictions on outbound HTTP requests to external APIs like BigQuery?
Are there specific requirements for tool response formats or schemas?
Could this issue be related to the runtime environment or permissions in LangGraph Cloud?
This example is fully self-contained, minimal, and reproducible. It includes all relevant imports, configurations, and logging to help diagnose the issue 1. Please let me know if further clarification is needed!
System Info
Python Version: 3.9+
Required Libraries: google-cloud-bigquery, langchain-openai, langchain-core, langgraph
Deployment Environment: LangGraph Cloud
Google Service Account Role: BigQuery Admin
OpenAI Model: gpt-3.5-turbo
The text was updated successfully, but these errors were encountered: