Giter Club home page Giter Club logo

Comments (6)

madflojo avatar madflojo commented on May 30, 2024

Thanks for reporting this, I ran into the same issue with #32 and ended up using a higher version of TinyGo to compile the module. https://github.com/madflojo/tarmac/blob/main/testdata/Makefile#L5

Looks like we need to update the examples to use the latest TinyGo as well.

from tarmac.

jakemaguy avatar jakemaguy commented on May 30, 2024

I have some interesting findings to report. I attempted to bump the tinygo version in the Makefile from 0.17.0 to latest. The example compiled correctly and the server ran:

docker run -p 8080:8080  \
    -e "APP_ENABLE_TLS=false"  \
    -e "APP_LISTEN_ADDR=0.0.0.0:8080" \
    -v $(pwd)/functions:/functions madflojo/tarmac

time="2022-07-18T21:53:12Z" level=warning msg="No Config file found, loaded config from Environment - Default path ./conf"
time="2022-07-18T21:53:12Z" level=info msg="KV Store not configured, skipping"
time="2022-07-18T21:53:12Z" level=info msg="SQL DB not configured, skipping"
time="2022-07-18T21:53:12Z" level=info msg="Starting Listener on 0.0.0.0:8080"

However, when trying to send a request:

server

docker run -p 8080:8080 \
    -e "APP_ENABLE_TLS=false" \
    -e "APP_LISTEN_ADDR=0.0.0.0:8080"  \
    -e "APP_DEBUG=true"  \
    -v $(pwd)/functions:/functions madflojo/tarmac

time="2022-07-18T21:56:44Z" level=warning msg="No Config file found, loaded config from Environment - Default path ./conf"
time="2022-07-18T21:56:44Z" level=debug msg="Enabling Debug Logging"
time="2022-07-18T21:56:44Z" level=info msg="KV Store not configured, skipping"
time="2022-07-18T21:56:44Z" level=info msg="SQL DB not configured, skipping"
time="2022-07-18T21:56:44Z" level=info msg="Starting Listener on 0.0.0.0:8080"
time="2022-07-18T21:56:52Z" level=debug msg="HTTP Request to /" content-length=14 headers="map[Accept:[*/*] Content-Length:[14] Content-Type:[application/x-www-form-urlencoded] User-Agent:[curl/7.68.0]]" http-protocol=HTTP/1.1 method=POST remote-addr="172.17.0.1:38304"
time="2022-07-18T21:56:52Z" level=debug msg="Error executing WASM module - failed to execute wasm module - invocation of WASM module failed - call to \"POST\" was unsuccessful" content-length=14 headers="map[Accept:[*/*] Content-Length:[14] Content-Type:[application/x-www-form-urlencoded] User-Agent:[curl/7.68.0]]" http-protocol=HTTP/1.1 method=POST remote-addr="172.17.0.1:38304"

client

curl --data "Tarmac Example" "http://localhost:8080" -v
*   Trying 127.0.0.1:8080...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 8080 (#0)
> POST / HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.68.0
> Accept: */*
> Content-Length: 14
> Content-Type: application/x-www-form-urlencoded
>
* upload completely sent off: 14 out of 14 bytes
* Mark bundle as not supporting multiuse
< HTTP/1.1 500 Internal Server Error
< Server: tarmac
< Date: Mon, 18 Jul 2022 21:57:04 GMT
< Content-Length: 0
<
* Connection #0 to host localhost left intact

bumping tinygo from 0.17.0 to 0.18.0

server

docker run -p 8080:8080 \
    -e "APP_ENABLE_TLS=false" \
    -e "APP_LISTEN_ADDR=0.0.0.0:8080"  \
    -e "APP_DEBUG=true"  \
    -v $(pwd)/functions:/functions madflojo/tarmac

time="2022-07-18T22:04:15Z" level=warning msg="No Config file found, loaded config from Environment - Default path ./conf"
time="2022-07-18T22:04:15Z" level=debug msg="Enabling Debug Logging"
time="2022-07-18T22:04:15Z" level=info msg="KV Store not configured, skipping"
time="2022-07-18T22:04:15Z" level=info msg="SQL DB not configured, skipping"
time="2022-07-18T22:04:15Z" level=info msg="Starting Listener on 0.0.0.0:8080"
time="2022-07-18T22:04:20Z" level=debug msg="HTTP Request to /" content-length=14 headers="map[Accept:[*/*] Content-Length:[14] Content-Type:[application/x-www-form-urlencoded] User-Agent:[curl/7.68.0]]" http-protocol=HTTP/1.1 method=POST remote-addr="172.17.0.1:38314"
time="2022-07-18T22:04:20Z" level=debug msg="CallbackRouter called with payload Reversing Payload: Tarmac Example" function=trace namespace=logger

client

curl --data "Tarmac Example" "http://localhost:8080" -v
*   Trying 127.0.0.1:8080...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 8080 (#0)
> POST / HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.68.0
> Accept: */*
> Content-Length: 14
> Content-Type: application/x-www-form-urlencoded
>
* upload completely sent off: 14 out of 14 bytes
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Server: tarmac
< Date: Mon, 18 Jul 2022 22:04:20 GMT
< Content-Length: 14
< Content-Type: text/plain; charset=utf-8
<
* Connection #0 to host localhost left intact
elpmaxE camraT

from tarmac.

madflojo avatar madflojo commented on May 30, 2024

now that is interesting. What is super interesting is the CI pipeline is setup with latest and the test example uses posts. I'll have to look into this a bit more.

from tarmac.

madflojo avatar madflojo commented on May 30, 2024

Was able to confirm this as well, for now, I updated the Makefiles to use TinyGo v0.18.0. But I'll look at the wapc packages and see if I can identify why it's failing.

FYI @codefromthecrypt

from tarmac.

codefromthecrypt avatar codefromthecrypt commented on May 30, 2024

oh I see. I think the minimum version of TinyGo is v0.18.0 as it corrected the module import for wasi from wasi_unstable to wasi_snapshot_preview1, which is what everything else uses. tinygo-org/tinygo@303acf5

from tarmac.

madflojo avatar madflojo commented on May 30, 2024

After merging #37 this is fixed for versions 0.18 and greater. Turns out we needed to update to the latest wapc-guest package.

from tarmac.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.