[BUG] Importing configuration files gives always error in Strapi 4.3.4.
See original GitHub issueBug 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.
Moving to the content manager, we get two behaviours:
- The configuration settings were properly loaded.
- The admin user lost all the permission and cannot see anything.
Steps to reproduce the behavior
- Go to Content Manager.
- Click on Config Syng > Tools.
- Select all the files you want to import.
- Import them.
- See the toast error.
- Go to Console.
- Check the error.
- Go to Network.
- 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:
- Created a year ago
- Comments:35 (16 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Great! Thanks for debugging. I can work with this.
OK. Then I think we can close this issue as we are not able to reproduce it and nobody reported the same issue. Thanks.