System Information
-
Strapi Version: 3.6.8
-
Operating System: Linux
-
Database: MongoDB
-
Node Version: 16.11.1
-
NPM Version: 7.22.0
I upgraded from a previous version of Strapi (I’m not sure which one) to 3.6.8, and then executed npm run build -- --clean
, however when I try to start Strapi, I now get the following error:
$ npm start
> ibgs@0.1.0 start
> strapi start
[2021-10-17T22:55:36.339Z] debug ⛔️ Server wasn't able to start properly.
[2021-10-17T22:55:36.341Z] error Error: The model `File`, used in the attribute `archivo` in the model Paginas.archivo, is missing from the (plugin - upload) models
at Object.getNature (/path/to/strapi/node_modules/strapi-utils/lib/models.js:131:15)
at buildRelation (/path/to/strapi/node_modules/strapi-connector-mongoose/lib/mount-models.js:431:17)
at /path/to/strapi/node_modules/strapi-connector-mongoose/lib/mount-models.js:121:7
at Array.forEach (<anonymous>)
at mountModel (/path/to/strapi/node_modules/strapi-connector-mongoose/lib/mount-models.js:120:26)
at Array.forEach (<anonymous>)
at module.exports (/path/to/strapi/node_modules/strapi-connector-mongoose/lib/mount-models.js:341:23)
at mountComponents (/path/to/strapi/node_modules/strapi-connector-mongoose/lib/index.js:168:12)
at /path/to/strapi/node_modules/strapi-connector-mongoose/lib/index.js:152:9
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Promise.all (index 0)
at async Object.initialize (/path/to/strapi/node_modules/strapi-database/lib/connector-registry.js:30:9)
at async DatabaseManager.initialize (/path/to/strapi/node_modules/strapi-database/lib/database-manager.js:43:5)
at async Strapi.load (/path/to/strapi/node_modules/strapi/lib/Strapi.js:354:5)
at async Strapi.start (/path/to/strapi/node_modules/strapi/lib/Strapi.js:196:9)
I tried removing all of the file sections from all of the models’ json files and I was able to get Strapi to start, but when I try to add these fields back through the web interface to see what would happen and then click “Save”, it reloads Strapi, but no changes are made, and no errors are outputted to the console (either the command line or the browser’s console). The model’s json file is not modified either.
Any ideas on how I can get the File model in the plugin - upload model?
I realized that Node 16 isn’t yet supported, so I downgraded to Node 14, but I still have the same issue.
Is your source code somewhere public that I can look at? I find it odd that it’s referencing File
instead of file
.
In your package.json I see you are using carots ^
in front of all the Strapi packages.
"strapi": "^3.6.8",
Can you remove those, delete your node_modules
and package-lock.json
and reinstall them to see if that changes anything?
Thank you for your reply. I tried that and still get the same error.
Also, I forgot to mention it, but the files that cause error end with a ~
suffix in the file name. For example, components/pagina/archivo.json~
. The un-suffixed ones are the ones where the file references have been removed.
Hey @multiwebinc, did you manage to get that error fixed? I am getting the same error.
I updated Node from 14 to 16, then I realized that strapi 3 doesn’t support node 16. I downgraded node to 14 and now am getting the following error:
error Error: The model `File`, used in the attribute `media` in the model Branding.media, is missing from the (plugin - upload) models
at Object.getNature (/path/to/strapi/node_modules/strapi-utils/lib/models.js:131:15)
at buildRelation (/path/to/strapi/node_modules/strapi-connector-mongoose/lib/mount-models.js:431:17)
at /path/to/strapi/node_modules/strapi-connector-mongoose/lib/mount-models.js:121:7
at Array.forEach (<anonymous>)
at mountModel (/path/to/strapi/node_modules/strapi-connector-mongoose/lib/mount-models.js:120:26)
at Array.forEach (<anonymous>)
at module.exports (/path/to/strapi/node_modules/strapi-connector-mongoose/lib/mount-models.js:341:23)
at mountComponents (/path/to/strapi/node_modules/strapi-connector-mongoose/lib/index.js:168:12)
at /path/to/strapi/node_modules/strapi-connector-mongoose/lib/index.js:152:9
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async Promise.all (index 0)
at async Object.initialize (/path/to/strapi/node_modules/strapi-database/lib/connector-registry.js:30:9)
at async DatabaseManager.initialize (/path/to/strapi/node_modules/strapi-database/lib/database-manager.js:43:5)
at async Strapi.load (/path/to/strapi/node_modules/strapi/lib/Strapi.js:354:5)
at async Strapi.start (/path/to/strapi/node_modules/strapi/lib/Strapi.js:196:9)
error Command failed with exit code 1.
I have also upgraded Strapi from 3.5.3 to 3.6.8. My package.json dependencies:
"dependencies": {
"bad-words": "^3.0.4",
"knex": "<0.20.0",
"moment": "^2.29.1",
"sqlite3": "latest",
"strapi": "3.6.8",
"strapi-admin": "3.6.8",
"strapi-connector-bookshelf": "3.6.8",
"strapi-connector-mongoose": "3.6.8",
"strapi-plugin-content-manager": "3.6.8",
"strapi-plugin-content-type-builder": "3.6.8",
"strapi-plugin-email": "3.6.8",
"strapi-plugin-upload": "3.6.8",
"strapi-plugin-users-permissions": "3.6.8",
"strapi-provider-email-smtp": "^1.0.1",
"strapi-provider-upload-cloudinary": "^3.6.8",
"strapi-utils": "3.6.8"
},
I have fixed that error by updating the knex peer depency from <0.20.0 to 0.21.18
After that I deleted node_modules folder and reinstalled everything by running yarn install.
i am facing the same problem
error Error: The model File
, used in the attribute logo
in the model Order-items.order-items, is missing from the (plugin - upload) models
have you find the solution?