spin: `http-php` template not working with latest spin

while trying to add tests for http-php, it seems it is not working.

steps followed (Refer below for full logs of commands run and logs)

  • installed latest spin canary spin 0.9.0 (77985cc 2023-02-28) on apple silicon (didn’t tried on other one)
  • installed latest templates
  • create new app using template http-php
  • cd to new app folder and run spin up
  • hit the endpoint http://127.0.0.1:3000/, observe following error on spin process side
2023-02-28T07:39:34.061058Z ERROR spin_http: Error processing request: error while executing at wasm backtrace:
    0: 0x34ca86 - <unknown>!<wasm function 6022>
    1: 0x34e793 - <unknown>!<wasm function 6058>
    2: 0x361e09 - <unknown>!<wasm function 6226>
note: using the `WASMTIME_BACKTRACE_DETAILS=1` environment variable may show more debugging information

Caused by:
    exit with invalid exit status outside of [0..126) 
Detailed logs

➜  testcases git:(more-tests-2) ✗ /usr/local/bin/spin-canary --version                 
spin 0.9.0 (77985cc 2023-02-28)

➜  testcases git:(more-tests-2) ✗ /usr/local/bin/spin-canary  template install --git https://github.com/fermyon/spin --branch main --upgrade
Copying remote template source
Installing template redis-rust...
Installing template static-fileserver...
Installing template http-grain...
Installing template http-swift...
Installing template http-php...
Installing template http-c...
Installing template redirect...
Installing template http-rust...
Installing template http-go...
Installing template http-zig...
Installing template http-empty...
Installing template redis-go...
Installed 12 template(s)

+------------------------------------------------------------------------+
| Name                Description                                        |
+========================================================================+
| http-c              HTTP request handler using C and the Zig toolchain |
| http-empty          HTTP application with no components                |
| http-go             HTTP request handler using (Tiny)Go                |
| http-grain          HTTP request handler using Grain                   |
| http-php            HTTP request handler using PHP                     |
| http-rust           HTTP request handler using Rust                    |
| http-swift          HTTP request handler using SwiftWasm               |
| http-zig            HTTP request handler using Zig                     |
| redirect            Redirects a HTTP route                             |
| redis-go            Redis message handler using (Tiny)Go               |
| redis-rust          Redis message handler using Rust                   |
| static-fileserver   Serves static files from an asset directory        |
+------------------------------------------------------------------------+

➜  testcases git:(more-tests-2) ✗ /usr/local/bin/spin-canary new http-php http-php-test
Description: 
HTTP base: /
HTTP path: /...

➜  testcases git:(more-tests-2) ✗ cd http-php-test 

➜  http-php-test git:(more-tests-2) ✗ cat spin.toml 
spin_version = "1"
authors = ["Rajat Jindal <rajatjindal83@gmail.com>"]
description = ""
name = "http-php-test"
trigger = { type = "http", base = "/" }
version = "0.1.0"

[[component]]
id = "http-php-test"
files = [ { source = "./src", destination = "/" } ]
allowed_http_hosts = []
[component.source]
url = "https://github.com/vmware-labs/webassembly-language-runtimes/releases/download/php%2F7.4.32%2B20221124-2159d1c/php-cgi-7.4.32.speed-optimized.wasm"
digest = "sha256:511720698dee56134ed8a08a87131d33c3ea8a64b6726cd6710d624bca4ceb6c"
[component.trigger]
executor = { type = "wagi"}
route = "/..."

➜  http-php-test git:(more-tests-2) ✗ spin up
Serving http://127.0.0.1:3000
Available Routes:
  http-php-test: http://127.0.0.1:3000 (wildcard)
2023-02-28T07:39:34.061058Z ERROR spin_http: Error processing request: error while executing at wasm backtrace:
    0: 0x34ca86 - <unknown>!<wasm function 6022>
    1: 0x34e793 - <unknown>!<wasm function 6058>
    2: 0x361e09 - <unknown>!<wasm function 6226>
note: using the `WASMTIME_BACKTRACE_DETAILS=1` environment variable may show more debugging information

Caused by:
    exit with invalid exit status outside of [0..126)    
^C%                                            

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 17 (17 by maintainers)

Most upvoted comments

@vdice Upstream breaking change absolutely falls under the backward compatibility promise. If we have updated to a new version of a dependency, and that new version breaks existing apps, then we’ve not maintained backward compatibility. It doesn’t matter that the dependency is what caused it. It matters that an app that used to run, and has not changed, no longer runs.

(Note that if PHP changed in a breaking way, that would be a different matter, because existing apps - that is, existing builds of PHP - would continue to run.)

In this case, we are still at 0.x, and don’t have that full stability guarantee in place. But if the ABI change theory is correct we will need to be super careful about this once we hit 1.0.

@technosophos Genius! index.php works for me. Thank you!

I’m not too fussed about the template. It might be nice, though I don’t know how it would play if the HTTP base were something other than /. But it would get you onto the Spin 1.0 contributor list… #JustSaying