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

wp-now: Environment crashes when started in Woo plugin directory #467

Closed
wojtekn opened this issue May 29, 2023 · 2 comments
Closed

wp-now: Environment crashes when started in Woo plugin directory #467

wojtekn opened this issue May 29, 2023 · 2 comments

Comments

@wojtekn
Copy link
Collaborator

wojtekn commented May 29, 2023

I wanted to test an issue in Woo Commerce using different WP versions using wp-now, but it crashed immediately after the start.

Steps to reproduce:

  1. Download Woo Commerce plugin and unpack it
  2. Open terminal and change to the plugin's directory
  3. Start wp-now
wp-now start

Expected behavior:

  • WP environment is started and has Woo plugin installed

Current behavior:

  • wp-now crashes

Stack trace:

 % wp-now start                                            
Starting the server......
directory: /Sites/woocommerce
mode: plugin
php: 8.0
wp: latest
WordPress latest folder already exists. Skipping download.
SQLite folder already exists. Skipping download.
Error: 
"unreachable" WASM instruction executed.

The typical reason is a PHP function missing from the ASYNCIFY_ONLY
list when building PHP.wasm.

You will need to file a new issue in the WordPress Playground repository
and paste this error message there:

https://github.com/WordPress/wordpress-playground/issues/new

If you're a core developer, the typical fix is to:

* Isolate a minimal reproduction of the error
* Add a reproduction of the error to php-asyncify.spec.ts in the WordPress Playground repository
* Run 'npm run fix-asyncify'
* Commit the changes, push to the repo, release updated NPM packages

