strapi / strapi

🚀 Strapi is the leading open-source headless CMS. It’s 100% JavaScript/TypeScript, fully customizable and developer-first.
https://strapi.io
Other
62.9k stars 7.9k forks source link

MediaLibrary error after upgrading to 3.3.0 #8603

Closed dappiu closed 3 years ago

dappiu commented 3 years ago

Just upgraded to 3.3.0 from 3.2.5. Everything seem to work, except Media Library. Opening it from the admin UI generates an error. My provider is strapi-provider-upload-aws-s3.

Node v12.18.2 npm v6.14.5 PostgreSQL 12

Here is the error:

2020-11-09T18:00:42: [2020-11-09T18:00:42.263Z] debug GET /upload/files/count? (26 ms) 200
2020-11-09T18:00:42: [2020-11-09T18:00:42.268Z] error TypeError: Target.query is not a function
    at app/node_modules/bookshelf/lib/eager.js:62:23
    at app/node_modules/bookshelf/node_modules/lodash/lodash.js:3543:27
    at app/node_modules/bookshelf/node_modules/lodash/lodash.js:4925:15
    at baseForOwn (app/node_modules/bookshelf/node_modules/lodash/lodash.js:2990:24)
    at app/node_modules/bookshelf/node_modules/lodash/lodash.js:4894:18
    at baseMap (app/node_modules/bookshelf/node_modules/lodash/lodash.js:3542:7)
    at Function.map (app/node_modules/bookshelf/node_modules/lodash/lodash.js:9580:14)
    at EagerRelation.morphToFetch (app/node_modules/bookshelf/lib/eager.js:56:9)
    at EagerRelation.eagerFetch (app/node_modules/bookshelf/lib/eager.js:25:19)
    at EagerRelation.<anonymous> (app/node_modules/bookshelf/lib/base/eager.js:67:14)
From previous event:
    at app/node_modules/bookshelf/lib/eager.js:96:73
From previous event:
    at EagerRelation._eagerLoadHelper (app/node_modules/bookshelf/lib/eager.js:83:23)
    at Sync.<anonymous> (app/node_modules/bookshelf/lib/eager.js:31:31)
From previous event:
    at EagerRelation.eagerFetch (app/node_modules/bookshelf/lib/eager.js:31:8)
    at EagerRelation.<anonymous> (app/node_modules/bookshelf/lib/base/eager.js:67:14)
From previous event:
    at Child._handleEager (app/node_modules/bookshelf/lib/collection.js:527:73)
    at Child.<anonymous> (app/node_modules/bookshelf/lib/collection.js:179:27)
    at processImmediate (internal/timers.js:456:21)
    at process.topLevelDomainCallback (domain.js:137:15)
From previous event:
    at Child.<anonymous> (app/node_modules/bookshelf/lib/collection.js:177:12)
From previous event:
    at Child.fetchAll (app/node_modules/bookshelf/lib/model.js:878:10)
    at Object.find (app/node_modules/strapi-connector-bookshelf/lib/queries.js:66:8)
    at fn (app/node_modules/strapi-database/lib/queries/helpers.js:31:54)
    at Object.find (app/node_modules/strapi-database/lib/queries/helpers.js:15:24)
    at async find (app/node_modules/strapi-plugin-upload/controllers/upload/admin.js:39:19)
    at async app/node_modules/strapi/lib/middlewares/router/utils/routerChecker.js:79:22
2020-11-09T18:00:42: [2020-11-09T18:00:42.269Z] debug GET /upload/files?_limit=10&_start=0&_sort=updated_at:DESC (35 ms) 500

EDIT: Pardon me, I added the line before and after the error exposing the successful /upload/count before the failed /upload/files.

derrickmehaffy commented 3 years ago

@dappiu can you provide your package.json please?

dappiu commented 3 years ago

yarn.lock here if needed

{
  "name": "app",
  "version": "0.1.0",
  "license": "UNLICENSED",
  "private": true,
  "scripts": {
    "develop": "strapi develop",
    "start": "strapi start",
    "build": "strapi build",
    "strapi": "strapi",
    "lint:js": "eslint --ext .js --ignore-path .gitignore .",
    "lint": "yarn lint:js"
  },
  "dependencies": {
    "@sendgrid/client": "^7.4.0",
    "@sendgrid/mail": "^7.4.0",
    "dinero.js": "^1.8.1",
    "knex": "<0.20.0",
    "pg": "latest",
    "strapi": "3.3.0",
    "strapi-admin": "3.3.0",
    "strapi-connector-bookshelf": "3.3.0",
    "strapi-plugin-content-manager": "3.3.0",
    "strapi-plugin-content-type-builder": "3.3.0",
    "strapi-plugin-email": "3.3.0",
    "strapi-plugin-upload": "3.3.0",
    "strapi-plugin-users-permissions": "3.3.0",
    "strapi-provider-email-nodemailer": "^3.0.0",
    "strapi-provider-upload-aws-s3": "3.3.0",
    "strapi-utils": "3.3.0",
    "stripe": "^8.121.0"
  },
  "devDependencies": {
    "babel-eslint": "^10.1.0",
    "eslint": "^7.13.0",
    "eslint-config-prettier": "^6.15.0",
    "eslint-plugin-prettier": "^3.1.4",
    "prettier": "^2.1.2"
  },
  "strapi": {
    "uuid": "9e5c67ac-b6cf-445c-81f4-421cec03ab1c"
  },
  "engines": {
    "node": ">=10.16.0 <=14.x.x",
    "npm": ">=6.0.0"
  }
}
derrickmehaffy commented 3 years ago

@dappiu I am not able to reproduce locally using an AWS-S3 bucket. Can you please try purging your:

And reinstalling / rebuilding the admin panel / restarting the server

alexandrebodin commented 3 years ago

Hi fixed in https://github.com/strapi/strapi/releases/tag/v3.3.1 sorry for the issue...