Hi everyone! I'm trying to setup LakeFS on my loca...
# help
u
Hi everyone! I'm trying to setup LakeFS on my local and I'm puzzled as to how to move forward. Here's what I've done so far. 1. Installed LakeFS using docker compose (followed the steps in documentation here: https://docs.lakefs.io/quickstart/installing.html). 2. Verified that I'm able to access the LakeFS UI on http://127.0.0.1:8000/setup. 3. Created a new repo through the UI and used local as the storage namespace. 4. After this, I want to access the repo programmatically (python) instead of using the UI. So following the docs here (https://docs.lakefs.io/integrations/python.html), I installed lakefs-client (v0.63.0), ran the snippet below and hit the error
lakefs_client.exceptions.UnauthorizedException: (401)
What am I missing? Isn't specifying the username and password sufficient to connect to LakeFS instance running on docker?
u
Hi @Vino. Welcome to lakefs. when you say you passed the username and password, I assume you mean you passed the secret key and access key id, that were created in the initial setup of lakefs?
u
Yes, exactly!
u
Interesting, are you sure these are valid credentials? Maybe try to create a new set of credentials in the UI, and try again with them
u
As well can you share the snippet you ran (obviously mark out all sensitive fields)
u
Hey Shimi, thanks for looking into this. I tried creating a new pair of secret keys from UI and ran into the same error. I'll post the code snippet in a bit.
u
Copy code
import lakefs_client
from lakefs_client import models
from lakefs_client.client import LakeFSClient

configuration = lakefs_client.Configuration()
configuration.username = "XXX"
configuration.password = "XXX"
configuration.host = "<http://127.0.0.1:8000|http://127.0.0.1:8000>"

client = LakeFSClient(configuration)

repo = models.RepositoryCreation(name="lakefs-demo-repo",
                                 storage_namespace="<local://lakefs-demo-repo|local://lakefs-demo-repo>",
                                 default_branch="main")
client.repositories.create_repository(repo)

client.branches.list_branches("lakefs-demo-repo")
u
Let me try and reproduce, will update shortly
u
Sure! Just to add, I'm running this snippet from my local not inside the container.
u
I successfully reproduced (copied your python code and added just the credentials) and it is working just fine for me.
u
@Vino Can you send the logs of the lakefs server?
u
This is very interesting, It worked for me and the logs seem to be consistent with the fact that there is an auth error. Would you be interested in a private session (virtual meeting) to try and resolve this?
u
@Vino Feel free to msg me privately
u
Hi @Shimi Wieder I was able to get around this issue. I had downloaded the config file
lakectl.yaml
to my homedir, however as I created new pairs of secret access keys, I didn't update the yaml file with new keys. I guess this explains the authentication error.
u
Hi @Vino, I am happy to hear this is working for you now! I must say though that AFAIK the python code you mentioned doesn’t refer to the credentials in the
lakectl.yaml
file (I.e, there could be any credentials there or none), it only uses the credentials you explicitly passed to it in the code. I will test this (i.e. pass bad credentials in the lakectl file and the proper ones in the python code) and update my findings here.
u
@Vino Tested the above, while passing invalid credentials to
lakectl.yaml
and the proper credentials to the python file, it worked just fine and created the necessary repo. As of now, this does not seem to be a bug in my opinion. In any case, Enjoy your lakeFS journey😄jumping lakefs.
u
That's great. Thank you! 😄