# help

Adi Polak

01/16/2023, 10:03 AM
hi, i am working with a lakeFS python client and trying to read data from lakefs branch. lakefs client api works for creating and listing branchs. yet something with the configurations for reading from a branch with Spark is probably missing. File path to load datafram from:
Copy code
main_repo_path = "<lakefs://adi-test/main/>"
This is the exception i get:
Copy code
y4JJavaError: An error occurred while calling o625.load.
: statObject
	at io.lakefs.LakeFSFileSystem.getFileStatus(
	at io.lakefs.LakeFSFileSystem.getFileStatus(
	at org.apache.hadoop.fs.FileSystem.isDirectory(
	at org.apache.spark.sql.execution.streaming.FileStreamSink$.hasMetadata(FileStreamSink.scala:59)
	at org.apache.spark.sql.execution.datasources.DataSource.resolveRelation(DataSource.scala:407)
	at org.apache.spark.sql.DataFrameReader.loadV1Source(DataFrameReader.scala:369)
	at org.apache.spark.sql.DataFrameReader.$anonfun$load$2(DataFrameReader.scala:325)
	at scala.Option.getOrElse(Option.scala:189)
	at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:325)
	at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:238)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(
	at java.lang.reflect.Method.invoke(
	at py4j.reflection.MethodInvoker.invoke(
	at py4j.reflection.ReflectionEngine.invoke(
	at py4j.Gateway.invoke(
	at py4j.commands.AbstractCommand.invokeMethod(
	at py4j.commands.CallCommand.execute(
	at py4j.ClientServerConnection.waitForCommands(
Caused by: io.lakefs.shaded.api.ApiException: Content type "text/html; charset=utf-8" is not supported for type: class io.lakefs.shaded.api.model.ObjectStats
	at io.lakefs.shaded.api.ApiClient.deserialize(
	at io.lakefs.shaded.api.ApiClient.handleResponse(
	at io.lakefs.shaded.api.ApiClient.execute(
	at io.lakefs.shaded.api.ObjectsApi.statObjectWithHttpInfo(
	at io.lakefs.shaded.api.ObjectsApi.statObject(
	at io.lakefs.LakeFSFileSystem.getFileStatus(
I configured Spark cluster with the same credentials and endpoint as the programmable lakeFS client. any idea what is missing?

Barak Amar

01/16/2023, 10:08 AM
From the error it looks like it is not related to the python / client API - but how you configured to work with "lakefs://" scheme. Check your configuration related to lakeFS's hadoopfs.

Adi Polak

01/16/2023, 10:09 AM
thanks. I am validating it now!
ok. added s3 credentials and now it works. thanks @Barak Amar!