Below is a list of all the PHP functions found in the stack trace to
help with the minimal reproduction. If they're all already listed in
the Dockerfile, you'll need to trigger this error again with long stack
traces enabled. In node.js, you can do it using the --stack-trace-limit=100
CLI option: 

    * php_pollfd_for
    * php_network_connect_socket
    * php_tcp_sockop_set_option
    * php_openssl_sockop_set_option
    * _php_stream_set_option
    * _php_stream_xport_create
    * zif_stream_socket_client
    * ZEND_DO_FCALL_BY_NAME_SPEC_RETVAL_USED_HANDLER
    * execute_ex
    * zend_call_function
    * zif_array_filter

    at #handleRequest (/PATH/node_modules/@wp-now/wp-now/node_modules/@php-wasm/node/index.cjs:67743:24)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async _NodePHP.run (/PATH/node_modules/@wp-now/wp-now/node_modules/@php-wasm/node/index.cjs:67518:12)
    at async #dispatchToPHP (/PATH/node_modules/@wp-now/wp-now/node_modules/@php-wasm/node/index.cjs:67130:14)
    at async PHPRequestHandler.request (/PATH/node_modules/@wp-now/wp-now/node_modules/@php-wasm/node/index.cjs:67038:12)
    at async PHPBrowser.request (/PATH/node_modules/@wp-now/wp-now/node_modules/@php-wasm/node/index.cjs:66832:22)
    at async Ce (file:///PATH/node_modules/@wp-now/wp-now/node_modules/@wp-playground/blueprints/index.js:451:61)
    at async startWPNow (file:///PATH/node_modules/@wp-now/wp-now/main.js:518:3)
    at async startServer (file:///PATH/node_modules/@wp-now/wp-now/main.js:737:42)
    at async Object.handler (file:///PATH/node_modules/@wp-now/wp-now/main.js:880:25) {
  cause: Error: Rethrown
      at UnhandledRejectionsTarget.errorListener (/PATH/node_modules/@wp-now/wp-now/node_modules/@php-wasm/node/index.cjs:67710:28)
      at [nodejs.internal.kHybridDispatch] (node:internal/event_target:735:20)
      at UnhandledRejectionsTarget.dispatchEvent (node:internal/event_target:677:26)
      at runtime.asm.<computed> (/PATH/node_modules/@wp-now/wp-now/node_modules/@php-wasm/node/index.cjs:66636:18)
      at invoke_iiiii (/PATH/node_modules/@wp-now/wp-now/node_modules/@php-wasm/node/index.cjs:24598:14)
      at php_execute_script (wasm://wasm/026cde66:wasm-function[10322]:0x55d5cf)
      at dynCall_ii (wasm://wasm/026cde66:wasm-function[11718]:0x5dec98)
      at ret.<computed> (/PATH/node_modules/@wp-now/wp-now/node_modules/@php-wasm/node/index.cjs:23851:33)
      at runtime.asm.<computed> (/PATH/node_modules/@wp-now/wp-now/node_modules/@php-wasm/node/index.cjs:66617:18)
      at invoke_ii (/PATH/node_modules/@wp-now/wp-now/node_modules/@php-wasm/node/index.cjs:24587:14)
      at wasm_sapi_handle_request (wasm://wasm/026cde66:wasm-function[9024]:0x4f557a)
      at ret.<computed> (/PATH/node_modules/@wp-now/wp-now/node_modules/@php-wasm/node/index.cjs:23851:33)
      at runtime.asm.<computed> (/PATH/node_modules/@wp-now/wp-now/node_modules/@php-wasm/node/index.cjs:66617:18)
      at Object.doRewind (/PATH/node_modules/@wp-now/wp-now/node_modules/@php-wasm/node/index.cjs:23909:14)
      at /PATH/node_modules/@wp-now/wp-now/node_modules/@php-wasm/node/index.cjs:23932:45
      at /PATH/node_modules/@wp-now/wp-now/node_modules/@php-wasm/node/index.cjs:23762:11 {
    cause: RuntimeError: unreachable
        at zend_call_function (wasm://wasm/026cde66:wasm-function[432]:0x2d2bb)
        at zif_array_filter (wasm://wasm/026cde66:wasm-function[8501]:0x4d9329)
        ... 2 lines matching cause stack trace ...
        at zend_call_function (wasm://wasm/026cde66:wasm-function[432]:0x2ce58)
        at zif_array_filter (wasm://wasm/026cde66:wasm-function[8501]:0x4d9329)
        at ZEND_DO_FCALL_BY_NAME_SPEC_RETVAL_USED_HANDLER (wasm://wasm/026cde66:wasm-function[12978]:0x638502)
        at execute_ex (wasm://wasm/026cde66:wasm-function[11537]:0x5d5e6d)
        at zend_execute (wasm://wasm/026cde66:wasm-function[3251]:0x2060a7)
        at zend_execute_scripts (wasm://wasm/026cde66:wasm-function[8642]:0x4e2dea)
        at dynCall_iiiii (wasm://wasm/026cde66:wasm-function[11715]:0x5dea31)
        at ret.<computed> (/PATH/node_modules/@wp-now/wp-now/node_modules/@php-wasm/node/index.cjs:23851:33)
        at runtime.asm.<computed> (/PATH/node_modules/@wp-now/wp-now/node_modules/@php-wasm/node/index.cjs:66617:18)
        at invoke_iiiii (/PATH/node_modules/@wp-now/wp-now/node_modules/@php-wasm/node/index.cjs:24598:14)
        at php_execute_script (wasm://wasm/026cde66:wasm-function[10322]:0x55d5cf)
        at dynCall_ii (wasm://wasm/026cde66:wasm-function[11718]:0x5dec98) {
      cause: Error
          at Asyncify.handleSleep (/PATH/node_modules/@wp-now/wp-now/node_modules/@php-wasm/node/index.cjs:24793:45)
          at _wasm_poll_socket (/PATH/node_modules/@wp-now/wp-now/node_modules/@php-wasm/node/index.cjs:23705:21)
          at php_pollfd_for (wasm://wasm/026cde66:wasm-function[946]:0x8b1ef)
          at php_network_connect_socket (wasm://wasm/026cde66:wasm-function[5215]:0x36ad5f)
          at php_tcp_sockop_set_option (wasm://wasm/026cde66:wasm-function[10026]:0x543f1f)
          at php_openssl_sockop_set_option (wasm://wasm/026cde66:wasm-function[10154]:0x54e64b)
          at _php_stream_set_option (wasm://wasm/026cde66:wasm-function[484]:0x326e7)
          at _php_stream_xport_create (wasm://wasm/026cde66:wasm-function[1643]:0xe7165)
          at zif_stream_socket_client (wasm://wasm/026cde66:wasm-function[7550]:0x463415)
          at ZEND_DO_FCALL_BY_NAME_SPEC_RETVAL_USED_HANDLER (wasm://wasm/026cde66:wasm-function[12978]:0x638502)
          at execute_ex (wasm://wasm/026cde66:wasm-function[11537]:0x5d5e6d)
          at zend_call_function (wasm://wasm/026cde66:wasm-function[432]:0x2ce58)
          at zif_array_filter (wasm://wasm/026cde66:wasm-function[8501]:0x4d9329)
          at ZEND_DO_FCALL_BY_NAME_SPEC_RETVAL_USED_HANDLER (wasm://wasm/026cde66:wasm-function[12978]:0x638502)
          at execute_ex (wasm://wasm/026cde66:wasm-function[11537]:0x5d5e6d)
          at zend_call_function (wasm://wasm/026cde66:wasm-function[432]:0x2ce58)
@adamziel
Copy link
Collaborator

@wojtekn I had no chance to test it yet, but #397 should solve it

@wojtekn
Copy link
Collaborator Author

wojtekn commented May 30, 2023

Thanks, @adamziel. I'm closing it as it duplicates #392

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

No branches or pull requests

2 participants