saalfeldlab / n5

Not HDF5
BSD 2-Clause "Simplified" License
158 stars 22 forks source link

Don't understand logic for checking whether a "basepath" exists.... #117

Closed tischi closed 6 months ago

tischi commented 6 months ago

Hi, I don't understand this logic:

https://github.com/saalfeldlab/n5/blob/b692b39c3734bc5c2663a4aa1e6704ff4ac327d7/src/main/java/org/janelia/saalfeldlab/n5/N5KeyValueReader.java#L144

Why does it not read: if (checkExists && !exists(basePath)) instead of if (checkExists && !exists("/"))?

I am struggling with this, because I am getting an error:

org.janelia.saalfeldlab.n5.N5Exception$N5IOException: No container exists at rawdata/sbem-6dpf-1-whole-raw.n5

    at org.janelia.saalfeldlab.n5.N5KeyValueReader.<init>(N5KeyValueReader.java:144)
    at org.janelia.saalfeldlab.n5.N5KeyValueReader.<init>(N5KeyValueReader.java:86)
    at org.janelia.saalfeldlab.n5.s3.N5AmazonS3Reader.<init>(N5AmazonS3Reader.java:69)
    at org.janelia.saalfeldlab.n5.s3.N5AmazonS3Reader.<init>(N5AmazonS3Reader.java:96)

This error is triggered using this code:

final AmazonS3 s3 = S3Utils.getS3Client( serviceEndpoint, signingRegion );
this.n5 = new N5AmazonS3Reader( s3, bucketName, key, true );

with

image

This happens only using the latest versions of n5 that are now shipped with Fiji. Earlier version did not have this issue.

tischi commented 6 months ago

I arrived at this error using the deprecated N5AmazonS3Reader. Using N5Factory instead did not show this issue.