langgenius / dify

Dify is an open-source LLM app development platform. Dify's intuitive interface combines AI workflow, RAG pipeline, agent capabilities, model management, observability features and more, letting you quickly go from prototype to production.
https://dify.ai
Other
50.05k stars 7.15k forks source link

The imported flow configuration cannot be automatically saved #5665

Closed Geek-Bob closed 2 months ago

Geek-Bob commented 4 months ago

Self Checks

Dify version

0.6.5

Cloud or Self Hosted

Self Hosted (Source)

Steps to reproduce

The imported flow configuration cannot be automatically saved Current BUG module:chat flow

Snipaste_2024-06-27_16-13-51

As you belong, there is no auto-save prompt, only post prompt

✔️ Expected Behavior

automatically saved

❌ Actual Behavior

The imported flow configuration cannot be automatically saved

Geek-Bob commented 4 months ago
Snipaste_2024-06-27_16-35-19

Uncaught (in promise) TypeError: Failed to fetch at 5079-09e911dc198f986f.js:1:17587 at new Promise ()

dosubot[bot] commented 4 months ago

To resolve the issue where the imported flow configuration in your self-hosted Dify version 0.6.5 cannot be automatically saved, and to address the JavaScript error TypeError: Failed to fetch with a net::ERR_EMPTY_RESPONSE during a debugging session, you should ensure that the URL being fetched is correct and that the server is properly responding to the requests.

Here are some steps to troubleshoot and resolve the issue:

  1. Check the URL: Ensure that the chatbotUrl being saved and fetched is correct and accessible. You can do this by manually visiting the URL in your browser to see if it responds correctly.

  2. Server Response: Ensure that the server is running and properly configured to handle the requests. Check the server logs for any errors or issues that might be causing it to not respond.

  3. Network Issues: Ensure there are no network issues preventing the request from reaching the server. This can include firewall settings, network configurations, or other network-related issues.

  4. Browser Console: Check the browser console for more detailed error messages that might give more insight into why the request is failing.

Here is the relevant part of the code that handles saving the chatbotUrl:

document.getElementById('save-button').addEventListener('click', function (e) {
  e.preventDefault();
  const chatbotUrl = document.getElementById('chatbot-url').value;
  const errorTip = document.getElementById('error-tip');

  if (chatbotUrl.trim() === "") {
      errorTip.textContent = "Dify ChatBot URL cannot be empty.";
  } else {
    errorTip.textContent = "";

    chrome.storage.sync.set({
      'chatbotUrl': chatbotUrl,
    }, function () {
      alert('Save Success!');
    });
  }
});

And the part that loads the chatbotUrl:

chrome.storage.sync.get(['chatbotUrl'], function (result) {
  const chatbotUrlInput = document.getElementById('chatbot-url');

  if (result.chatbotUrl) {
    chatbotUrlInput.value = result.chatbotUrl;
  }
});

Ensure that the chatbotUrl is correctly set and retrieved from chrome.storage.sync. If the issue persists, further investigation into the server-side code and network configurations will be necessary [[1]](https://github.com/langgenius/dify/blob/main/third-party/chrome plug-in/options.js).

To continue talking to Dosu, mention @dosu.

Geek-Bob commented 4 months ago

It's not the URL, because when you delete all the nodes, it's automatically saved

Geek-Bob commented 4 months ago

Imported **.yml file code nodes with the following two lines will not refresh automatically.

function main({arg1, empNoStr}) {

   var newStr= arg1.replace(/```json\\n|```/g, '');
    var timestamp=Date.now().toString();
}