Skip to content

Unable to set a custom logo with enterprise version #13762

@fingeg

Description

@fingeg

Bug report

When trying to save the settings page after uploading a custom logo, the admin console simply gives a popup with Warning: An error occurred and the logo did not get updated, there are no error messages in either the browser of the strapi console, but a failed POST request. More details are below.

Required System information

  • Node.js version: 16.13.0
  • NPM version: 8.1.0
  • Strapi version: 4.3.0-beta.2 (enterprise)
  • Database: PostgreSQL
  • Operating system: Ubuntu

Describe the bug

There are no error messages in either the browser or the strapi console, but a failed post request to /admin/project-settings.
I could trace back the error to the following lines:

await validateUpdateProjectSettingsImagesDimensions(formatedFiles);

and then within that function
return schema.validateSync(body, optionsWithDefaults);

but don't really understand why it's not working.

The message in the response of the post request is:

message: "menuLogo  must be a `object` type, but the final value was: `{\n  \"width\":  \"750\",\n  \"height\": \"750\",\n  \"stream\": {\n    \"fd\":  \"null\",\n    \"path\":  \"\\\"/tmp/upload_bd0982d854ebbc0e8f17d9d5af241704\\\"\",\n     \"flags\": \"\\\"r\\\"\",\n    \"mode\": \"438\",\n    \"start\":  \"undefined\",\n    \"end\": \"Infinity\",\n    \"pos\":  \"undefined\",\n    \"bytesRead\": \"0\",\n    \"closed\": \"false\",\n     \"_readableState\": {\n      \"objectMode\": \"false\",\n       \"highWaterMark\": \"65…loseEmitted\": \"false\",\n       \"defaultEncoding\": \"\\\"utf8\\\"\",\n      \"awaitDrainWriters\":  \"null\",\n      \"multiAwaitDrain\": \"false\",\n      \"readingMore\":  \"false\",\n      \"dataEmitted\": \"false\",\n      \"decoder\":  \"null\",\n      \"encoding\": \"null\"\n    },\n    \"_events\": {},\n     \"_eventsCount\": \"1\",\n    \"_maxListeners\": \"undefined\"\n   },\n  \"tmpPath\":  \"\\\"/tmp/upload_bd0982d854ebbc0e8f17d9d5af241704\\\"\",\n   \"provider\": \"\\\"restricted-access\\\"\"\n}`.

as you can see in the error message, I'm using a custom provider, but tried the same thing with default local provider and that did not work either.

Thanks in advance

Steps to reproduce the behavior

  1. Go to 'settings'
  2. Upload a custom logo
  3. click save
  4. See the error message on the website

Expected behavior

Just save the page and update the logo everywhere

Metadata

Metadata

Labels

issue: bugIssue reporting a bugseverity: mediumIf it breaks the basic use of the product but can be worked aroundsource: core:adminSource is core/admin 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