/v1/trees/tree/{ref} forbidden

95 views
Skip to first unread message

Pascal Badzura

unread,
Dec 4, 2023, 4:16:07 AM12/4/23
to projectnessie
Hello everyone,

I have the following problem:

I start my nessie catalog via a docker container, data can be saved and queried via dremio without any problems.

However, if I want to access it via the api, I get a 403 error with the following GET request.

curl -X 'GET' \ 'http://localhost:19120/v2/trees/main?fetch=MINIMAL' \ -H 'accept: application/json'

Would be great if someone here could give me a hint why this is and how I can fix it.

Many thanks in advance

Kind regards
Pascal
Screenshot 2023-12-04 095601.png

Robert Stupp

unread,
Dec 4, 2023, 10:23:33 AM12/4/23
to projectnessie

Hi,

that's probably just the public swagger UI running `curl` on their servers.

Just copy&paste the curl-command to your terminal and run it there.

Robert


PS: We have our public chat available on https://project-nessie.zulipchat.com/ - discussions are easier over there and response turn-around times are usually much quicker.

--
You received this message because you are subscribed to the Google Groups "projectnessie" group.
To unsubscribe from this group and stop receiving emails from it, send an email to projectnessi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/projectnessie/44721c7f-017d-4fb0-898c-99f8aebceb3bn%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
-- 
Robert Stupp
@snazy

Dmitri Bourlatchkov

unread,
Dec 4, 2023, 11:06:27 AM12/4/23
to Robert Stupp, projectnessie
Also, with the default docker image the URL probably needs to be `http://localhost:19120/api/v2/trees/main` (note the "api" part).

Swagger needs to have the "host" and "baseBase" parameters to be able to properly construct curl commands. Those parameters depend on the server configuration, so for docker images the base path is "api".

Cheers,
Dmitri.

Pascal Badzura

unread,
Dec 4, 2023, 12:45:38 PM12/4/23
to projectnessie
Thank you both for your fast reply.

I was able to find the problem but unfortunate I don't know how to fix this.

I'm trying to use a kafka-connector with nessie and minio (similar to this https://github.com/developer-advocacy-dremio/kafka-connect-iceberg-nessie-env/tree/main).
Kafka-connect is trying a GET request against 'http://localhost:19120/api/v2/trees/tree/main?fetch=MINIMAL'.

Regards,
Pascal

