Skip to content

Out of memory on import with CORS issues. #2138

Open
@bph

Description

@bph
Collaborator

Trying to open the blueprint from the gallery theme-ally-test in Playground multiple errors occurred:

Error message: 'https://wpthemetestdata.files.wordpress.com/2008/06/dcp_2082.jpg' from origin 'https://playground.wordpress.net/' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

Error: Error when executing the blueprint step #3 ({"step":"importWxr","file":{"resource":"url","url":"https://github.com/WordPress/theme-test-data/blob/master/themeunittestdata.wordpress.xml"}}) : memory access out of bounds

To double-check on the import file, the content imported after a while into a new site in Studio locally.
It never got to the "All done" screen, but all 37 images, 23 pages and 57 posts made it into the site.

Activity

bgrgicak

bgrgicak commented on Feb 10, 2025

@bgrgicak
Collaborator

This is caused by the WP.com server not allowing CORS requests.

@brandonpayton do you maybe know what's the standard way of enabling CORS on WP.com sites like https://wpthemetestdata.wordpress.com/?

brandonpayton

brandonpayton commented on Feb 14, 2025

@brandonpayton
Member

@brandonpayton do you maybe know what's the standard way of enabling CORS on WP.com sites like https://wpthemetestdata.wordpress.com/?

@bgrgicak I don't know of a standard way to do this with a wpcom simple site. I would think we could use the CORS proxy to work around the CORS errors.

brandonpayton

brandonpayton commented on Feb 14, 2025

@brandonpayton
Member

I would think we could use the CORS proxy to work around the CORS errors.

@bgrgicak it turns out we are indeed asking the CORS proxy for the files and getting them. When I look in the dev tools Network tab for some of the CORS errors, I see requests like these that receive an image with a 200 response status.
https://wordpress-playground-cors-proxy.net/?https://wpthemetestdata.wordpress.com/wp-content/uploads/2014/01/dsc20050315_145007_132.jpg

So it seems like the CORS errors might be a red herring.

brandonpayton

brandonpayton commented on Feb 15, 2025

@brandonpayton
Member

It turns out that, after @bgrgicak's work on "Move DNS polyfills to a PHP extension and add missing constants", there is no more memory-access-out-of-bounds-error. That is interesting. 🤔 I wonder what might have been going wrong before.

@adamziel, this is an interesting thing to know about.

adamziel

adamziel commented on Feb 19, 2025

@adamziel
Collaborator

Oh huh, interesting. I wonder whether the problem was about the DNS implementation OR if the DNS work shifted the memory layout in some way that will make the issue pop up in another place. Since it was a CORS-related problem, I'm happy with assuming it was the former and closing this issue. Let's keep an eye out for related problems, though.

brandonpayton

brandonpayton commented on Mar 26, 2025

@brandonpayton
Member

I'm going to reopen this for now because merging the DNS implementation change hasn't landed yet in #2165. There are some CI failures I need to look into. When that PR lands, it is marked to close this issue again automatically.

adamziel

adamziel commented on Jun 13, 2025

@adamziel
Collaborator
brandonpayton

brandonpayton commented on Jun 19, 2025

@brandonpayton
Member

I'll grab this one. Thanks for reopening, @adamziel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

Projects

Milestone

No milestone

Relationships

None yet

    Development

    Participants

    @bph@adamziel@brandonpayton@bgrgicak

    Issue actions

      Out of memory on import with CORS issues. · Issue #2138 · WordPress/wordpress-playground