js-ceramic icon indicating copy to clipboard operation
js-ceramic copied to clipboard

ERROR: Error: Invalid 'model' metadata property in Model stream

Open lyd0 opened this issue 3 years ago • 2 comments

Describe the bug

1

When I call the ModelInstanceDocument.create method , The server reported an error : ERROR: Error: Invalid 'model' metadata property in Model stream: kh4q0kq8h3j3zb52p8gjcayuwrdpt

27c7f6961342920aa41f4e49f638047

2

But apparently the string kh4q0kq8h3j3zb52p8gjcayuwrdpt doesn't match my model stream id (kjzl6hvfrbw6c59v2kgsss471xbd0wzl2pvy6pj22mcxrkxuzz85vnfbjohw1yo)

Then I added this id to the configuration file: daemon.config.json

  "indexing": {
    "db": "postgres://",
    "allow-queries-before-historical-sync": true,
    "models": [
            "kjzl6hvfrbw6c59v2kgsss471xbd0wzl2pvy6pj22mcxrkxuzz85vnfbjohw1yo",
            "kh4q0kq8h3j3zb52p8gjcayuwrdpt"
    ]

The problem is not solved at this time

3

Then I modified the source code and it works fine

d0bcaa80fa38e4cdbca82e7463905bd disable this line: https://github.com/ceramicnetwork/js-ceramic/blob/develop/packages/stream-model-handler/src/model-handler.ts#L126

Ceramic versions 2.5.0 and 2.5.0-rc.0 and 2.5.0-rc.1

Machine, OS, browser information (please complete the following information): ubuntu

Additional context

If I change the order of the models in the configuration file ,eg.:

  "indexing": {
    "db": "postgres://",
    "allow-queries-before-historical-sync": true,
    "models": [
            "kh4q0kq8h3j3zb52p8gjcayuwrdpt",
            "kjzl6hvfrbw6c59v2kgsss471xbd0wzl2pvy6pj22mcxrkxuzz85vnfbjohw1yo"
    ]

The server report ERROR: Error while loading commit CID bafyxccyabfug233emvwc25rr from IPFS for stream kh4q0kq8h3j3zb52p8gjcayuwrdpt:HTTPError: potentially insecure hash functions not allowed
Even modifying the source code won't fix it

lyd0 avatar Aug 09 '22 11:08 lyd0

@ukstv @pawartur hello can you help me

lyd0 avatar Aug 10 '22 05:08 lyd0

Sorry, these libraries aren't really ready to use yet and may have bugs or rough edges.

That error is from a mismatch between the client and server libraries. Make sure both your server (@ceramicnetwork/cli) and client (@ceramicnetwork/http-client, @ceramicnetwork/stream-model, and @ceramic/stream-model-instance) packages are all on the most recent RC version, and then re-create all your Models and ModelInstanceDocuments and that should resolve things

stbrody avatar Aug 10 '22 21:08 stbrody