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

[BUG]: We could not log you in - contact an admin. [002] Failed to authenticate #133

Closed
LIdro opened this issue Feb 14, 2024 · 6 comments
Closed
Labels
possible bug unconfirmed bug report

Comments

@LIdro
Copy link

LIdro commented Feb 14, 2024

How are you running VectorAdmin?

Local development

What happened?

I cloned your repository to my local environment and followed the installation steps. I am currently facing the failed to authenticate wall. I am using the email: [email protected] and password: password
auth-failed-va

Are there known steps to reproduce?

  • I am running it from a windows machine.
  • My postgres instance is also local via pgAdmin. I think vector admin connected properly because it did populate the new database I created for it with the appropriate tables and such.
  • I only changed the DATABASE_CONNECTION_STRING in the .env to suit my use case.
  • I expected vector-admin to run on port 3001 but it automatically opens 3000 instead. I guess this is not an issue.
  • I checked all reported issues, both open and closed but it seems everyone else is running the docker image. I tried to implement suggestions there but it didn't get me anywhere.
  • I tried the docker image but couldn't get passed the long docker run command (docker run -d -p 3001:3001 \ -e SERVER_PORT="3001" ...). Docker told me
    docker: invalid reference format.
    See 'docker run --help'
  • my backend and frontend vector admin commands seem to be running correctly
    frontend-va
    server-va

I am new on reporting issues on github and do not master the format yet. Are there any other details I may need to provide to for the community to help me resolve this issue?

I really want to use this tool. It will cut my dev time by a lot. Please help me out.

@LIdro LIdro added the possible bug unconfirmed bug report label Feb 14, 2024
@timothycarambat
Copy link
Member

Can you open up a database explorer and see if the users table has the admin credential created? Also, can you open the network tab before sending login credentials and ensure that the endpoint requests are being sent to is :3001/api/.. and not :3000/api/...

@LIdro
Copy link
Author

LIdro commented Feb 15, 2024

Can you open up a database explorer and see if the users table has the admin credential created? Also, can you open the network tab before sending login credentials and ensure that the endpoint requests are being sent to is :3001/api/.. and not :3000/api/...

Thanks for the reply.

  • The users table has no records in it
  • As the image below shows, the login request goes to :3000/api/... instead.

I guess this is my problem. Please how can I resolve it?

Thanks for the help so far.

network-tab

@timothycarambat
Copy link
Member

change the value of VITE_API_BASE in frontend/.env to be VITE_API_BASE='http://localhost:3001/api'

@LIdro
Copy link
Author

LIdro commented Feb 16, 2024

change the value of VITE_API_BASE in frontend/.env to be VITE_API_BASE='http://localhost:3001/api'

Thanks for the response. I will do it and get back to you.

Then what about the absence of the root account in the users table? How can I make the app to create the record? I know it should concern Prisma. I tried entering it manually but the password is not hashed. I guess there should be another way to go about this. Thanks.

@timothycarambat
Copy link
Member

When the system boots up it will attempt to read the users table and auto-create the root account. So unless the database connection string is incorrect then it should automatically do that and enable login!

We will be removing that flow soon with PR #132
So that should simplify things a lot - this detail always causes issues and there are ways to accomplish what it does without making a user that can never been used again

@LIdro
Copy link
Author

LIdro commented Feb 17, 2024

I have done all I can to get the system to boot.
I have tried placing breakpoints when systemInit() is called, I have stopped and restarted the flask api and the frontend server, all so that I can see if the query to create the user is executed but it does not hit any of my breakpoints.
I have even created another database and called prisma setup to it. It did all but nothing I do auto creates the root user.

I manually created a root user with password encrypted using bcrypt, 10 but it still will not let me in.

Is there something I am missing or could do? Please I really need this vectorAdmin solution.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
possible bug unconfirmed bug report
Projects
None yet
Development

No branches or pull requests

2 participants