bio-guoda / preston

a biodiversity dataset tracker
MIT License
24 stars 1 forks source link

preston queries https://dataone.org with non-dataone queries #261

Open jhpoelen opened 1 year ago

jhpoelen commented 1 year ago

on requesting:

preston cat\
 --remote https://dataone.org\
 hash://sha256/98493caa8b37eaa26343bbf73f232597a3ccda20498563327a4c3713821df892

the error message below indicates that Preston tried to query https://dataone.org/preston-98.tar.gz , which is something that dataone is unlikely to understand.

preston cat --remote https://dataone.org hash://sha256/98493caa8b37eaa26343bbf73f232597a3ccda20498563327a4c3713821df892
[https://cn.dataone.org/c...dataUrl&rows=10&wt=json] 280 bytes at 0.00 MB/s completed in < 1 minute
java.io.IOException: problem retrieving [hash://sha256/98493caa8b37eaa26343bbf73f232597a3ccda20498563327a4c3713821df892]
    at bio.guoda.preston.cmd.ContentQueryUtil.getContent(ContentQueryUtil.java:58)
    at bio.guoda.preston.cmd.ContentQueryUtil.copyContent(ContentQueryUtil.java:32)
    at bio.guoda.preston.cmd.CmdGet.run(CmdGet.java:69)
    at bio.guoda.preston.cmd.CmdGet.run(CmdGet.java:49)
    at bio.guoda.preston.cmd.CmdGet.run(CmdGet.java:44)
    at picocli.CommandLine.executeUserObject(CommandLine.java:1939)
    at picocli.CommandLine.access$1300(CommandLine.java:145)
    at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2358)
    at picocli.CommandLine$RunLast.handle(CommandLine.java:2352)
    at picocli.CommandLine$RunLast.handle(CommandLine.java:2314)
    at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179)
    at picocli.CommandLine$RunLast.execute(CommandLine.java:2316)
    at picocli.CommandLine.execute(CommandLine.java:2078)
    at bio.guoda.preston.Preston.run(Preston.java:91)
    at bio.guoda.preston.Preston.main(Preston.java:82)