org.apache.kafka.connect.errors.ConnectException: Exiting WorkerSinkTask due to unrecoverable exception.
2023-12-04 18:33:20     at org.apache.kafka.connect.runtime.WorkerSinkTask.deliverMessages(WorkerSinkTask.java:618)
2023-12-04 18:33:20     at org.apache.kafka.connect.runtime.WorkerSinkTask.poll(WorkerSinkTask.java:336)
2023-12-04 18:33:20     at org.apache.kafka.connect.runtime.WorkerSinkTask.iteration(WorkerSinkTask.java:237)
2023-12-04 18:33:20     at org.apache.kafka.connect.runtime.WorkerSinkTask.execute(WorkerSinkTask.java:206)
2023-12-04 18:33:20     at org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:204)
2023-12-04 18:33:20     at org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:259)
2023-12-04 18:33:20     at org.apache.kafka.connect.runtime.isolation.Plugins.lambda$withClassLoader$1(Plugins.java:181)
2023-12-04 18:33:20     at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
2023-12-04 18:33:20     at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
2023-12-04 18:33:20     at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
2023-12-04 18:33:20     at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
2023-12-04 18:33:20     at java.base/java.lang.Thread.run(Thread.java:829)
2023-12-04 18:33:20 Caused by: org.projectnessie.client.http.HttpClientException: Failed to execute GET request against 'http://localhost:19120/api/v2/trees/tree/main?fetch=MINIMAL'.
2023-12-04 18:33:20     at org.projectnessie.client.http.impl.jdk11.JavaRequest.executeRequest(JavaRequest.java:128)
2023-12-04 18:33:20     at org.projectnessie.client.http.HttpRequest.get(HttpRequest.java:80)
2023-12-04 18:33:20     at org.projectnessie.client.rest.v1.RestV1TreeClient.getReferenceByName(RestV1TreeClient.java:83)
2023-12-04 18:33:20     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2023-12-04 18:33:20     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
2023-12-04 18:33:20     at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2023-12-04 18:33:20     at java.base/java.lang.reflect.Method.invoke(Method.java:566)
2023-12-04 18:33:20     at org.projectnessie.client.rest.v1.RestV1Client$ExceptionRewriter.invoke(RestV1Client.java:78)
2023-12-04 18:33:20     at com.sun.proxy.$Proxy56.getReferenceByName(Unknown Source)
2023-12-04 18:33:20     at org.projectnessie.client.rest.v1.HttpGetReference.get(HttpGetReference.java:34)
2023-12-04 18:33:20     at org.apache.iceberg.nessie.NessieIcebergClient.loadReference(NessieIcebergClient.java:114)
2023-12-04 18:33:20     at org.apache.iceberg.nessie.NessieIcebergClient.lambda$new$0(NessieIcebergClient.java:81)
2023-12-04 18:33:20     at org.apache.iceberg.relocated.com.google.common.base.Suppliers$NonSerializableMemoizingSupplier.get(Suppliers.java:181)
2023-12-04 18:33:20     at org.apache.iceberg.nessie.NessieIcebergClient.getRef(NessieIcebergClient.java:89)
2023-12-04 18:33:20     at org.apache.iceberg.nessie.NessieIcebergClient.refresh(NessieIcebergClient.java:97)
2023-12-04 18:33:20     at org.apache.iceberg.nessie.NessieTableOperations.doRefresh(NessieTableOperations.java:86)
2023-12-04 18:33:20     at org.apache.iceberg.BaseMetastoreTableOperations.refresh(BaseMetastoreTableOperations.java:97)
2023-12-04 18:33:20     at org.apache.iceberg.BaseMetastoreTableOperations.current(BaseMetastoreTableOperations.java:80)
2023-12-04 18:33:20     at org.apache.iceberg.BaseMetastoreCatalog.loadTable(BaseMetastoreCatalog.java:47)
2023-12-04 18:33:20     at io.tabular.iceberg.connect.data.IcebergWriterFactory.createWriter(IcebergWriterFactory.java:54)
2023-12-04 18:33:20     at io.tabular.iceberg.connect.channel.Worker.lambda$writerForTable$8(Worker.java:242)
2023-12-04 18:33:20     at java.base/java.util.HashMap.computeIfAbsent(HashMap.java:1134)
2023-12-04 18:33:20     at io.tabular.iceberg.connect.channel.Worker.writerForTable(Worker.java:241)
2023-12-04 18:33:20     at io.tabular.iceberg.connect.channel.Worker.lambda$routeRecordStatically$5(Worker.java:197)
2023-12-04 18:33:20     at java.base/java.util.Arrays$ArrayList.forEach(Arrays.java:4390)
2023-12-04 18:33:20     at io.tabular.iceberg.connect.channel.Worker.routeRecordStatically(Worker.java:195)
2023-12-04 18:33:20     at io.tabular.iceberg.connect.channel.Worker.save(Worker.java:184)
2023-12-04 18:33:20     at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
2023-12-04 18:33:20     at io.tabular.iceberg.connect.channel.Worker.save(Worker.java:171)
2023-12-04 18:33:20     at io.tabular.iceberg.connect.IcebergSinkTask.put(IcebergSinkTask.java:150)
2023-12-04 18:33:20     at org.apache.kafka.connect.runtime.WorkerSinkTask.deliverMessages(WorkerSinkTask.java:587)
2023-12-04 18:33:20     ... 11 more
2023-12-04 18:33:20 Caused by: java.net.ConnectException: Connection refused
2023-12-04 18:33:20     at java.net.http/jdk.internal.net.http.HttpClientImpl.send(HttpClientImpl.java:561)
2023-12-04 18:33:20     at java.net.http/jdk.internal.net.http.HttpClientFacade.send(HttpClientFacade.java:119)
2023-12-04 18:33:20     at org.projectnessie.client.http.impl.jdk11.JavaHttpClient.lambda$newRequest$0(JavaHttpClient.java:68)
2023-12-04 18:33:20     at org.projectnessie.client.http.impl.jdk11.JavaRequest.executeRequest(JavaRequest.java:110)
2023-12-04 18:33:20     ... 41 more
2023-12-04 18:33:20 Caused by: java.net.ConnectException: Connection refused
2023-12-04 18:33:20     at java.base/sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
2023-12-04 18:33:20     at java.base/sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:777)
2023-12-04 18:33:20     at java.net.http/jdk.internal.net.http.PlainHttpConnection$ConnectEvent.handle(PlainHttpConnection.java:128)
2023-12-04 18:33:20     at java.net.http/jdk.internal.net.http.HttpClientImpl$SelectorManager.handleEvent(HttpClientImpl.java:957)
2023-12-04 18:33:20     at java.net.http/jdk.internal.net.http.HttpClientImpl$SelectorManager.lambda$run$3(HttpClientImpl.java:912)
2023-12-04 18:33:20     at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
2023-12-04 18:33:20     at java.net.http/jdk.internal.net.http.HttpClientImpl$SelectorManager.run(HttpClientImpl.java:912)

Dmitri Bourlatchkov

unread,
Dec 4, 2023, 12:49:36 PM12/4/23
to Pascal Badzura, projectnessie
Hi Pascal,

You may want to change `localhost` to something that is routable within the env. where the Nessie client runs.

Would you mind switching the conversion to Zulip ( https://project-nessie.zulipchat.com/ )? It might be easier there :) There's also a join link on projectnessie.org

Reply all
Reply to author
Forward
0 new messages