Skip to content
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

An old blueprint.json fails to load, no error #1543

Closed
vyskoczilova opened this issue Jun 26, 2024 · 6 comments · Fixed by #1569
Closed

An old blueprint.json fails to load, no error #1543

vyskoczilova opened this issue Jun 26, 2024 · 6 comments · Fixed by #1569
Labels
[Package][@wp-playground] Blueprints [Type] Bug An existing feature does not function as intended

Comments

@vyskoczilova
Copy link

If you go here and click on "Live Preview", you'll get a broken playground. I have no idea why; I haven't changed anything since I launched it - any thoughts? Are there breaking changes that we need to watch? Thanks thousand times!

https://wordpress.org/plugins/woocommerce-pay-for-payment/

If I go here with the blueprint.json, I get this:

Error: Error when executing the blueprint step #0 ({"step":"importWordPressFiles","wordPressFilesZip":{"resource":"url","url":"https://kybernaut.cz/blueprints/pay-for-payment-playground.zip"}}) : PHP.run() failed with exit code 255 and the following output:

@adamziel
Copy link
Collaborator

adamziel commented Jul 1, 2024

@vyskoczilova it looks like https://kybernaut.cz/blueprints/pay-for-payment-playground.zip contains a zipped Playground site that was exported before these PRs landed:

The zIp file contains the SQLite integration plugin, but the importer doesn't pick it up (which seems to be a bug) and the Playground doesn't install a new instance of the SQLite integration plugin in the same mu-plugins location. As a result, this error happens:

[01-Jul-2024 23:15:34 UTC] PHP Warning:  require_once(/wordpress/wp-content/mu-plugins/sqlite-database-integration/load.php): Failed to open stream: No such file or directory in /wordpress/wp-content/mu-plugins/0-sqlite.php on line 1
[01-Jul-2024 23:15:34 UTC] PHP Fatal error:  Uncaught Error: Failed opening required '/wordpress/wp-content/mu-plugins/sqlite-database-integration/load.php' (include_path='.:') in /wordpress/wp-content/mu-plugins/0-sqlite.php:1

I'm adding it to our queue. A fix would be to use the zipped sqlite-database-integration plugin. I can't promise any timeline – perhaps removing the zipped mu-plugins entirely would work as as a workaround?

@adamziel adamziel added the [Type] Bug An existing feature does not function as intended label Jul 1, 2024
@adamziel adamziel moved this from Inbox to Needs Triage/Our Reply in Playground Board Jul 1, 2024
@vyskoczilova
Copy link
Author

vyskoczilova commented Jul 2, 2024

Hi @adamziel, Thanks for stepping in. Somehow, the Playground stopped working as the previous version.

