Skip to content
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

Failed to Failed to fetch /sessions. Received status [401]: Unauthorized #297

Open
mistdream11 opened this issue Feb 25, 2025 · 6 comments

Comments

@mistdream11
Copy link

mistdream11 commented Feb 25, 2025

In the course of Setting up LangGraph Server, Navigate to apps/agents and run yarn dev,there are errors below.

error: ▪ Error: Failed to Failed to fetch /sessions. Received status [401]: Unauthorized. Server response: {"detail":"Invalid token"}
at raiseForStatus (file:///home/zsh/.npm/_npx/f7d2da157c771680/node_modules/langsmith/dist/utils/error.js:82:11)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async Client._getPaginated (file:///home/zsh/.npm/_npx/f7d2da157c771680/node_modules/langsmith/dist/client.js:436:13)
at async Client._getTenantId (file:///home/zsh/.npm/_npx/f7d2da157c771680/node_modules/langsmith/dist/client.js:1511:26)
at async Promise.all (index 1)
at async file:///home/zsh/.npm/_npx/f7d2da157c771680/node_modules/@langchain/langgraph-api/dist/cli/entrypoint.mjs:22:45

Image

Image

@deanchanter
Copy link

I am getting the same error

@MirkoMContinuum
Copy link

Make sure your Langchain API key for LangSmith is correctly set up in your .env file—that was the issue for me.

@UdayveerVirk
Copy link

Does that resolve the issue because it didn't work out for me. Once I altered the .env file and changed the api key to mine, i used the yarn dev command again. But the issue persists. I am running it locally. Also if i write anything in the chatbox it shows no assistant id found. Can this be caused by the earlier fetching issue.

Image

Image

@bracesproul
Copy link
Member

hi @UdayveerVirk that error looks like the web client isn't able to connect to your LangGraph server. Ensure you have both the web server & the backend server running:

Web server:

cd apps/web

yarn dev

Backend LangGraph server:

cd apps/agents

yarn dev

@UdayveerVirk
Copy link

UdayveerVirk commented Mar 12, 2025

Hi!! @bracesproul , thanks for reaching out. I tried this alternative too but the issue still persists. I am not using any api key for web searching or firecrawl api. Could this cause an issue.

Image
also it is mentioned that if you run locally you need to set Langgraph_API_URL in constants.js, where i have stored just my LANGCHAIN_API_KEY (basically the langsmith api key). Is something else to be stored in this variable? If yes than from where do i get this langgraph api url?

In langsmith studio i am getting this issue.

Image

I have tried using both pats api key and service api key. But the issue persists. Also the human msg "hi" in langsmith sudio did not appear when i wrote it on the localhost web page, i have given this input manually.

Though I am not sure but I feel like the issue has something to do with the assistant id. At bottom right it shows no assistant id. Can you help me with that.
I have tried creating a new assistant but unable to do so.

@karangoyal03
Copy link

n dev

Backend LangGraph server:

cd apps/agents

yarn dev

This solution is not working for me , as i am running both the agents as well as web. Still facing the same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants