ceramicnetwork / ceramicnetwork/js-ceramic
ERROR: Error: Invalid 'model' metadata property in Model stream
- Dominant language
- TypeScript
- Stars
- 423
- Forks
- 126
- PR merge metrics
- No merged PRs in 30d
Description
**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`

### 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
``` 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

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.:
``` json
"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
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with packages/stream-model-handler/src/model-handler.ts at line 126 and reproduce the ModelInstanceDocument.create failure using the model IDs and daemon.config.json examples. Trace how model metadata and configured model streams are validated, including both configuration orders and the reported insecure-hash error. Done means the reported model configurations no longer fail without disabling the validation line.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100