-
Notifications
You must be signed in to change notification settings - Fork 283
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
[Bug] Authentification is required on localhost #2534
Comments
Hello @ant-on-su Right now it's not possible to deactivate the authenticatio. The first time that you self-host the open source version you need to create an account using username and password. This would be the admin account of this instance. This account then can invite people to this instance. Are there reasons that you would want to disable this? |
Hi @mmabrouk I am currently running Agenta locally and encountered an issue when attempting to access the application. Upon opening the localhost link, I am directed to the authentication page. However, when I enter my email and password, I receive an error message stating: "Oops, something went wrong. Please try again. If the issue persists, please contact support." Could you please assist me with this issue so that I can successfully sign in or sign up? Your help would be greatly appreciated. |
Hello @Aditya7879 Can you please share the following:
This would help us identify the root of the issue. Additionally if you have made any modification to the environment variable configuration, please let us know. Thank you! |
Hi @mmabrouk ,
Added the required images for the reference. I have not changed a single thing in the env file. Let me know if you need anything. Thanks |
Hi @Aditya7879, I'll be taking over this thread from @mmabrouk and working with you to debug and fix the issue. It looks like you don't have the organizations table created in your database, even though there's a migration file for it ( |
Hi @aybruhm , These are the list of tables present in my postgres. I don't see any organizations table here. Is this the info that you want or something else? Thanks. |
Yes, it was useful, thank you @Aditya7879 . Can you tell me what the current revision number is in the SELECT * FROM alembic_version; |
Hi, version number is 0f086ebc2f83 |
Ah, got it. You simply need to run the migration to create the new tables: docker exec -e PYTHONPATH=/app -w /app/oss/databases/postgres/migrations agenta-oss-dev-api-1 alembic -c alembic.oss.ini upgrade head If you would like migrations to be taken care of automatically for you, kindly update the value of |
Thank you @aybruhm , but migration (also auto) still didn't solve the "Oops, something went wrong" issue... |
Can you show me the logs you received when you ran the migration command?
Got it. I've taken note of this and will update the documentation. Thank you. |
Alright, can you please share the logs you get from the API container when try to sign in again? |
Alright, can you re-check your database to see if the |
Alright, can you also show me all the tables you have in your database? |
Got it. Can you confirm how many users you have currently? The issue right now is that the system expects you to have no users in order to create a default organization and workspace for you. If you have a user already, then I'd recommend that you update the async def check_if_user_exists_and_create_organization(user_email: str):
"""Check if a user with the given email exists and if not, create a new organization for them."""
async with engine.session() as session:
user_query = await session.execute(select(UserDB).filter_by(email=user_email))
user = user_query.scalars().first()
# count total number of users in database
total_users = (
await session.scalar(select(func.count()).select_from(UserDB)) or 0
)
if user is None and (total_users == 0):
organization_name = user_email.split("@")[0]
organization_db = await create_organization(name=organization_name)
workspace_db = await create_workspace(
name=organization_name, organization_id=str(organization_db.id)
)
# update default project with organization and workspace ids
await update_default_project(
values_to_update={
"organization_id": organization_db.id,
"workspace_id": workspace_db.id,
}
)
return organization_db
# organizations_db = await get_organizations()
# return organizations_db[0]
organization_name = "choose a name"
organization_db = await create_organization(name=organization_name)
workspace_db = await create_workspace(
name=organization_name, organization_id=str(organization_db.id)
)
# update default project with organization and workspace ids
await update_default_project(
values_to_update={
"organization_id": organization_db.id,
"workspace_id": workspace_db.id,
}
)
return organization_db And then try to sign in again. If everything works fine, please revert the code in the function you modified to its previous state to prevent another organization from being created. |
strange, but no any difference, same error... |
Same error as this one? How is that possible? The function no longer returns a list but now returns an object, which means it is likely that the function is not being called. Could you please re-check the organizations table to see if an organization was created? |
ahh, used wrong docker-compose yaml, it was pulling images instead of building them. Now everything works like a charm, thanks a lot! |
So after doing this and rebuilding my docker file. I'm getting this- |
@Aditya7879 this would mean that you have already created an account in this installation.
docker compose -f hosting/docker-compose/oss/docker-compose.gh.yml --env-file hosting/docker-compose/oss/.env.oss.gh --profile with-web up -d --pull always```
Please let us know if this resolves the issue
|
Has this issue now been resolved? @Aditya7879 |
I run agenta locally,
after upgrade to v36.1 (docker images and .env.oss.gh file) trying to access localhost:80 redirects to authentification page.
How to disable this?
The text was updated successfully, but these errors were encountered: