question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Importing configuration files gives always error in Strapi 4.3.4.

See original GitHub issue

Bug report

Describe the bug

Every time we try to import the configuration for our models we get an error toast, looking on the console we get this error:

XHRPOSThttp://localhost:1337/config-sync/import
[HTTP/1.1 500 Internal Server Error 2477ms]

	
POST
	http://localhost:1337/config-sync/import
Status
500
Internal Server Error
VersionHTTP/1.1
Transferred1.11 kB (99 B size)
Referrer Policyno-referrer
Request PriorityHighest

    	
    Access-Control-Allow-Credentials
    	true
    Access-Control-Allow-Origin
    	http://localhost:1337
    Connection
    	keep-alive
    Content-Length
    	99
    Content-Security-Policy
    	connect-src 'self' https:;script-src 'self' editor.unlayer.com;frame-src 'self' editor.unlayer.com;img-src 'self' data: blob: cdn.jsdelivr.net strapi.io dl.airtable.com res.cloudinary.com;media-src 'self' data: blob: dl.airtable.com res.cloudinary.com;default-src 'self';base-uri 'self';block-all-mixed-content;font-src 'self' https: data:;frame-ancestors 'self';object-src 'none';script-src-attr 'none';style-src 'self' https: 'unsafe-inline'
    Content-Type
    	application/json; charset=utf-8
    Date
    	Mon, 15 Aug 2022 15:55:44 GMT
    Expect-CT
    	max-age=0
    Keep-Alive
    	timeout=5
    Referrer-Policy
    	no-referrer
    Strict-Transport-Security
    	max-age=31536000; includeSubDomains
    Vary
    	Origin
    X-Content-Type-Options
    	nosniff
    X-DNS-Prefetch-Control
    	off
    X-Download-Options
    	noopen
    X-Frame-Options
    	SAMEORIGIN
    X-Permitted-Cross-Domain-Policies
    	none
    	
    Accept
    	*/*
    Accept-Encoding
    	gzip, deflate, br
    Accept-Language
    	en-GB,tr;q=0.8,es;q=0.5,en;q=0.3
    Authorization
    	Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwiaWF0IjoxNjYwNTc4ODgyLCJleHAiOjE2NjMxNzA4ODJ9.W6jgkZ3Ow0b3D-LynqtxQe08YpCB2-Sj9Om0mrav1IU
    Connection
    	keep-alive
    Content-Length
    	2790
    Content-Type
    	application/json
    Host
    	localhost:1337
    Origin
    	http://localhost:1337
    Sec-Fetch-Dest
    	empty
    Sec-Fetch-Mode
    	cors
    Sec-Fetch-Site
    	same-origin
    User-Agent
    	Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:103.0) Gecko/20100101 Firefox/103.0

And going to the network, we can see this. Screen Shot 2022-08-15 at 19 00 13

Moving to the content manager, we get two behaviours:

  1. The configuration settings were properly loaded.
  2. The admin user lost all the permission and cannot see anything.

Steps to reproduce the behavior

  1. Go to Content Manager.
  2. Click on Config Syng > Tools.
  3. Select all the files you want to import.
  4. Import them.
  5. See the toast error.
  6. Go to Console.
  7. Check the error.
  8. Go to Network.
  9. Check the error.

Expected behavior

It shouldn’t give an error at importing.

Screenshots

If applicable, add screenshots to help explain your problem.

Code snippets

If applicable, add code samples to help explain your problem.

System

  • Node.js version: v14.20.0
  • Strapi version: 4.3.4
  • Plugin version: 2.0.8
  • Database: PostgreSQL 13.7
  • Operating system: Alpine Linux v3.16

Additional context

It is always a clean installation with a empty database.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:35 (16 by maintainers)

github_iconTop GitHub Comments

2reactions
boazpoolmancommented, Aug 17, 2022

Great! Thanks for debugging. I can work with this.

1reaction
boazpoolmancommented, Dec 1, 2022

OK. Then I think we can close this issue as we are not able to reproduce it and nobody reported the same issue. Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Strapi 3.6.5 breaks after importing configuration files. #15
Strapi 3.6.5 breaks after importing configuration files. #15 ... After importing settings, we found bugs like the next: TypeError: Cannot read property ......
Read more >
Troubleshooting - Strapi Developer Docs
Strapi stores model configuration files (what defines the model schema) in files such as ./src/api/restaurant/content-types/restaurant/schema.
Read more >
Error handling - Strapi Developer Docs
These error classes are imported through the @strapi/utils package and can be called from several different layers. The following examples use ...
Read more >
Changelog - Strapi
Strapi gives developers the freedom to use their favorite tools and frameworks while allowing editors to easily manage their content and distribute it ......
Read more >
How to create an import content plugin (part 3/4) - Strapi
For the last function, we want to see if a “url” contains any sort of media or not. Append the following code to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found