dify cannot create langsmith project #7853

Closed
opened 2026-02-21 18:22:41 -05:00 by yindo · 4 comments
Owner

Originally created by @corlin on GitHub (Jan 22, 2025).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.15.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Image

✔️ Expected Behavior

dify create langsmith project

Actual Behavior

dify cannot create langsmith project

Originally created by @corlin on GitHub (Jan 22, 2025). ### Self Checks - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 0.15.0 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce ![Image](https://github.com/user-attachments/assets/812ee0b3-03f1-4057-a70d-31bbe35a37e0) ### ✔️ Expected Behavior dify create langsmith project ### ❌ Actual Behavior dify cannot create langsmith project
yindo added the 🐞 bug🤔 cant-reproduce labels 2026-02-21 18:22:41 -05:00
yindo closed this issue 2026-02-21 18:22:41 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jan 22, 2025):

@corlin Hello there! I'm here to help you with any bugs, questions, or contributions you have for the Dify project. I'm a bot designed to assist you while waiting for a human maintainer. Let's tackle this issue together!

When Dify fails to create a project in LangSmith, it might be due to a mismatch between the project name in Dify and LangSmith, or an issue with the API key configuration. Here are some steps to troubleshoot and resolve the issue:

  1. Verify Project Name: Ensure that the project name entered in Dify matches exactly with the one in LangSmith. Any discrepancy can lead to the project not being found.

  2. Check API Key: Make sure that the API key used is correct and has the necessary permissions. You can regenerate the API key in LangSmith and update it in Dify to ensure it's valid.

  3. Endpoint Configuration: Confirm that the endpoint URL is correctly set to https://api.smith.langchain.com.

  4. Network and Access: Ensure that there are no network issues or firewall settings blocking access to the LangSmith API from your Dify setup.

If these steps do not resolve the issue, it might be helpful to check the logs for any additional error messages that could provide more insight into the problem.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@dosubot[bot] commented on GitHub (Jan 22, 2025): <!-- Greeting --> @corlin Hello there! I'm here to help you with any bugs, questions, or contributions you have for the Dify project. I'm a bot designed to assist you while waiting for a human maintainer. Let's tackle this issue together! <!-- Answer --> When Dify fails to create a project in LangSmith, it might be due to a mismatch between the project name in Dify and LangSmith, or an issue with the API key configuration. Here are some steps to troubleshoot and resolve the issue: 1. **Verify Project Name**: Ensure that the project name entered in Dify matches exactly with the one in LangSmith. Any discrepancy can lead to the project not being found. 2. **Check API Key**: Make sure that the API key used is correct and has the necessary permissions. You can regenerate the API key in LangSmith and update it in Dify to ensure it's valid. 3. **Endpoint Configuration**: Confirm that the endpoint URL is correctly set to `https://api.smith.langchain.com`. 4. **Network and Access**: Ensure that there are no network issues or firewall settings blocking access to the LangSmith API from your Dify setup. If these steps do not resolve the issue, it might be helpful to check the logs for any additional error messages that could provide more insight into the problem. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/d12740b2-0fbb-4455-b2e2-2aac0dfc4ab5?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/d12740b2-0fbb-4455-b2e2-2aac0dfc4ab5?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/d12740b2-0fbb-4455-b2e2-2aac0dfc4ab5?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/d12740b2-0fbb-4455-b2e2-2aac0dfc4ab5?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/d12740b2-0fbb-4455-b2e2-2aac0dfc4ab5?feedback_type=hallucination) | [Other](https://app.dosu.dev/response-feedback/d12740b2-0fbb-4455-b2e2-2aac0dfc4ab5?feedback_type=other)</sup>
Author
Owner

@corlin commented on GitHub (Jan 22, 2025):

Before the configuration, I had already registered and set up Langsmith, and tested it through Langgraph code. It was able to create projects and perform traces normally. However, based on the Dify configuration, it could not, especially for new Smith projects. Dify was unable to generate project names during the first configuration.

@corlin commented on GitHub (Jan 22, 2025): Before the configuration, I had already registered and set up Langsmith, and tested it through Langgraph code. It was able to create projects and perform traces normally. However, based on the Dify configuration, it could not, especially for new Smith projects. Dify was unable to generate project names during the first configuration.
Author
Owner

@crazywoola commented on GitHub (Jan 23, 2025):

https://github.com/langgenius/dify/blob/56e15d09a9e94de963dd5fc38c7455a7aaee99f3/api/core/ops/langsmith_trace/langsmith_trace.py#L507-L524
I think you need to link an existing project.

@crazywoola commented on GitHub (Jan 23, 2025): https://github.com/langgenius/dify/blob/56e15d09a9e94de963dd5fc38c7455a7aaee99f3/api/core/ops/langsmith_trace/langsmith_trace.py#L507-L524 I think you need to link an existing project.
Author
Owner

@corlin commented on GitHub (Jan 23, 2025):

dify/api/core/ops/langsmith_trace/langsmith_trace.py

Lines 507 to 524 in 56e15d0

def get_project_url(self):
try:
run_data = RunBase(
id=uuid.uuid4(),
name="tool",
inputs={"input": "test"},
outputs={"output": "test"},
run_type=LangSmithRunType.tool,
start_time=datetime.now(),
)

     project_url = self.langsmith_client.get_run_url( 
         run=run_data, project_id=self.project_id, project_name=self.project_name 
     ) 
     return project_url.split("/r/")[0] 
 except Exception as e: 
     logger.debug(f"LangSmith get run url failed: {str(e)}") 
     raise ValueError(f"LangSmith get run url failed: {str(e)}") 

I think you need to link an existing project.

The Langsmith management interface does not have a feature entry for creating projects. The existing rule is that the program passes the project name, and a Langsmith project is automatically created; if no project name is specified, it defaults to 'default'.

@corlin commented on GitHub (Jan 23, 2025): > [dify/api/core/ops/langsmith_trace/langsmith_trace.py](https://github.com/langgenius/dify/blob/56e15d09a9e94de963dd5fc38c7455a7aaee99f3/api/core/ops/langsmith_trace/langsmith_trace.py#L507-L524) > > Lines 507 to 524 in [56e15d0](/langgenius/dify/commit/56e15d09a9e94de963dd5fc38c7455a7aaee99f3) > > def get_project_url(self): > try: > run_data = RunBase( > id=uuid.uuid4(), > name="tool", > inputs={"input": "test"}, > outputs={"output": "test"}, > run_type=LangSmithRunType.tool, > start_time=datetime.now(), > ) > > project_url = self.langsmith_client.get_run_url( > run=run_data, project_id=self.project_id, project_name=self.project_name > ) > return project_url.split("/r/")[0] > except Exception as e: > logger.debug(f"LangSmith get run url failed: {str(e)}") > raise ValueError(f"LangSmith get run url failed: {str(e)}") > > I think you need to link an existing project. The Langsmith management interface does not have a feature entry for creating projects. The existing rule is that the program passes the project name, and a Langsmith project is automatically created; if no project name is specified, it defaults to 'default'.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#7853