Link sharing using DNS shows Object not found

I tried following the guide to ‘host a website on storj’. I made it share the whole bucket ‘main’ (I intend to host just files that are publicly available). When I open the site in browser, I get “Object not found” (even if I directly copy paste the file name from the bucket viewer). My intended use case is to use the s3 gateway to upload files to storj and then embed those files on my sites. I already implemented file uploading in nodejs, but I can’t get a working link that I could embed.

I’m using cloudflare for DNS:

Disabling proxy didn’t help and just resulted in SSL errors.

Can you verify that you can download the object using uplink? List the files recursively in the bucket and see whether the keys match what you would expect.

One common mistake is to use /index.html instead of index.html. Storj and S3 both use object keys rather than paths.

So I experimented a bit during the meantime.

I can see only the encrypted file names in uplink ls sj://main (even if I try to use the access key the S3 credentials were generated from), but I can see the files in the browser just fine.

I uploaded the files using AWS SDK for node, but using the same credentials for retrieval doesn’t work (it says noSuchKey, but the files do exist in browser and I give the exact same Key as with upload).

The files are all simply named <number>.<extension>, and they’re all PNG images (but I plan to add other image file types too). Example file name 6792420715330146304.png in bucket main. Trying to access it using the custom DNS would show “Object not found”, and using the S3 gateway using AWS SDK for node throws error “KeyNotFound”.

1 Like

Ah, maybe you got access grants or pass phrases mixed up.

It’s possible to have multiple access grants with different encryption keys in the same bucket. This means that the encrypted object names wouldn’t match and you get a “object not found” error.