Files caching during prisma import

prisma

#1

Hey there! I’m currently working with prisma importing (via cli command, not with direct curl) and faced some weird thing. I’m able to upload for the first time a big set of data (in my case around 70 pretty large json files for nodes and relations) and it’s fine. But when I regenerate a new set of nodes/relations with updated values, most of the node json files are skipped (noticed that it’s skipping files with the same name as previously uploaded). And the following uploading of relations fails with constraint error (since the nodes were not uploaded, as far as I guess). The skipping itself looks like this:
Uploading nodes…
Skipping file data/nodes/2.json (already imported)
Skipping file data/nodes/3.json (already imported)
Skipping file data/nodes/4.json (already imported)`

Is there any kind of caching by file name or whatever? The skipping itself runs pretty quickly, so I don’t think it’s parsing the files. Tried killing docker containers, nuking, upgrading — the problem stays.

Has anybody faced the same issue?

P.S. using prisma import command with non-zipped folder, jsons are named 1 to n iteratively.
P.P.S. using curl works fine, but it’s not comfortable when it comes to handling over9000 files


#2

Nevermind, solved this by removing state.json file. This line in ‘\cli\packages\prisma-cli-core\src\commands\import\Importer.ts’ source file was causing this:
for (const fileName of files.nodes) {
const n = this.getNumber(fileName)
if (state.nodes >= n) {
this.out.log(Skipping file ${fileName} (already imported))
continue
}


#3

@Cyril_Oleynikov Awesome! :slight_smile: Could you mark your last post as solved. Thanks a lot :slight_smile: