Closed kesarwam closed 1 year ago
hey @kesarwam ,
I started looking at this issue and I managed to reproduce it, it happens when I try to authenticate using an inexistent user, therefore the built-in authentcator returns not found. it's usually part of a two following errors:
{"error":"1 error occurred:\n\t* built in authenticator: not found\n\n","file":"pkg/auth/authenticator.go:54","func":"pkg/auth.ChainAuthenticator.AuthenticateUser","host":"localhost:8000","level":"info","method":"GET","msg":"Failed to authenticate user","operation_id":"GetLakeFSVersion","path":"/api/v1/config/version","request_id":"a128128b-5bf3-4a8e-b885-ed2807a10c32","service_name":"rest_api","time":"2023-02-06T09:48:32+02:00","username":"XXX"}
{"error":"1 error occurred:\n\t* built in authenticator: not found\n\n","file":"pkg/api/auth_middleware.go:246","func":"pkg/api.userByAuth","host":"localhost:8000","level":"error","method":"GET","msg":"authenticate","operation_id":"GetLakeFSVersion","path":"/api/v1/config/version","request_id":"a128128b-5bf3-4a8e-b885-ed2807a10c32","service":"api_gateway","service_name":"rest_api","time":"2023-02-06T09:48:44+02:00","user":"XXX"}
I'd like to change the error message to something more information ("credentials not found") - see example below. Do you think this will be sufficient?
{"error":"1 error occurred:\n\t* built in authenticator: credentials not found\n\n","file":"pkg/auth/authenticator.go:54","func":"pkg/auth.ChainAuthenticator.AuthenticateUser","host":"localhost:8000","level":"info","method":"GET","msg":"Failed to authenticate user","operation_id":"GetLakeFSVersion","path":"/api/v1/config/version","request_id":"7f66974d-0ecc-45d0-b7cb-d8c9c151201b","service_name":"rest_api","time":"2023-02-06T09:55:39+02:00","username":"XXX"}
{"error":"1 error occurred:\n\t* built in authenticator: credentials not found\n\n","file":"pkg/api/auth_middleware.go:246","func":"pkg/api.userByAuth","host":"localhost:8000","level":"error","method":"GET","msg":"authenticate","operation_id":"GetLakeFSVersion","path":"/api/v1/config/version","request_id":"7f66974d-0ecc-45d0-b7cb-d8c9c151201b","service":"api_gateway","service_name":"rest_api","time":"2023-02-06T09:55:39+02:00","user":"XXX"}
@ortz Yes, this will be sufficient.
If I provide wrong lakeFS credentials in Python client then I see following error message in lakeFS logs. Error message "built in authenticator: not found" is confusing. This means as if built in authenticator (or some program) is missing. Can we please fix the error message?
ERROR [2023-01-25T16:20:49Z]lakeFS/pkg/api/auth_middleware.go:246 pkg/api.userByAuth authenticate error="1 error occurred:\n\t* built in authenticator: not found\n\n" host="127.0.0.1:8000" method=GET operation_id=GetLakeFSVersion path=/api/v1/config/version request_id=dd77a334-8727-49c7-a07e-c96dd4ff82bb service=api_gateway service_name=rest_api user=