Closed Rameshkumardas closed 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:
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.
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
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.
Close due to violating the checklist.
#######