PinataCloud / pinata

The new Pinata SDK
https://docs.pinata.cloud/sdk
MIT License
3 stars 2 forks source link

Error Pulling via IPFS Hash #12

Closed BHouwens closed 1 week ago

BHouwens commented 3 weeks ago

I'm currently getting an error when attempting to pull pinned data via IPFS hash. Pinning via pinata.upload.file(file) returns the following successfully:

IPFS response {
  IpfsHash: 'bafkreiaczqcwqlqoq6u56def6ds2rst4ac2wmlw47lcjjasmptecc22o24',
  PinSize: 40,
  Timestamp: '2024-08-20T12:44:41.525Z',
  isDuplicate: true
}

When pulling with pinata.gateways.get("bafkreiaczqcwqlqoq6u56def6ds2rst4ac2wmlw47lcjjasmptecc22o24") I get the following error:

Unexpected token 'T', "This conte"... is not valid JSON
stevedylandev commented 3 weeks ago

Hey there! Do you happen to have a gateway access control enabled on your gateway? If you are only going to be fetching content from your account they aren't necessary and could be removed

stevedylandev commented 3 weeks ago

@BHouwens I just pushed a patch in v.0.3.4 that should provide better error messaging if checking access controls doesn't work.

BHouwens commented 3 weeks ago

Hey there! Do you happen to have a gateway access control enabled on your gateway? If you are only going to be fetching content from your account they aren't necessary and could be removed

I'm using the default gateway settings, I'll take a look and see if there's something I can do in terms of controls to improve. I'm guessing it might just be a pin error but I'll come back with feedback once I've tested

stevedylandev commented 3 weeks ago

Sounds good! If you have some steps we can take to reproduce that would be helpful. I pinned that file to my own account and was able to use the gateway method so not sure what the error could be from.

stevedylandev commented 1 week ago

Hey @BHouwens! Wanted to check in and see see if you were still having this issue? If so I'd like to move it to our pinata-web repo where it continues to use IPFS