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
35.59k stars 4.8k forks source link

I unable to connect with pgdata | domain redirect on installation page #5630

Closed Rameshkumardas closed 3 days ago

Rameshkumardas commented 3 days ago

#######

dosubot[bot] commented 3 days ago

To resolve the issue where your self-hosted Dify instance redirects to the installation page instead of the login page, despite having pgdata set up, you need to ensure that the setup status is correctly recorded in the database. Here are the steps to troubleshoot and fix this:

  1. Check the Setup Status in the Database: Ensure that the setup status is correctly recorded in the database. The get_setup_status function checks if the setup has been completed by querying the DifySetup model.

    def get_setup_status():
       if current_app.config['EDITION'] == 'SELF_HOSTED':
           return DifySetup.query.first()
       else:
           return True

    If DifySetup.query.first() returns None, it means the setup is not marked as completed.

  2. Ensure the Setup Function is Called: Make sure that the setup function is called and the DifySetup instance is correctly added to the database. You might need to add db.session.commit() after adding the DifySetup instance to ensure the changes are committed.

    def setup():
       dify_setup = DifySetup(
           version=current_app.config['CURRENT_VERSION']
       )
       db.session.add(dify_setup)
       db.session.commit()  # Ensure the changes are committed
  3. Verify the post Method of SetupApi: Ensure that the post method of SetupApi is called successfully and the setup process completes without errors. This should mark the setup as completed and prevent the redirection to the installation page.

By following these steps, you should be able to resolve the issue and have your Dify instance redirect to the login page instead of the installation page [1].

To continue talking to Dosu, mention @dosu.

crazywoola commented 3 days ago

Close due to violating the checklist.