Caused by: bio.guoda.preston.store.DereferenceException: failed to dereference [hash://sha256/98493caa8b37eaa26343bbf73f232597a3ccda20498563327a4c3713821df892]
    at bio.guoda.preston.store.AliasDereferencer.dereferenceAliasedHash(AliasDereferencer.java:94)
    at bio.guoda.preston.store.AliasDereferencer.get(AliasDereferencer.java:46)
    at bio.guoda.preston.store.AliasDereferencer.get(AliasDereferencer.java:18)
    at bio.guoda.preston.cmd.ContentQueryUtil.getContent(ContentQueryUtil.java:50)
    ... 14 more
Caused by: bio.guoda.preston.store.DereferenceException: failed to dereference [hash://sha256/98493caa8b37eaa26343bbf73f232597a3ccda20498563327a4c3713821df892]
    at bio.guoda.preston.store.ContentHashDereferencer.get(ContentHashDereferencer.java:25)
    at bio.guoda.preston.store.ContentHashDereferencer.get(ContentHashDereferencer.java:10)
    at bio.guoda.preston.store.AliasDereferencer.dereferenceAliasedHash(AliasDereferencer.java:92)
    ... 17 more
Caused by: java.io.IOException: failed to retrieve [<hash://sha256/98493caa8b37eaa26343bbf73f232597a3ccda20498563327a4c3713821df892>]
    at bio.guoda.preston.store.KeyValueStoreStickyFailover.get(KeyValueStoreStickyFailover.java:58)
    at bio.guoda.preston.store.KeyValueStoreStickyFailover.get(KeyValueStoreStickyFailover.java:13)
    at bio.guoda.preston.store.KeyValueStoreCopying.get(KeyValueStoreCopying.java:31)
    at bio.guoda.preston.store.KeyValueStoreCopying.get(KeyValueStoreCopying.java:8)
    at bio.guoda.preston.store.BlobStoreAppendOnly.get(BlobStoreAppendOnly.java:44)
    at bio.guoda.preston.store.BlobStoreAppendOnly.get(BlobStoreAppendOnly.java:11)
    at bio.guoda.preston.store.ContentHashDereferencer.get(ContentHashDereferencer.java:22)
    ... 19 more
Caused by: org.apache.http.client.HttpResponseException: status code: 401, reason phrase: [<https://dataone.org/preston-98.tar.gz>]Unauthorized
    at bio.guoda.preston.ResourcesHTTP.asInputStream(ResourcesHTTP.java:114)
    at bio.guoda.preston.ResourcesHTTP.asInputStream(ResourcesHTTP.java:69)
    at bio.guoda.preston.ResourcesHTTP.asInputStreamIgnore404(ResourcesHTTP.java:52)
    at bio.guoda.preston.cmd.Persisting.lambda$getDerefStreamHTTP$5(Persisting.java:236)
    at bio.guoda.preston.store.DereferencerContentAddressedTarGZ.get(DereferencerContentAddressedTarGZ.java:41)
    at bio.guoda.preston.store.DereferencerContentAddressedTarGZ.get(DereferencerContentAddressedTarGZ.java:13)
    at bio.guoda.preston.store.KeyValueStoreWithDereferencing.get(KeyValueStoreWithDereferencing.java:27)
    at bio.guoda.preston.store.KeyValueStoreWithDereferencing.get(KeyValueStoreWithDereferencing.java:11)
    at bio.guoda.preston.store.KeyValueStoreWithValidation.get(KeyValueStoreWithValidation.java:59)
    at bio.guoda.preston.store.KeyValueStoreWithValidation.get(KeyValueStoreWithValidation.java:14)
    at bio.guoda.preston.store.KeyValueStoreStickyFailover.get(KeyValueStoreStickyFailover.java:42)
    ... 25 more
java.lang.RuntimeException: java.io.IOException: problem retrieving [hash://sha256/98493caa8b37eaa26343bbf73f232597a3ccda20498563327a4c3713821df892]
    at bio.guoda.preston.cmd.CmdGet.run(CmdGet.java:52)
    at bio.guoda.preston.cmd.CmdGet.run(CmdGet.java:44)
    at picocli.CommandLine.executeUserObject(CommandLine.java:1939)
    at picocli.CommandLine.access$1300(CommandLine.java:145)
    at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2358)
    at picocli.CommandLine$RunLast.handle(CommandLine.java:2352)
    at picocli.CommandLine$RunLast.handle(CommandLine.java:2314)
    at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179)
    at picocli.CommandLine$RunLast.execute(CommandLine.java:2316)
    at picocli.CommandLine.execute(CommandLine.java:2078)
    at bio.guoda.preston.Preston.run(Preston.java:91)
    at bio.guoda.preston.Preston.main(Preston.java:82)
Caused by: java.io.IOException: problem retrieving [hash://sha256/98493caa8b37eaa26343bbf73f232597a3ccda20498563327a4c3713821df892]
    at bio.guoda.preston.cmd.ContentQueryUtil.getContent(ContentQueryUtil.java:58)
    at bio.guoda.preston.cmd.ContentQueryUtil.copyContent(ContentQueryUtil.java:32)
    at bio.guoda.preston.cmd.CmdGet.run(CmdGet.java:69)
    at bio.guoda.preston.cmd.CmdGet.run(CmdGet.java:49)
    ... 11 more
Caused by: bio.guoda.preston.store.DereferenceException: failed to dereference [hash://sha256/98493caa8b37eaa26343bbf73f232597a3ccda20498563327a4c3713821df892]
    at bio.guoda.preston.store.AliasDereferencer.dereferenceAliasedHash(AliasDereferencer.java:94)
    at bio.guoda.preston.store.AliasDereferencer.get(AliasDereferencer.java:46)
    at bio.guoda.preston.store.AliasDereferencer.get(AliasDereferencer.java:18)
    at bio.guoda.preston.cmd.ContentQueryUtil.getContent(ContentQueryUtil.java:50)
    ... 14 more
Caused by: bio.guoda.preston.store.DereferenceException: failed to dereference [hash://sha256/98493caa8b37eaa26343bbf73f232597a3ccda20498563327a4c3713821df892]
    at bio.guoda.preston.store.ContentHashDereferencer.get(ContentHashDereferencer.java:25)
    at bio.guoda.preston.store.ContentHashDereferencer.get(ContentHashDereferencer.java:10)
    at bio.guoda.preston.store.AliasDereferencer.dereferenceAliasedHash(AliasDereferencer.java:92)
    ... 17 more
Caused by: java.io.IOException: failed to retrieve [<hash://sha256/98493caa8b37eaa26343bbf73f232597a3ccda20498563327a4c3713821df892>]
    at bio.guoda.preston.store.KeyValueStoreStickyFailover.get(KeyValueStoreStickyFailover.java:58)
    at bio.guoda.preston.store.KeyValueStoreStickyFailover.get(KeyValueStoreStickyFailover.java:13)
    at bio.guoda.preston.store.KeyValueStoreCopying.get(KeyValueStoreCopying.java:31)
    at bio.guoda.preston.store.KeyValueStoreCopying.get(KeyValueStoreCopying.java:8)
    at bio.guoda.preston.store.BlobStoreAppendOnly.get(BlobStoreAppendOnly.java:44)
    at bio.guoda.preston.store.BlobStoreAppendOnly.get(BlobStoreAppendOnly.java:11)
    at bio.guoda.preston.store.ContentHashDereferencer.get(ContentHashDereferencer.java:22)
    ... 19 more
Caused by: org.apache.http.client.HttpResponseException: status code: 401, reason phrase: [<https://dataone.org/preston-98.tar.gz>]Unauthorized
    at bio.guoda.preston.ResourcesHTTP.asInputStream(ResourcesHTTP.java:114)
    at bio.guoda.preston.ResourcesHTTP.asInputStream(ResourcesHTTP.java:69)
    at bio.guoda.preston.ResourcesHTTP.asInputStreamIgnore404(ResourcesHTTP.java:52)
    at bio.guoda.preston.cmd.Persisting.lambda$getDerefStreamHTTP$5(Persisting.java:236)
    at bio.guoda.preston.store.DereferencerContentAddressedTarGZ.get(DereferencerContentAddressedTarGZ.java:41)
    at bio.guoda.preston.store.DereferencerContentAddressedTarGZ.get(DereferencerContentAddressedTarGZ.java:13)
    at bio.guoda.preston.store.KeyValueStoreWithDereferencing.get(KeyValueStoreWithDereferencing.java:27)
    at bio.guoda.preston.store.KeyValueStoreWithDereferencing.get(KeyValueStoreWithDereferencing.java:11)
    at bio.guoda.preston.store.KeyValueStoreWithValidation.get(KeyValueStoreWithValidation.java:59)
    at bio.guoda.preston.store.KeyValueStoreWithValidation.get(KeyValueStoreWithValidation.java:14)
    at bio.guoda.preston.store.KeyValueStoreStickyFailover.get(KeyValueStoreStickyFailover.java:42)