Skip to content

Relations upload_folders does not exist happening after updating Strapi #14038

@jsanta

Description

@jsanta

Bug report

Required System information

  • Node.js version: 16.15.1
  • NPM version: 8.11.0
  • Strapi version: 4.3.2
  • Database: Postgres 12.11, 14.2
  • Operating system: Ubuntu Linux 20.04, MacOS Catalina

Describe the bug

Updated Strapi version from 4.2.0 to 4.3.2, just changed this entries in the package.json file :

"@strapi/plugin-i18n": "4.3.2",
"@strapi/plugin-users-permissions": "4.3.2",
"@strapi/strapi": "4.3.2",

Installed the packages using yarn install, and rebuilt the Strapi admin panel using yarn strapi build
After a while running the server and navigating in the Content Manager started to get this error message:

This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
error: select LENGTH(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE("path", $1, $2), $3, $4), $5, $6), $7, $8), $9, $10), $11, $12), $13, $14), $15, $16), $17, $18), $19, $20)) AS depth, COUNT(*) AS occurence from "upload_folders" group by "depth" - relation "upload_folders" does not exist
    at Parser.parseErrorMessage (/opt/queplan/apps/strapi.new/node_modules/pg-protocol/dist/parser.js:287:98)
    at Parser.handlePacket (/opt/queplan/apps/strapi.new/node_modules/pg-protocol/dist/parser.js:126:29)
    at Parser.parse (/opt/queplan/apps/strapi.new/node_modules/pg-protocol/dist/parser.js:39:38)
    at TLSSocket.<anonymous> (/opt/queplan/apps/strapi.new/node_modules/pg-protocol/dist/index.js:11:42)
    at TLSSocket.emit (node:events:527:28)
    at TLSSocket.emit (node:domain:475:12)
    at addChunk (node:internal/streams/readable:315:12)
    at readableAddChunk (node:internal/streams/readable:289:9)
    at TLSSocket.Readable.push (node:internal/streams/readable:228:10)
    at TLSWrap.onStreamRead (node:internal/stream_base_commons:190:23)

Checked the database tables and the upload_folders table does exist.

Steps to reproduce the behavior

Sorry about not having the precise steps, it happens after a while when navigating inside the Content Manager.

Expected behavior

  • No errors are expected due to the database already seem to have all the required relations.
  • Double checking the existing database relations before sending an error.
  • A more explicit error message in order to be able to look for a workaround.

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue: bugIssue reporting a bugseverity: lowIf the issue only affects a very niche base of users and an easily implemented workaround can solvesource: core:uploadSource is core/upload packagestatus: confirmedConfirmed by a Strapi Team member or multiple community members

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions