algokittens / algoNFTs

40 stars 17 forks source link

Pinata API Keys must be strings error even though they are #4

Closed dbchristenson closed 2 years ago

dbchristenson commented 2 years ago

{'error': {'reason': 'KEYS_MUST_BE_STRINGS', 'details': 'pinata_api_key and pinata_secret_api_key must both be strings'}} Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/runner/MesiSols/minting/mint.py", line 85, in mint ipfs_cid = meta['IpfsHash'] KeyError: 'IpfsHash'

Copied that specific section of the code and I'm getting error. Printed out the values of api_key and api_secret and they are both strings (denoted with single quotations ''). I'm using environment variables to protect my keys as, obviously, I do not want to show them. Any guidance?

Screen Shot 2021-12-09 at 10 00 55 PM
algokittens commented 2 years ago

What is the datatype of the api_key and api_secret? If you run type(api_key) does it return str?
And in which environment are they defined? If they are defined in mint_arc69.py instead of config_mint.py it might be reading the wrong key when running the script.

dbchristenson commented 2 years ago

Fixed the issue, yeah turns out I was turning it into a string twice so there was an extra set of quotations on the inside of the value which caused it to error out.