Error on update stream

Hi

We sign wallet with session but when we want to create new record it have error

failed with status ‘Internal Server Error’: {“error”:“Can not verify signature for commit bagcqcerarm5eeixyinf5uf2mduolls3baff7xkkyfhe6gwsr4ikez3rcg6la to stream kjzl6kcym7w8y7keucdn6yar85pjva7lb1xznhb8xmpylo9bhjml2qucjys79p1 which has controller DID did:pkh:eip155:1:0x352210b300c46f4d18f211fc49c8bcf1cdb7f5cf: Capability does not have appropriate permissions to update this Stream”}

Hi @ehsan - happy to help you out with this.

When you have a moment, could you please confirm whether you’re using the same account that created the stream to perform the update? Would you also please let me know which network you’re using (Clay, mainnet, or local) so I can try to find it on my end?

Alternatively, I’m happy to take a look at any codebase you’re working in directly to see if I can easily spot the issue.

Thanks so much

Hi @ehsan. I was able to load that stream on the clay testnet via Cerscan: https://cerscan.com/testnet-clay/stream/kjzl6kcym7w8y7keucdn6yar85pjva7lb1xznhb8xmpylo9bhjml2qucjys79p1. From there I can see that the Model that that stream belongs to is kjzl6hvfrbw6c6x5kmbzwcim02kfk96z6808wb0c7k5eu8f8k8n6gw4xgekilj4.

When I load the commit that is failing to apply from IPFS and extract the CACAO capability that was used when authoring the commit, I see it looks like:

{
  "h": {
    "t": "eip4361"
  },
  "p": {
    "aud": "did:key:z6MktrycCYutTPYzxidgrnKKfg15175WosniQowDLyCFCAMm",
    "domain": "snp.allostasis.io",
    "exp": "2024-12-09T07:23:31.670Z",
    "iat": "2024-12-02T07:23:31.670Z",
    "iss": "did:pkh:eip155:1:0x352210b300c46f4d18f211fc49c8bcf1cdb7f5cf",
    "nonce": "C3zx37yC82",
    "resources": [
      "ceramic://*?model=kjzl6hvfrbw6c5ngupbx13ojeqsqn1mhuwfk9y4963cyamyds15ycw7zin0yqk9",
      "ceramic://*?model=kjzl6hvfrbw6c5cizf0c58929q6p46isu6ojvubsxisux0tqvjiuzbvozr50uwb",
      "ceramic://*?model=kjzl6hvfrbw6ca5oi4t1dhke6k5mnsa7tbktnm64svfo1jm0qsr4y2agzl1d8ml",
      "ceramic://*?model=kjzl6hvfrbw6cb405hhtrqsyuvy15eqyrwq0rfg22iip7g3y6m77j3644ybu12n",
      "ceramic://*?model=kjzl6hvfrbw6c7bsz17952tjw1rotx2yq7kq4g4w3pvad1zuipyv6iaojws8e3e",
      "ceramic://*?model=kjzl6hvfrbw6c76xwkvuh26mkg32nc4o586meig0juudksvi2c8g3681kysxvdg",
      "ceramic://*?model=kjzl6hvfrbw6c5jluvz7xh8p7muqrgnon00or743bisdcc0dkezcy3hht72b05p",
      "ceramic://*?model=kjzl6hvfrbw6c79t2xki7lr0rhf2qm0wnqd9a417rzseezawhwqy5jd9ehm6pws",
      "ceramic://*?model=kjzl6hvfrbw6c8b8e764828ah90rsz38we7egdfku8ktw7bwhmc37nevx5dhw2o",
      "ceramic://*?model=kjzl6hvfrbw6c9yfs200lfe6vyo6u9dp09642bftml8wko4etqt0m9yknlw50jm",
      "ceramic://*?model=kjzl6hvfrbw6c98x050hyy31up5f4eb0sc545ysjlseq7q4h3zbz2er00ukczi8",
      "ceramic://*?model=kjzl6hvfrbw6c8gtyrtei0jz0y3kdmkfe3germjyo6vr87cxnhqbd31o2ci9pzz",
      "ceramic://*?model=kjzl6hvfrbw6c7go4qovynjoqgz72o7qn8iy5il7jd3pe0nx92k02vejkuclpht"
    ],
    "statement": "Give this application access to some of your data on Ceramic",
    "version": "1"
  },
  "s": {
    "s": "0xaa2f8f141a8935adb6cd6a6682c5852dd814ca15c8abf80f11a39b0cfc42ab592fc780af1c202be6e5c94c539ed18163fec61bc9485d84f3f4726ad20f5d79021c",
    "t": "eip191"
  }
}

Notice the resources array in the capability and that it does not include the Model that this stream belongs to. So it looks like the capability used to sign into the app isn’t granting access to the stream you are trying to update. You should make sure that the sign-in flow for your app using did-session is granting access to all the Models that your app uses.

Hope that helps, please let us know if you have any further issues!

1 Like