Skip to content

Out of memory on import with CORS issues. #2138

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
bph opened this issue Feb 7, 2025 · 6 comments · May be fixed by #2165
Closed

Out of memory on import with CORS issues. #2138

bph opened this issue Feb 7, 2025 · 6 comments · May be fixed by #2165

Comments

@bph
Copy link
Collaborator

bph commented Feb 7, 2025

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.

@bgrgicak
Copy link
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
Copy link
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
Copy link
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
Copy link
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
Copy link
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
Copy link
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.

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

Successfully merging a pull request may close this issue.

4 participants