Skip to content

use wasm failed env::runtime.ticks has not been defined #9502

@thinkdb1

Description

@thinkdb1

Description

2023/05/17 08:54:21 [error] 52#52: failed to new instance: unknown import: env::runtime.ticks has not been defined
2023/05/17 08:54:21 [error] 52#52: 8 [lua] plugin.lua:135: load_plugin(): failed to load plugin [wasm_log] err: failed to load wasm plugin, context: init_worker_by_lua

Environment

env is this docker: https://github.com/apache/apisix-docker/blob/master/example/docker-compose.yml

  • APISIX version (run apisix version):3.3.0
  • Operating system (run uname -a):
Linux esf-B85-HD3 5.4.0-47-generic #51~18.04.1-Ubuntu SMP Sat Sep 5 14:35:50 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
 tinygo build -o ./wasm.wasm -target wasm main.go 

to wasm.wasm
and

docker cp wasm.wasm dockerapisix_apisix_1:/usr/local/apisix/t/
  • config.yaml :
apisix:
  node_listen: 9080              # APISIX listening port
  enable_ipv6: false

  enable_control: true
  control:
    ip: "0.0.0.0"
    port: 9092

deployment:
  admin:
    allow_admin:               # https://nginx.org/en/docs/http/ngx_http_access_module.html#allow
      - 0.0.0.0/0              # We need to restrict ip access rules for security. 0.0.0.0/0 is for test.

    admin_key:
      - name: "admin"
        key: edd1c9f034335f136f87ad84b625c8f1
        role: admin                 # admin: manage all configuration data

      - name: "viewer"
        key: 4054f7cf07e344346cd3f287985e76a2
        role: viewer

  etcd:
    host:                           # it's possible to define multiple etcd hosts addresses of the same etcd cluster.
      - "http://etcd:2379"          # multiple etcd address
    prefix: "/apisix"               # apisix configurations prefix
    timeout: 30                     # 30 seconds

plugin_attr:
  prometheus:
    export_addr:
      ip: "0.0.0.0"
      port: 9091

wasm:
  plugins:
    - name: wasm_log # the name of the plugin
      priority: 7999 # priority
      file: /usr/local/apisix/t/wasm.wasm # the path of `.wasm` file
      http_request_phase: access # default to "access", can be one of ["access", "rewrite"]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions