wasmCloud: [BUG] http request be hang

Affected project(s)

  • documentation
  • examples
  • wasmCloud host
  • wasmCloud CLI (wash)
  • wasmCloud dashboard UI (washboard)
  • capability providers
  • provider bindgen
  • control interface client
  • other / not sure

Describe the bug

In k8s wasmcloud host pod:

curl 127.0.0.1:9000 // hang

wasmcloud host’s log:

2025-03-14T06:16:10.599114Z DEBUG handle_scale_component_task:start_component: wasmcloud_host::wasmbus::handler: component is not linked to a lattice target for the given instance links={"default": {"wasmcloud:postgres/query": "traffic_collector-sqldb_postgres", "wasi:http/outgoing-handler": "traffic_collector-httpclient"}} instance="wasi:logging/logging@0.1.0-draft" target_instance="wasi:logging/logging" self.component_id="traffic_collector-traffic_collector"

wadm:

apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
  name: traffic-collector
  namespace: wasmcloud
  annotations:
    wasmcloud.dev/authors: patrickjiang
spec:
  components:
    - name: traffic-collector
      type: component
      properties:
        image: docker.longbridge-inc.com/long-bridge-middleware/wasmcloud/traffic-collector:hk-latest
        config:
        - name: custom-config
          properties:
            metrics-address: http://127.0.0.1:11231
            step: 30s
            data-in-metric: >-
              sum(rate(istio_request_bytes_sum{source_cluster=~"prod-(sz|sh)-ack-1",
              destination_cluster=~"prod-hk-(eks|ack)-1", reporter="destination"}[30s]))
              by (account_channel) * 8
            data-out-metric: >-
              sum(rate(istio_response_bytes_sum{source_cluster=~"prod-(sz|sh)-ack-1",
              destination_cluster=~"prod-hk-(eks|ack)-1", reporter="destination"}[30s]))
              by (account_channel) * 8
            qps-metric: >-
              sum(rate(istio_requests_total{source_cluster=~"prod-(sz|sh)-ack-1",
              destination_cluster=~"prod-hk-(eks|ack)-1", reporter="destination"}[30s]))
              by (account_channel)
            api-qps-metric: >-
              sum(rate(nginx_http_requests_total{app="lb-gateway-api",cluster="prod-sz-ack"}[30s])) by (tenant)
            tenant-mapping: |
              {
                "pspl_sg": "lb",
                "hk_swhy_uat": "hk_swhy",
                "hk_cgis_uat": "hk_cgis",
                "hk_cgis_south": "hk_cgis_south",
                "hk_quam_ib": "hk_quam",
                "hk_quam_uat": "hk_quam"
              }
      traits:
        # Govern the spread/scheduling of the component
        - type: spreadscaler
          properties:
            instances: 10
        # Establish a unidirectional link to the outgoing-handler,
        # so the `http-component` component can make use of outgoing handler functionality
        # (i.e. making external web requests)
        - type: link
          properties:
            target:
              name: httpclient
            namespace: wasi
            package: http
            interfaces: [outgoing-handler]
        - type: link
          properties:
            target:
              name: sqldb-postgres
            namespace: wasmcloud
            package: postgres
            interfaces: [query]
    # Add a capability provider that enables HTTP access
    - name: httpserver
      type: capability
      properties:
        image: ghcr.io/wasmcloud/http-server:0.26.0
      traits:
        - type: link
          properties:
            target:
              name: traffic-collector
            namespace: wasi
            package: http
            interfaces: [incoming-handler]
            source:
              config:
                - name: default-http
                  properties:
                    address: 0.0.0.0:9000
        - type: daemonscaler
          properties:
            replicas: 1
    - name: httpclient
      type: capability
      properties:
        image: ghcr.io/wasmcloud/http-client:0.12.1
    - name: sqldb-postgres
      type: capability
      properties:
        image: ghcr.io/wasmcloud/sqldb-postgres:0.8.0
        config:
          - name: default-postgres
            properties:
              POSTGRES_HOST: localhost
              POSTGRES_PORT: "5432"
              POSTGRES_USERNAME: postgres
              POSTGRES_PASSWORD: postgres
              POSTGRES_DATABASE: postgres
              POSTGRES_TLS_REQUIRED: "false"

Steps to reproduce

That can’t be reproduce at local

Expected behavior

return success

Environment

  • OS: Linux
  • Shell [e.g. bash, zsh, powershell]
  • wasmcloud Version 1.2.1

Screenshots / Logs / Additional context

No response

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Comments: 19 (19 by maintainers)

Most upvoted comments

I’m sure it stuck at the log printing. If I remove log code, it works.

	log := wasilog.ContextLogger("handleRequest")
	log.Info("handleRequest")