Raman Kharche
05/25/2022, 2:17 PMlakectl ingest --from <s3://bucket-name/template> --to <lakefs://repo1/main/>
it works
When I try to do it via java API it gives Internal Server Error
Following is the sample code:
StageRangeCreation stageRangeCreation = new StageRangeCreation();
stageRangeCreation.setFromSourceURI("<s3://bucket-name/template>");
stageRangeCreation.setAfter("main/");
stageRangeCreation.setPrepend("main/");
importApi.ingestRange('repo1', stageRangeCreation);
Is ingestRange
API is correct to ingest? If yes then what I'm missing here?Itai David
05/25/2022, 2:28 PMItai David
05/25/2022, 3:02 PMingestRange
API is not the same as the lakectl ingest
command. While lakectl ingest
is a complete ingest flow, perfromed by the lakectl
client, ingestRange
is a plumbing API that is meant to be used as part of an import flow (specifically, UI import) and has to be followed by additional API calls (CreateMetaRange
)
Nevertheless, that does not explain the error response. Can you elaborate some more details on the error itself? Anything from the server logs?Raman Kharche
05/25/2022, 3:21 PMRaman Kharche
05/25/2022, 3:21 PMlakectl ingest
java api would be?Itai David
05/25/2022, 3:40 PMingestRange
followed by createMetaRange
, where the range(s) ingested by ingestRange
are given as parameters to createMetaRange
Itai David
05/25/2022, 3:50 PMRaman Kharche
05/25/2022, 4:30 PMRaman Kharche
05/25/2022, 4:31 PMingestRange
createMetaRange
I will have to callRaman Kharche
05/25/2022, 4:31 PMingestRange
is breaking for me.Itai David
05/25/2022, 4:34 PMlakefs
server logs?Raman Kharche
05/25/2022, 4:35 PM./lakefs --config lake-config.yaml run
Raman Kharche
05/25/2022, 4:35 PMRaman Kharche
05/25/2022, 4:36 PMItai David
05/25/2022, 4:38 PMRaman Kharche
05/25/2022, 4:49 PMItai David
05/25/2022, 4:53 PMstageRangeCreation.setAfter("main/");
If I'm not wrong, this means you are looking to ingest objects following the "main/"
key in the from
.
Is that configuration correct?
I'm asking, as it doesn`t seem to match the lakectl ingest
command you specified above.Raman Kharche
05/25/2022, 4:56 PMItai David
05/25/2022, 5:05 PMingestRange
and createMetaRange
does not define a branch. After these you will have to perform a Commit
API call, providing the branch
and the metarange
created by createMetaRange
APIItai David
05/25/2022, 5:07 PMafter
should be the starting point in your from
location, and the prepend
is a prefix you would like to add to the ingested objects, in the target
repoItai David
05/25/2022, 5:09 PM"main/"
prefix, that is not correlated to the branch main
Raman Kharche
05/25/2022, 5:17 PMfrom
is <s3://bucket-name/template>
in that case after
will be template
and the prepend
can be empty. Right?Itai David
05/25/2022, 5:47 PMafter
should be a key, in the from
location, from which you would like to ingest. In case you would like to ingest the entire from
repository, use ""
(this will align with the lakectl ingest
command you specified
prepend
can be left empty too (will also align with your lakectl ingest
). It is a prefix you like to add to the ingested objects in the target. E.g., if your from
contains obj1, obj2...
using prepend = "somepref"
will create somepref/obj1, somepref/obj2...
.Raman Kharche
05/25/2022, 6:04 PMStageRangeCreation stageRangeCreation = new StageRangeCreation();
stageRangeCreation.setFromSourceURI("<s3://bucket-name/template>");
stageRangeCreation.setAfter("");
stageRangeCreation.setPrepend("");
importApi.ingestRange('repo1', stageRangeCreation);
Raman Kharche
05/25/2022, 6:05 PMingest_range
log actionItai David
05/25/2022, 6:06 PMRaman Kharche
05/25/2022, 6:08 PMcreate_repo
because before ingestRange
I call to create a repo. And then this
DEBUG [2022-05-25T232655+0530]lakeFS/pkg/httputil/logging.go78 pkg/httputil.DebugLoggingMiddleware.func1.1 HTTP call ended host="localhost:8000" method=POST path="/api/v1/repositories?bare=false" request_id=e6b055fd-b114-4f52-8345-c8c1f58532d7 sent_bytes=118 service_name=rest_api status_code=201 took=5.1797475s
thats itItai David
05/25/2022, 6:09 PMItai Admi
05/25/2022, 6:16 PMIngestRange
is a plumbing command, which must be executed in a sequential order with more plumbing commands, which is hard to nail just right. There might be an easier path if you explain more about the use case..Raman Kharche
05/26/2022, 1:20 AMItai David
05/26/2022, 1:40 AMItai David
05/26/2022, 1:40 AMRaman Kharche
05/26/2022, 1:41 AMVersion 0.64.0
Itai David
05/26/2022, 1:54 AMingestRange
APIRaman Kharche
05/26/2022, 2:01 AMItai David
05/26/2022, 2:04 AMRaman Kharche
05/26/2022, 2:13 AMingest-range
.
DEBUG [2022-05-26T073831+0530]lakeFS/pkg/api/controller.go3424 pkg/api.(*Controller).LogAction performing API action action=ingest_range
host="localhost:8000" message_type=action method=POST path=/api/v1/repositories/marvel19/branches/ranges request_id=c2a40b98-d5ff-4116-9fa7-28191ca9a775 service=api_gateway service_name=rest_api
ERROR
[2022-05-26T073832+0530]lakeFS/pkg/logging/logger.go250 pkg/logging.(*logrusEntryWrapper).Errorf Aborting write to range: %!w(*fmt.wrapError=&{sstable file close: pebble: keys must be added in order: #0,DEL, #0,SET 0xc009b7d038})
DEBUG [2022-05-26T073832+0530]lakeFS/pkg/httputil/logging.go78 pkg/httputil.DebugLoggingMiddleware.func1.1 HTTP call ended host="localhost:8000" method=POST path=/api/v1/repositories/marvel19/branches/ranges request_id=c2a40b98-d5ff-4116-9fa7-28191ca9a775 sent_bytes=140 service_name=rest_api status_code=500 took=896.6992msItai David
05/26/2022, 2:25 AMRaman Kharche
05/26/2022, 2:25 AMThe Import Button
I will check what's the problem in there with the change.
I'm grateful to you. I wanted to thank you for your help. Thanks muchItai David
05/26/2022, 2:27 AM