https://lakefs.io/ logo
#help
Title
# help
y

yiming song

08/17/2023, 2:26 AM
Hi ,all I have a problem when use the python lakefs_client: I have deployed the lakefs service locally. when i use the example api: client.repositories_api.list_repositories(prefix="",after="", amount=100 ) .It reported an error: urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='xxx', port=xxx): Max retries exceeded with url: /api/v1/repositories (Caused by ProtocolError('Connection aborted.', ConnectionResetError(10054, '远程主机强迫关闭了一个现有的连接。', None, 10054, None))) However , other api :such as :client.repositories_api.delete_repository(repo_name),,client.branches_api.create_branch(repository=repo_name, branch_creation=branch_creation) are ok. list_repositories and list_branches api are have the error
👍 1
g

Guy Hardonag

08/17/2023, 7:46 AM
Hi @yiming song, I wasn’t able to reproduce on my side. Can you please provide the versions of lakeFS server and python client? Adding the commands for convenience •
lakefs --version
pip show lakefs_client
u

暗号

08/17/2023, 9:24 AM
Hi, im the one ,thank u for help. the versions of Lakefs is 0.105.0, the lakefs_client is 0.105.0
👀 2
g

Guy Hardonag

08/17/2023, 10:57 AM
I wasn’t able to reproduce: Can you please try to run the following code:
Copy code
import lakefs_client
from lakefs_client.client import LakeFSClient

configuration = lakefs_client.Configuration()
configuration.username = 'AKIAIOSFDNN7EXAMPLEQ'
configuration.password = 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY'
configuration.host = '<http://localhost:8000>'
client = LakeFSClient(configuration)
resp = client.repositories_api.list_repositories(prefix="",after="", amount=100)
for item in resp.results:
    print(item)
Change the configuration to fit to your environment
Also, is there any load-balancer/proxy between your client to lakeFS?
u

暗号

08/17/2023, 11:03 AM
it still reported it wrong. and there is no load-balancer/proxy between my client to lakeFS.
my lakefs server was run with docker ; docker run -p 8001:8000 -e LAKEFS_BLOCKSTORE_TYPE='s3' \ -e LAKEFS_BLOCKSTORE_S3_FORCE_PATH_STYLE='true' \ -e LAKEFS_BLOCKSTORE_S3_ENDPOINT='http://xx.xx.xx.xx:9000' \ -e LAKEFS_BLOCKSTORE_S3_DISCOVER_BUCKET_REGION='false' \ -e LAKEFS_BLOCKSTORE_S3_CREDENTIALS_ACCESS_KEY_ID='minioadmin' \ -e LAKEFS_BLOCKSTORE_S3_CREDENTIALS_SECRET_ACCESS_KEY='minioadmin' \ treeverse/lakefs run --local-settings
If I don't use the lakefs_client, I can call the api of the lakefs service I installed directly from postman and respond correctly
g

Guy Hardonag

08/17/2023, 11:58 AM
Where are you running the code, can you run it locally from your CLI?
u

暗号

08/17/2023, 2:00 PM
yes I run it locally . in the pycharm
g

Guy Hardonag

08/17/2023, 2:03 PM
In the error message I see
Get /datasetmanage/lakefs/…
Where does that come from?
u

暗号

08/17/2023, 2:06 PM
our team want to develop a dataset platform based on lakefs . So that Url is my.And I use the lakefs api during my own interface
g

Guy Hardonag

08/17/2023, 2:12 PM
Nice 😃, In order to try and identify the problem, can you please start by just running the provided command directly?
u

暗号

08/17/2023, 2:19 PM
Okok.But I'm at home now, my computer is in my company. By the way , can I ask that what's the meaning of running the provided command .I'm sorry that my English is not good。🤣
g

Guy Hardonag

08/17/2023, 2:30 PM
Sorry I wasn’t clear, meant the code snippet I provided earlier
Copy code
import lakefs_client
from lakefs_client.client import LakeFSClient

configuration = lakefs_client.Configuration()
configuration.username = 'AKIAIOSFDNN7EXAMPLEQ'
configuration.password = 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY'
configuration.host = '<http://localhost:8000>'
client = LakeFSClient(configuration)
resp = client.repositories_api.list_repositories(prefix="",after="", amount=100)
for item in resp.results:
    print(item)
Change the configuration to fit to your environment
u

暗号

08/17/2023, 2:37 PM
Thank u for explaining. I will try it tomorrow. Thanks~
👍 1
Hi, i tried the code. And the results of the code are here . The first picture is to create the repository, and its result is correct. But the secend which is to list the repositories has error.
I deployed another lakefs service on another server, the same code, this time no errors. But the previous server, using postman to tune the same interface, can also respond normally ah, I am very puzzled
b

Barak Amar

08/18/2023, 5:11 AM
Can't see the host value - can you verify you don't specify any path there. like in the example code. Alternatively can you paste here the configuration.host value and instead of image mask replace any letter with x and any digit with 8?
u

暗号

08/18/2023, 5:50 AM
import lakefs_client from lakefs_client.client import LakeFSClient from lakefs_client import models configuration = lakefs_client.Configuration() configuration.username = 'AKIAJLQJ6LOX57YS54VQ' configuration.password = 'XT2z7RRDX9QFr4Y4TrRQe1Qw9GAi4HgjH1XT7g5v' configuration.host = 'http://124.221.75.166:8001/' client = LakeFSClient(configuration) resp = client.repositories_api.list_repositories(prefix="", after="", amount=100) for item in resp.results: print(item)
and the minio is also on the server 124.221.75.1669000
b

Barak Amar

08/18/2023, 9:00 AM
Copy code
configuration.debug = True
should dump the raw request - it may help understanding why we are getting bad protocol error
u

暗号

08/21/2023, 8:23 AM
thank u