Now I try to install the zip with deleted mu-plugins (from https://kybernaut.cz/blueprints/pay-for-payment-playground-v2.zip) or with zipped version (https://kybernaut.cz/blueprints/pay-for-payment-playground-v3.zip) and the WooCommerce plugin is not there any longer and the DB doesn't seem to be picked up either :( I have prepared a complete site to test my plugin - set up WooCommerce, products, my plugin, and homepage with instructions. Now I get an empty playground without imported data and plugin :/

What do you think Icould do about it? And I wouldn't be the only one who tried to leverage the importWordPressFiles step.

adamziel added a commit that referenced this issue Jul 3, 2024
Closes #1543

Playground exports before changes from the Boot Protocol (#1398)
contained platform-level WordPress plugins and mu-plugins. The importer,
then, removed them and replaced them with the latest version freshly sourced
from the /wordpress directory.

However, after the Boot Protocol changes, Playground no longer includes any
platform-level plugins in the /wordpress directory. This means that
things like SQLite database integration were being removed from the
imported ZIP bundle but they were not restored.

This PR removes this "remove & restore" mechanism. If the ZIP comes with
its own SQLite database integration, that one will be used. If it
doesn't, then Playground will fall back to the platform-level plugin.

 ## Testing instructions

1. Export Playground as zip and import it again. Confirm this worked.
2. Run [this Blueprint that imports an older ZIP bundle](https://playground.wordpress.net/builder/builder.html#{%22landingPage%22:%22/%22,%22preferredVersions%22:{%22php%22:%228.0%22,%22wp%22:%22latest%22},%22phpExtensionBundles%22:[%22kitchen-sink%22],%22features%22:{%22networking%22:true},%22steps%22:[{%22step%22:%22importWordPressFiles%22,%22wordPressFilesZip%22:{%22resource%22:%22url%22,%22url%22:%22https://kybernaut.cz/blueprints/pay-for-payment-playground.zip%22}},{%22step%22:%22login%22,%22username%22:%22admin%22,%22password%22:%22password%22},{%22step%22:%22installPlugin%22,%22pluginZipFile%22:{%22resource%22:%22wordpress.org/plugins%22,%22slug%22:%22woocommerce-pay-for-payment%22},%22options%22:{%22activate%22:true}}]}) and confirm it works

CC @vyskoczilova
@adamziel
Copy link
Collaborator

adamziel commented Jul 3, 2024

@vyskoczilova aha, it seems like a workaround might not work and this needs a fix in Playground. Sorry about that! I started a Pull Request that fixes the problem on my end – I hope to land it later today:

CleanShot 2024-07-03 at 11 27 33@2x

@vyskoczilova
Copy link
Author

@adamziel, that would be awesome! Thanks a lot :) My fingers crossed.

adamziel added a commit that referenced this issue Jul 3, 2024
## Motivation for the change, related issues

Closes #1543

Fixes importing older Playground exports via the `importWordPressFiles`
step.

Playground exports before changes from the Boot Protocol (#1398)
contained platform-level WordPress plugins and mu-plugins. The importer,
then, removed them and replaced them with the latest version freshly
sourced from the /wordpress directory.

However, after the Boot Protocol changes, Playground no longer includes
any platform-level plugins in the /wordpress directory. This means that
things like SQLite database integration were being removed from the
imported ZIP bundle but they were not restored.

This PR ensures the `0-sqlite.php` mu-plugin file will not be imported.
This way, we won't try to `require` files that the old export assumes to
exist but that do not exist anymore.

## Other ideas

I've initially tried removing the entire "remove & restore" files
mechanism, but that resulted in the following error:

![CleanShot 2024-07-03 at 11 28
37@2x](https://github.com/WordPress/wordpress-playground/assets/205419/10f5f1d4-7ba1-40c7-9cec-cf3ec13b8cf6)

It turned out every platform-level file **but** 0-sqlite.php was listed
for removal. Eventually I would still like to adjust the import flow to
remove this "remove & restore" dynamics and allow import bundles to ship
their own SQLite database integration plugin, but this PR will have to
do for now.

 ## Testing instructions

1. Export Playground as zip and import it again. Confirm this worked.
2. Run [this Blueprint that imports an older ZIP
bundle](https://playground.wordpress.net/builder/builder.html#{%22landingPage%22:%22/%22,%22preferredVersions%22:{%22php%22:%228.0%22,%22wp%22:%22latest%22},%22phpExtensionBundles%22:[%22kitchen-sink%22],%22features%22:{%22networking%22:true},%22steps%22:[{%22step%22:%22importWordPressFiles%22,%22wordPressFilesZip%22:{%22resource%22:%22url%22,%22url%22:%22https://kybernaut.cz/blueprints/pay-for-payment-playground.zip%22}},{%22step%22:%22login%22,%22username%22:%22admin%22,%22password%22:%22password%22},{%22step%22:%22installPlugin%22,%22pluginZipFile%22:{%22resource%22:%22wordpress.org/plugins%22,%22slug%22:%22woocommerce-pay-for-payment%22},%22options%22:{%22activate%22:true}}]})
and confirm it works

CC @vyskoczilova
@github-project-automation github-project-automation bot moved this from Needs Triage/Our Reply to Done in Playground Board Jul 3, 2024
@adamziel adamziel reopened this Jul 3, 2024
@github-project-automation github-project-automation bot moved this from Done to Inbox in Playground Board Jul 3, 2024
@adamziel
Copy link
Collaborator

adamziel commented Jul 3, 2024

#1569 solved this and the link you've shared works now :-)

@adamziel adamziel closed this as completed Jul 3, 2024
@github-project-automation github-project-automation bot moved this from Inbox to Done in Playground Board Jul 3, 2024
@vyskoczilova
Copy link
Author

Great! Thanks a lot, Adam!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package][@wp-playground] Blueprints [Type] Bug An existing feature does not function as intended
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants