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

All apps show as unpublished #8304

Closed
5 tasks done
AndyMik90 opened this issue Sep 12, 2024 · 3 comments · Fixed by #8320
Closed
5 tasks done

All apps show as unpublished #8304

AndyMik90 opened this issue Sep 12, 2024 · 3 comments · Fixed by #8320
Assignees
Labels
🐞 bug Something isn't working

Comments

@AndyMik90
Copy link

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.8.0

Cloud or Self Hosted

Cloud, Self Hosted (Docker), Self Hosted (Source)

Steps to reproduce

Publish any app.

✔️ Expected Behavior

Saved publish state

❌ Actual Behavior

Apps stay as unpublished

@crazywoola crazywoola self-assigned this Sep 12, 2024
@dosubot dosubot bot added the 🐞 bug Something isn't working label Sep 12, 2024
Copy link

dosubot bot commented Sep 12, 2024

The issue where all apps show as unpublished could be related to how the publish state is stored and retrieved in the Dify codebase. The publish state is managed using the fetchPublishedWorkflow function, which fetches the published workflow data and updates the workflow store accordingly. If this function fails or if there are issues with the data retrieval, the apps may remain in an unpublished state.

Here are a few steps to troubleshoot and resolve this issue:

  1. Check the fetchPublishedWorkflow Function:
    Ensure that the fetchPublishedWorkflow function is correctly fetching the published workflow data. This function should be called with the correct URL and should update the workflow store with the retrieved data.

    const handleRestoreFromPublishedWorkflow = useCallback(async () => {
        const appDetail = useAppStore.getState().appDetail
        const publishedWorkflow = await fetchPublishedWorkflow(`/apps/${appDetail?.id}/workflows/publish`)
    
        if (publishedWorkflow) {
          const nodes = publishedWorkflow.graph.nodes
          const edges = publishedWorkflow.graph.edges
          const viewport = publishedWorkflow.graph.viewport!
    
          handleUpdateWorkflowCanvas({
            nodes,
            edges,
            viewport,
          })
          featuresStore?.setState({ features: publishedWorkflow.features })
          workflowStore.getState().setPublishedAt(publishedWorkflow.created_at)
          workflowStore.getState().setEnvironmentVariables(publishedWorkflow.environment_variables || [])
        }
      }, [featuresStore, handleUpdateWorkflowCanvas, workflowStore])
  2. Verify Configuration Settings:
    Ensure that the configuration settings related to publishing are correctly set. The PublishConfig type and the publishedConfig state in the Configuration component should be properly configured.

    type PublishConfig = {
      modelConfig: ModelConfig
      completionParams: FormValue
    }
    
    const [publishedConfig, setPublishedConfig] = useState<PublishConfig | null>(null)
  3. Check for Error Messages:
    Look for specific error messages or logs that might indicate why the app is not being published. Common error messages include:

    • 404, Conversation does not exist
    • 400, invalid_param, abnormal parameter input
    • 400, app_unavailable, App configuration unavailable
    • 400, provider_not_initialize, no available model credential configuration
    • 400, provider_quota_exceeded, model invocation quota insufficient
    • 400, model_currently_not_support, current model unavailable
    • 400, completion_request_error, text generation failed
    • 500, internal server error
    • 502, Bad Gateway
  4. Permissions and Roles:
    Ensure that the user has the necessary permissions and roles to publish the app. The default roles required to publish an app are:

    • Admin: Can build apps & manage team settings.
    • Builder: Can build & edit own apps.
    • Editor: Can build & edit apps.
    admin: 'Admin',
    adminTip: 'Can build apps & manage team settings',
    builder: 'Builder',
    builderTip: 'Can build & edit own apps',
    editor: 'Editor',
    editorTip: 'Can build & edit apps',

By following these steps, you should be able to identify and resolve the issue causing the apps to remain unpublished [1][2][3][4].

To continue talking to Dosu, mention @dosu.

@crazywoola
Copy link
Member

They are saved actually, it's a UI bug I think it's related to #7801

@crazywoola
Copy link
Member

Can you @vicoooo26 take a look at this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants