[BUG] Not working - Probably configuration issue ?

Describe the bug 🐛
IP Banning not working. Middleware loads into traefik dashboard for a few seconds (if at all), then disappears. Traefik probably crashes and restarts without middleware ???
Expected behavior 👀
IP Banning working, middleware correctly and permanently listed in traefik dashboard.
Context 🔎
At first I thought that the issue was related to this, since the plugin type wasn't recognized. As such, I applied the same fix as suggested by @ jLemmings in https://github.com/maxlerebourg/crowdsec-bouncer-traefik-plugin/issues/95.
I am not sure whether I need to just set the dynamic configuration or if I need to define a middleware with a different name each time for each container in their own compose.yml file. I tried both approaches, with the per-container defined middleware to usually load into traefik dashboard then disappear a few seconds later (and unsure if traefik crashed in the meantime ...).
As such I find the example in the documentation for the whoami container a bit confusing/misleading: aren't we already configuring the middleware (including the LAPI Key) in the traefik dynamic configuration file ? Or probably something (obvious) which I fail to see ...
Version (please complete the following information):

OS: Debian GNU/Linux Bookworm (12) AMD, Podman from Debian Testing/Trixie Repositories using APT Pinning (4.9.3)
Traefik version: 2.11.0
Plugin version: 1.2.0
Redis: No

To Reproduce
Unsure to be honest.
This is what I have  used.
Traefik configured via compose.yml file
version: '3.9'

networks:
  traefik:
    external: true

services:
  traefik:
    image: traefik:latest
    hostname: ra.MYDOMAIN.TLD
    domainname: MYDOMAIN.TLD
    restart: unless-stopped
    container_name: traefik
    ports:
      - 80:80
      - 443:443
#      - 8080:8080
#      - 8443:8443
    networks:
      - traefik
    volumes:
      - /run/user/1001/podman/podman.sock:/var/run/docker.sock:ro
      - ~/data/traefik/letsencrypt:/letsencrypt
#      - ~/config/traefik/traefik.yml:/etc/traefik/traefik.yml:ro # Command line arguments, static configuration file and environment variables are mutually exclusive: https://doc.traefik.io/traefik/getting-started/configuration-overview/#the-static-configuration
      - ~/config/traefik/dynamic:/etc/traefik/dynamic
      - ~/certificates/traefik:/certificates
      - ~/log/traefik:/log
    command:
      ## Logging
      # Server Log
      - "--log.level=DEBUG"
#      - "--log.level=INFO"
      - "--log.filePath=/log/server/traefik.log"

      # Error Log
      - "--accesslog=true"
      - "--accesslog.filePath=/log/access/access.log"

      ## Dashboard & API
      - "--api"
      - "--api.insecure=false" # production = false , development = true
      - "--api.dashboard=true"

      ## EntryPoints
      # Unsecure Connection - Redirect to Secure
      - "--entrypoints.web.address=:80"
      - "--entrypoints.web.http.redirections.entrypoint.to=websecure"
      - "--entryPoints.web.http.redirections.entrypoint.scheme=https"
#      - "--entrypoints.web.http.redirections.entrypoint.permanent=true"

      # Secure Connection
      - "--entrypoints.websecure.address=:443"
      - "--entrypoints.websecure.http.tls=true"
      - "--entrypoints.websecure.http.tls.certresolver=letsencrypt"
      - "--entryPoints.websecure.transport.respondingTimeouts.readTimeout=420"
      - "--entryPoints.websecure.transport.respondingTimeouts.writeTimeout=420"
      - "--entryPoints.websecure.transport.respondingTimeouts.idleTimeout=420"

      ## Letsencrypt Configuration
#      - "--certificatesresolvers.lets-encrypt.acme.caserver=https://acme-staging-v02.api.letsencrypt.org/directory" # For testing only
      - "--certificatesresolvers.letsencrypt.acme.caserver=https://acme-v02.api.letsencrypt.org/directory" # Production - Rated limited !!!
      -<EMAIL_ADDRESS>      - "--certificatesresolvers.letsencrypt.acme.httpchallenge=true"
      - "--certificatesresolvers.letsencrypt.acme.httpchallenge.entrypoint=web"
#      - "--certificatesresolvers.letsencrypt.acme.tlschallenge=true"
      - "--certificatesresolvers.letsencrypt.acme.storage=/letsencrypt/acme.json"

      ## Docker / Podman Intergration
      - "--providers.docker=true"
      - "--providers.docker.exposedByDefault=false"
      - "--providers.docker.watch=false"
      - "--providers.docker.swarmMode=false"
      - "--providers.docker.endpoint=unix:///var/run/docker.sock"

      # Crowdsec Plugin
      - "--experimental.plugins.crowdsec-bouncer-traefik-plugin.moduleName=github.com/maxlerebourg/crowdsec-bouncer-traefik-plugin"
      - "--experimental.plugins.crowdsec-bouncer-traefik-plugin.version=v1.2.0" # Version Must be manually updated

      ## Other
      # ...
      - "--serversTransport.insecureSkipVerify=true"

      # No Telemetry
      - "--global.sendAnonymousUsage=false"

    labels:
      # Enable Traefik
      - "traefik.enable=true"

      # Dashboard
      - "traefik.http.routers.dashboard.rule=Host(`ra.MYDOMAIN.TLD`) && PathPrefix(`/api` , `/dashboard`)"
      - "traefik.http.routers.dashboard.service=api@internal"
      - "traefik.http.routers.dashboard.middlewares=authtraefik , crowdsec"

      # Authentication for Dashboard access
      - "traefik.http.middlewares.authtraefik.basicauth.usersfile=/config/users"

      # Create bouncer middleware
#      - "traefik.http.middlewares.crowdsec.plugin.crowdsec-bouncer-traefik-plugin.crowdseclapikey=MVr63g3nqsNzzb79J67FEw"
#      - "traefik.http.middlewares.crowdsec.plugin.crowdsec-bouncer-traefik-plugin.crowdseclapischeme=http"
#      - "traefik.http.middlewares.crowdsec.plugin.crowdsec-bouncer-traefik-plugin.crowdseclapihost=crowdsec:8080"

Dynamic traefik configuration (based on stock config - only replaced plugin name based on jLemmings findings in https://github.com/maxlerebourg/crowdsec-bouncer-traefik-plugin/issues/95)
# Dynamic configuration

http:
  routers:
    my-router:
      rule: host(`whoami.localhost`)
      service: service-foo
      entryPoints:
        - web
      middlewares:
        - crowdsec

  services:
    service-foo:
      loadBalancer:
        servers:
          - url: http://<IP_ADDRESS>:5000

  middlewares:
#    default-crowdsec-bouncer-traefik-plugin:
#      CrowdsecLapiKey: XXXXXXXXXXXXXXXXXXXXXXX
#      Enabled: true
    crowdsec:
      plugin:
        crowdsec-bouncer-traefik-plugin:
          enabled: true
          logLevel: DEBUG
          updateIntervalSeconds: 60
          defaultDecisionSeconds: 60
          httpTimeoutSeconds: 10
          crowdsecMode: live
          crowdsecAppsecEnabled: false
          crowdsecAppsecHost: crowdsec:7422
          crowdsecAppsecFailureBlock: true
          crowdsecLapiKey: XXXXXXXXXXXXXXXXXXXXXXX
#          crowdsecLapiKeyFile: /etc/traefik/cs-privateKey-foo
          crowdsecLapiHost: crowdsec:8080
          crowdsecLapiScheme: http
          crowdsecLapiTLSInsecureVerify: false
          crowdsecCapiMachineId: login
          crowdsecCapiPassword: password
          crowdsecCapiScenarios:
            - crowdsecurity/http-path-traversal-probing
            - crowdsecurity/http-xss-probing
            - crowdsecurity/http-generic-bf
          forwardedHeadersTrustedIPs:
#            - <IP_ADDRESS>/32
#            - <IP_ADDRESS>/24
          clientTrustedIPs:
#            - <IP_ADDRESS>/24
          forwardedHeadersCustomName: X-Custom-Header
          redisCacheEnabled: false
          redisCacheHost: "redis:6379"
          redisCachePassword: password
          redisCacheDatabase: "5"
#          crowdsecLapiTLSCertificateAuthority: |-
#            -----BEGIN CERTIFICATE-----
#            MIIEBzCCAu+gAwIBAgICEAAwDQYJKoZIhvcNAQELBQAwgZQxCzAJBgNVBAYTAlVT
#            ...
#            Q0veeNzBQXg1f/JxfeA39IDIX1kiCf71tGlT
#            -----END CERTIFICATE-----
#          crowdsecLapiTLSCertificateAuthorityFile: /etc/traefik/crowdsec-certs/ca.pem
#          crowdsecLapiTLSCertificateBouncer: |-
#            -----BEGIN CERTIFICATE-----
#            MIIEHjCCAwagAwIBAgIUOBTs1eqkaAUcPplztUr2xRapvNAwDQYJKoZIhvcNAQEL
#            ...
#            RaXAnYYUVRblS1jmePemh388hFxbmrpG2pITx8B5FMULqHoj11o2Rl0gSV6tHIHz
#            N2U=
#            -----END CERTIFICATE-----
#          crowdsecLapiTLSCertificateBouncerFile: /etc/traefik/crowdsec-certs/bouncer.pem
#          crowdsecLapiTLSCertificateBouncerKey: |-
#            -----BEGIN RSA PRIVATE KEY-----
#            MIIEogIBAAKCAQEAtYQnbJqifH+ZymePylDxGGLIuxzcAUU4/ajNj+qRAdI/Ux3d
#            ...
#            ic5cDRo6/VD3CS3MYzyBcibaGaV34nr0G/pI+KEqkYChzk/PZRA=
#            -----END RSA PRIVATE KEY-----
#          crowdsecLapiTLSCertificateBouncerKeyFile: /etc/traefik/crowdsec-certs/bouncer-key.pem

Example of container compose.yml configuration for Headscale:
version: '3.9'
networks:
  headscale:
    external: true

services:
  headscale:
    image: headscale/headscale:latest
#    pull_policy: always
    container_name: headscale
    hostname: headscale.MYDOMAIN.TLD
    domainname: MYDOMAIN.TLD
    restart: unless-stopped
    command: headscale serve
    volumes:
      - ~/config/headscale:/etc/headscale
      - ~/data/headscale:/var/lib/headscale
 #   ports:
 #     - 8080:8080
 #     - 9090:9090
 #   networks:
 #     -  traefik
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.headscale-rtr.rule=PathPrefix(`/`) && Host(`headscale.MYDOMAIN.TLD`)"
      - "traefik.http.routers.headscale-rtr.middlewares=crowdsec"

      - "traefik.http.services.headscale-svc.loadbalancer.server.port=8080"

#      - "traefik.http.middlewares.headscale-crowdsec.plugin.bouncer.crowdseclapikey=XXXXXXXXXXXXXXX"
#      - "traefik.http.middlewares.headscale-crowdsec.plugin.bouncer.crowdseclapischeme=http"
#      - "traefik.http.middlewares.headscale-crowdsec.plugin.bouncer.crowdseclapihost=crowdsec:8080"
    depends_on:
      - traefik

Hey @luckylinux,
I looked at your configuration and I tried to make a minimal/simplified working example for you.
It is based on a docker-compose and only 2 files for configuration:
version: '3.9'

networks:
  traefik:
    external: true

services:
  traefik:
    image: traefik:latest
    # hostname: ra.MYDOMAIN.TLD
    # domainname: MYDOMAIN.TLD
    restart: unless-stopped
    container_name: traefik
    ports:
      - 80:80
      - 443:443
      - 8080:8080
#      - 8443:8443
    networks:
      - traefik
    volumes:
      - /run/user/1001/podman/podman.sock:/var/run/docker.sock:ro
      - ~/data/traefik/letsencrypt:/letsencrypt
#      - ~/config/traefik/traefik.yml:/etc/traefik/traefik.yml:ro # Command line arguments, static configuration file and environment variables are mutually exclusive: https://doc.traefik.io/traefik/getting-started/configuration-overview/#the-static-configuration
      - ./whoami.yml:/whoami.yml
      - ~/certificates/traefik:/certificates
      # - ~/log/traefik:/log
      - "logs:/var/log/traefik"
    command:
      ## Logging
      # Server Log
      - "--log.level=DEBUG"
#      - "--log.level=INFO"
      - "--log.filePath=/log/server/traefik.log"

      # Error Log
      - "--accesslog=true"
      - "--accesslog.filePath=/log/access/access.log"

      ## Dashboard & API
      - "--api"
      - "--api.insecure=true" # production = false , development = true
      - "--api.dashboard=true"

      ## EntryPoints
      # Unsecure Connection - Redirect to Secure
      - "--entrypoints.web.address=:80"
      # - "--entrypoints.web.http.redirections.entrypoint.to=websecure"
      # - "--entryPoints.web.http.redirections.entrypoint.scheme=https"
#      - "--entrypoints.web.http.redirections.entrypoint.permanent=true"

      ## Docker / Podman Intergration
      - "--providers.docker=true"
      - "--providers.docker.exposedByDefault=false"
      - "--providers.docker.watch=false"
      - "--providers.docker.swarmMode=false"
      - "--providers.docker.endpoint=unix:///var/run/docker.sock"
      - "--providers.file.filename=/whoami.yml"

      # Crowdsec Plugin
      - "--experimental.plugins.crowdsec-bouncer-traefik-plugin.moduleName=github.com/maxlerebourg/crowdsec-bouncer-traefik-plugin"
      - "--experimental.plugins.crowdsec-bouncer-traefik-plugin.version=v1.2.0" # Version Must be manually updated

      ## Other
      # ...
      - "--serversTransport.insecureSkipVerify=true"

      # No Telemetry
      - "--global.sendAnonymousUsage=false"

  whoami1:
    image: traefik/whoami
    container_name: "simple-service-foo"
    networks:
      - traefik

  crowdsec:
    image: crowdsecurity/crowdsec:v1.6.0
    container_name: "crowdsec"
    hostname: crowdsec
    restart: unless-stopped
    environment:
      COLLECTIONS: crowdsecurity/traefik crowdsecurity/appsec-virtual-patching
      CUSTOM_HOSTNAME: crowdsec
      # We need to register one api key per service we will use
      BOUNCER_KEY_test: XXXXXXXXXXXXXXXXXXXXXXX
    volumes:
      - ./acquis.yaml:/etc/crowdsec/acquis.yaml:ro
      - logs:/var/log/traefik:ro
    labels:
      - "traefik.enable=false"
    networks:
      - traefik

volumes:
  logs:

# Dynamic configuration

http:
  routers:
    my-router:
      rule: PathPrefix(`/foo`)
      service: service-foo
      entryPoints:
        - web
      middlewares:
        - crowdsec

  services:
    service-foo:
      loadBalancer:
        servers:
          - url: http://<IP_ADDRESS>:80

  middlewares:
    crowdsec:
      plugin:
        crowdsec-bouncer-traefik-plugin:
          enabled: true
          logLevel: DEBUG
          updateIntervalSeconds: 60
          defaultDecisionSeconds: 60
          httpTimeoutSeconds: 10
          crowdsecMode: live
          crowdsecAppsecEnabled: false
          crowdsecAppsecHost: crowdsec:7422
          crowdsecAppsecFailureBlock: true
          crowdsecLapiKey: XXXXXXXXXXXXXXXXXXXXXXX
          crowdsecLapiHost: crowdsec:8080
          crowdsecLapiScheme: http

---
filenames:
 - /var/log/traefik/access.log
labels:
  type: traefik

---
listen_addr: <IP_ADDRESS>:7422
appsec_config: crowdsecurity/virtual-patching
name: myAppSecComponent
source: appsec
labels:
  type: appsec

Create thoses 3 files and launch a terminal in the same path.
``̀`bash
docker compose up -d
docker-compose logs traefik -f
docker-compose logs crowdsec -f

Then access:

http://localhost/foo to test the whoami service

In Traefik logs you should see something like this:

time="2024-02-26T18:39:34Z" level=info msg="Configuration loaded from flags."
DEBUG: CrowdsecBouncerTraefikPlugin: 2024/02/26 18:39:34 No IP provided for ForwardedHeadersTrustedIPs
DEBUG: CrowdsecBouncerTraefikPlugin: 2024/02/26 18:39:34 No IP provided for ClientTrustedIPs
DEBUG: CrowdsecBouncerTraefikPlugin: 2024/02/26 18:39:34 getTLSConfigCrowdsec:CrowdsecLapiScheme https:no
DEBUG: CrowdsecBouncerTraefikPlugin: 2024/02/26 18:39:34 cache:New initialized isRedis:false
DEBUG: CrowdsecBouncerTraefikPlugin: 2024/02/26 18:39:34 New initialized mode:live
DEBUG: CrowdsecBouncerTraefikPlugin: 2024/02/26 18:39:43 ServeHTTP ip:<IP_ADDRESS> isTrusted:false
DEBUG: CrowdsecBouncerTraefikPlugin: 2024/02/26 18:39:43 cache:GetDecision ip:<IP_ADDRESS>
DEBUG: CrowdsecBouncerTraefikPlugin: 2024/02/26 18:39:43 ServeHTTP:getDecision ip:<IP_ADDRESS> isBanned:false cache:miss
DEBUG: CrowdsecBouncerTraefikPlugin: 2024/02/26 18:39:43 ServeHTTP:handleNoStreamCache ip:<IP_ADDRESS> isBanned:true crowdsecQuery url:http://crowdsec:8080/v1/decisions?ip=<IP_ADDRESS>&banned=true, statusCode:403
DEBUG: CrowdsecBouncerTraefikPlugin: 2024/02/26 18:39:51 ServeHTTP ip:<IP_ADDRESS> isTrusted:false
DEBUG: CrowdsecBouncerTraefikPlugin: 2024/02/26 18:39:51 cache:GetDecision ip:<IP_ADDRESS>
DEBUG: CrowdsecBouncerTraefikPlugin: 2024/02/26 18:39:51 ServeHTTP:getDecision ip:<IP_ADDRESS> isBanned:false cache:miss
DEBUG: CrowdsecBouncerTraefikPlugin: 2024/02/26 18:39:51 ServeHTTP:handleNoStreamCache ip:<IP_ADDRESS> isBanned:true crowdsecQuery url:http://crowdsec:8080/v1/decisions?ip=<IP_ADDRESS>&banned=true, statusCode:403
DEBUG: CrowdsecBouncerTraefikPlugin: 2024/02/26 18:44:22 ServeHTTP ip:<IP_ADDRESS> isTrusted:false
DEBUG: CrowdsecBouncerTraefikPlugin: 2024/02/26 18:44:22 cache:GetDecision ip:<IP_ADDRESS>
DEBUG: CrowdsecBouncerTraefikPlugin: 2024/02/26 18:44:22 ServeHTTP:getDecision ip:<IP_ADDRESS> isBanned:false cache:miss
DEBUG: CrowdsecBouncerTraefikPlugin: 2024/02/26 18:44:22 ServeHTTP:handleNoStreamCache ip:<IP_ADDRESS> isBanned:true crowdsecQuery url:http://crowdsec:8080/v1/decisions?ip=<IP_ADDRESS>&banned=true, statusCode:403
DEBUG: CrowdsecBouncerTraefikPlugin: 2024/02/26 18:44:24 ServeHTTP ip:<IP_ADDRESS> isTrusted:false
DEBUG: CrowdsecBouncerTraefikPlugin: 2024/02/26 18:44:24 cache:GetDecision ip:<IP_ADDRESS>
DEBUG: CrowdsecBouncerTraefikPlugin: 2024/02/26 18:44:24 ServeHTTP:getDecision ip:<IP_ADDRESS> isBanned:false cache:miss
DEBUG: CrowdsecBouncerTraefikPlugin: 2024/02/26 18:44:24 ServeHTTP:handleNoStreamCache ip:<IP_ADDRESS> isBanned:true crowdsecQuery url:http://crowdsec:8080/v1/decisions?ip=<IP_ADDRESS>&banned=true, statusCode:403
DEBUG: CrowdsecBouncerTraefikPlugin: 2024/02/26 18:45:59 ServeHTTP ip:<IP_ADDRESS> isTrusted:false
DEBUG: CrowdsecBouncerTraefikPlugin: 2024/02/26 18:45:59 cache:GetDecision ip:<IP_ADDRESS>
DEBUG: CrowdsecBouncerTraefikPlugin: 2024/02/26 18:45:59 ServeHTTP:getDecision ip:<IP_ADDRESS> isBanned:false cache:miss
DEBUG: CrowdsecBouncerTraefikPlugin: 2024/02/26 18:45:59 cache:SetDecision ip:<IP_ADDRESS> isBanned:false duration:60s
``

Hi @mathieuHa . Thank you for your quick reply. I hope I can try it tomorrow in the morning.
What is acquis.yml though ? And where should I place it exactly ? I don't see it referenced in the compose.yml files.

Hi @mathieuHa . Thank you for your quick reply. I hope I can try it tomorrow in the morning.
What is acquis.yml though ? And where should I place it exactly ? I don't see it referenced in the compose.yml files.

Hey,
It's used by Crowdsec in the docker-compose as a file mounted for basic configuration to enable traefik log parsing and appsec enablement like this:
 crowdsec:
    image: crowdsecurity/crowdsec:v1.6.0
    container_name: "crowdsec"
    hostname: crowdsec
    restart: unless-stopped
    environment:
      COLLECTIONS: crowdsecurity/traefik crowdsecurity/appsec-virtual-patching
      CUSTOM_HOSTNAME: crowdsec
      # We need to register one api key per service we will use
      BOUNCER_KEY_test: XXXXXXXXXXXXXXXXXXXXXXX
    volumes:
      - ./acquis.yaml:/etc/crowdsec/acquis.yaml:ro
      - logs:/var/log/traefik:ro
    labels:
      - "traefik.enable=false"
    networks:
      - traefik

Just for context, in Traefik logs:
DEBUG: CrowdsecBouncerTraefikPlugin: 2024/02/26 18:44:22 ServeHTTP:handleNoStreamCache ip:<IP_ADDRESS> isBanned:true crowdsecQuery url:http://crowdsec:8080/v1/decisions?ip=<IP_ADDRESS>&banned=true, statusCode:403
DEBUG: CrowdsecBouncerTraefikPlugin: 2024/02/26 18:44:24 ServeHTTP ip:<IP_ADDRESS> isTrusted:false
DEBUG: CrowdsecBouncerTraefikPlugin: 2024/02/26 18:44:24 cache:GetDecision ip:<IP_ADDRESS>
DEBUG: CrowdsecBouncerTraefikPlugin: 2024/02/26 18:44:24 ServeHTTP:getDecision ip:<IP_ADDRESS> isBanned:false cache:miss
DEBUG: CrowdsecBouncerTraefikPlugin: 2024/02/26 18:44:24 ServeHTTP:handleNoStreamCache ip:<IP_ADDRESS> isBanned:true crowdsecQuery url:http://crowdsec:8080/v1/decisions?ip=<IP_ADDRESS>&banned=true, statusCode:403
DEBUG: CrowdsecBouncerTraefikPlugin: 2024/02/26 18:45:59 ServeHTTP ip:<IP_ADDRESS> isTrusted:false
DEBUG: CrowdsecBouncerTraefikPlugin: 2024/02/26 18:45:59 cache:GetDecision ip:<IP_ADDRESS>
DEBUG: CrowdsecBouncerTraefikPlugin: 2024/02/26 18:45:59 ServeHTTP:getDecision ip:<IP_ADDRESS> isBanned:false cache:miss
DEBUG: CrowdsecBouncerTraefikPlugin: 2024/02/26 18:45:59 cache:SetDecision ip:<IP_ADDRESS> isBanned:false duration:60s

At first I had a 403 between traefik and crowdsec because my configuration had a wrong token, but then I fixed and and checked it so last part of log shows working request.

OK super, I'll check tomorrow :+1: .
I'm still a bit skeptical about the part of configuring the middleware in each container instead as part of traefik dynamic configuration. Something doesn't feel right there. Like if I have 10 containers that need to use crowdsec I would need to configure 10 middleware all with the same settings in 10 different files.
That's why I thought that defining it once in the (dynamic) traefik config would have been enough.
But maybe I miss something ...

I gave it a try ... I am also a bit confused about the part
# We need to register one api key per service we will use
      BOUNCER_KEY_test

per service ? I thought BOUNCER_KEY_TRAEFIK was a "reserved name".
podman logs traefik-basic-example gives:
time="2024-02-27T06:23:26Z" level=info msg="Configuration loaded from flags."
DEBUG: CrowdsecBouncerTraefikPlugin: 2024/02/27 06:23:33 No IP provided for ForwardedHeadersTrustedIPs
DEBUG: CrowdsecBouncerTraefikPlugin: 2024/02/27 06:23:33 No IP provided for ClientTrustedIPs
DEBUG: CrowdsecBouncerTraefikPlugin: 2024/02/27 06:23:33 getTLSConfigCrowdsec:CrowdsecLapiScheme https:no
DEBUG: CrowdsecBouncerTraefikPlugin: 2024/02/27 06:23:33 cache:New initialized isRedis:false
DEBUG: CrowdsecBouncerTraefikPlugin: 2024/02/27 06:23:33 New initialized mode:live
DEBUG: CrowdsecBouncerTraefikPlugin: 2024/02/27 06:23:33 No IP provided for ForwardedHeadersTrustedIPs
DEBUG: CrowdsecBouncerTraefikPlugin: 2024/02/27 06:23:33 No IP provided for ClientTrustedIPs
DEBUG: CrowdsecBouncerTraefikPlugin: 2024/02/27 06:23:33 getTLSConfigCrowdsec:CrowdsecLapiScheme https:no
DEBUG: CrowdsecBouncerTraefikPlugin: 2024/02/27 06:23:33 cache:New initialized isRedis:false
DEBUG: CrowdsecBouncerTraefikPlugin: 2024/02/27 06:23:33 New initialized mode:live
DEBUG: CrowdsecBouncerTraefikPlugin: 2024/02/27 06:24:41 ServeHTTP ip:<IP_ADDRESS> isTrusted:false
DEBUG: CrowdsecBouncerTraefikPlugin: 2024/02/27 06:24:41 cache:GetDecision ip:<IP_ADDRESS>
DEBUG: CrowdsecBouncerTraefikPlugin: 2024/02/27 06:24:41 ServeHTTP:getDecision ip:<IP_ADDRESS> isBanned:false cache:miss
DEBUG: CrowdsecBouncerTraefikPlugin: 2024/02/27 06:24:41 ServeHTTP:handleNoStreamCache ip:<IP_ADDRESS> isBanned:true crowdsecQuery url:http://crowdsec:8080/v1/decisions?ip=<IP_ADDRESS>&banned=true Get "http://crowdsec:8080/v1/decisions?ip=<IP_ADDRESS>&banned=true": dial tcp <IP_ADDRESS>:8080: connect: connection refused

Crowdsec logs:
crowdsec.log
Not sure, but at least looking at the traefik logs, it seems to load it ?
I cannot access through localhost as this is hosted through a VPS, I had to access through xx.MYDOMAIN.TLD/foo.
Not sure if that causes some differences ?
From within the VPS I tried to run curl -s -o /dev/null -I -w "%{http_code}" http://localhost/foo and I get 403 (forbidden).

OK super, I'll check tomorrow 👍 .
I'm still a bit skeptical about the part of configuring the middleware in each container instead as part of traefik dynamic configuration. Something doesn't feel right there. Like if I have 10 containers that need to use crowdsec I would need to configure 10 middleware all with the same settings in 10 different files.
That's why I thought that defining it once in the (dynamic) traefik config would have been enough.
But maybe I miss something ...

You're absolutely right.
The middleware should be defined only once in the dynamic configuration.
I even think declaring some parameters multiple time for the same middleware name and different argument would be overwritten depending on the order it's loaded.

Note that declaring multiple middleware crowdsec with different names and configuration is also not supported by this plugin as mentionned here:
https://github.com/maxlerebourg/crowdsec-bouncer-traefik-plugin?tab=readme-ov-file#note

I believe it's better to declare it outside of a service so you can use it in multiple services without confusion.
I'll adapt the docker-compose from my comment tonight with this addition

I gave it a try ... I am also a bit confused about the part
# We need to register one api key per service we will use
      BOUNCER_KEY_test

You can see in the entrypoint of Crowdsec container https://github.com/crowdsecurity/crowdsec/blob/8e9e091656f2a72a37e21c173ed0c2015e97e726/docker/docker_start.sh#L387 or in the dockerhub README if you prefer
that we can use any name after CROWDSEC_BOUNCER_*

From this log:
DEBUG: CrowdsecBouncerTraefikPlugin: 2024/02/27 06:24:41 ServeHTTP:handleNoStreamCache ip:<IP_ADDRESS> isBanned:true crowdsecQuery url:http://crowdsec:8080/v1/decisions?ip=<IP_ADDRESS>&banned=true Get "http://crowdsec:8080/v1/decisions?ip=<IP_ADDRESS>&banned=true": dial tcp <IP_ADDRESS>:8080: connect: connection refused
We see that the plugin did started but it has trouble reaching Crowdsec container.
Many things can happen here:

DNS resolution (seems ok since it resolved the IP)
networking (are both container in the traefik network ?) use docker inspect to see the ip of each container

From within the VPS I tried to run curl -s -o /dev/null -I -w "%{http_code}" http://localhost/foo and I get 403 (forbidden).

This is normal when the plugin cannot reach crowdsec as a security mesure everything is blocked (configurable with a configuration var in the plugin)

OKay I see from your crowdsec logs
time="2024-02-27T06:23:49Z" level=info msg="loading acquisition file : /etc/crowdsec/acquis.yaml"
time="2024-02-27T06:23:49Z" level=fatal msg="crowdsec init: while loading acquisition config: failed to yaml decode /etc/crowdsec/acquis.yaml: yaml: input error: read /etc/crowdsec/acquis.yaml: is a directory"
Crowdsec is crashing and restarting so that cannot help Traefik contact him
Here the problem is the mounting option, podman attach aquis.yaml as a directory and not only the file.
It is pretty common issue but i'm not an expert on podman.
In docker using :
volumes:       - ./acquis.yaml:/etc/crowdsec/acquis.yaml:ro
is enough, but you might create a container crowdsec and add the file in it and then bind mount the folder

I believe it's better to declare it outside of a service so you can use it in multiple services without confusion.

I'll adapt the docker-compose from my comment tonight with this addition

I just checked and the conf I proposed in the previous comments was already independent from any services and thus can be used in any service.
Example like this foo and bar whoami.
http:
  routers:
    my-router-foo:
      rule: PathPrefix(`/foo`)
      service: service-foo
      entryPoints:
        - web
      middlewares:
        - crowdsec

  services:
    service-foo:
      loadBalancer:
        servers:
          - url: http://<IP_ADDRESS>:80

  routers:
    my-router-bar:
      rule: PathPrefix(`/bar`)
      service: service-bar
      entryPoints:
        - web
      middlewares:
        - crowdsec

  services:
    service-bar:
      loadBalancer:
        servers:
          - url: http://<IP_ADDRESS>:80

We need to register one api key per service we will use
This is a something that should have disapeared a long time ago, as it is not true.
I will update the documentation accordingly.


PhoneGap build

So, why to use this plugin when there is no option for building .apk file and instaling on phone?
Or its maybe possible to use this with javascript code and build .apk?
I only need this plugin becouse google android map sdk allow compass mode...

This plugin does not support PhoneGap Build, because this plugin uses native Android Google Maps Android API v2 (Java) and Google Maps SDK for iOS (Objective-C).
PhoneGap Build does not allow to use these binary libraries.
https://github.com/wf9a5m75/phonegap-googlemaps-plugin/wiki/Phonegap-Usage#phonegap-build-is-not-available

Phonegap Build has already supported such plugins:
http://phonegap.com/blog/2014/12/09/phonegap-build-new-features/

Oh, I didn't know that! It's really good news!

But I tried it, map isn't shown :(
In logcat I see these lines:
E/GooglePlayServicesUtil(21116): The Google Play services resources were not fou
nd. Check your project configuration to ensure that the resources are included.
E/GooglePlayServicesUtil(21116): The Google Play services resources were not fou
nd. Check your project configuration to ensure that the resources are included.
W/dalvikvm(21116): VFY: unable to resolve static field 2499 (MapAttrs) in Lcom/g
oogle/android/gms/R$styleable;
W/CordovaPlugin(21116): Attempted to send a second callback for ID: GoogleMaps18
17103905
W/CordovaPlugin(21116): Result was: "No result"

Probably the version of the google play services plugin is mismatch. This plugin still uses v21.
(Updating v22 is under construction)

And approximately when it will be ready?

I have no idea, unfortunately.

Ok, thanks. But it doesn't work on IOS too.

You know, I haven't tested Phonegap build at all. And I'm really busy. Please wait.

@aramgev
According to #411 , @MichaelGooden uses this plugin on PhoneGap.
I merge this issue to #411


Improve verifications to verify rollout deployments

This PR uses the same algorithm as "kubectl rollout status" for the verification of rollout deployments.
Fixes https://github.com/jenkinsci/google-kubernetes-engine-plugin/issues/119

[X] Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
[X] Ensure that the pull request title represents the desired changelog entry
[X] Please describe what you did
[X] Link to relevant issues in GitHub or Jira
[X] Link to relevant pull requests, esp. upstream and downstream changes
[X] Ensure you have provided tests - that demonstrates feature works or fixes the issue

@olamy ping


Full Clone of ESP Matter SDK takes lot of time to pull all submodules and consumes GB's of memory in laptop  (CON-383)

Hi,
I downloaded the latest ESP Matter SDK version (using the shallow clone and without any install commands). I uploaded the matter SDK as it is into our git repository hosted in bitbucket. When I tried to download the Esp Matter SDK from our bitbucket repo and tried to install matter tools by running ./install.sh in the esp-matter folder, I got the error saying [not a valid git repository](fatal: not a git repository: /esp-matter/connectedhomeip/connectedhomeip/../../.git/modules/connectedhomeip/connectedhomeip).  If I clone ESP Matter SDK manually from the git hub, it works fine. Not sure What am I missing here. Any thoughts?
git clone --depth 1 https://github.com/espressif/esp-matter.git
cd esp-matter
git submodule update --init --depth 1
cd connectedhomeip/connectedhomeip
./scripts/checkout_submodules.py --platform esp32 --shallow

I tried with the full clone of ESP matter SDK which takes almost 14 GB of disk memory and almost takes 20-30 minutes
 git clone --recursive https://github.com/espressif/esp-matter.git
Is there any way we can clone the light version of ESP matter SDK by stripping off unnecessary modules/third-party libraries I want to upload this light version of ESP matter SDK in to bitbucket repository.

I didn't meet the error [not a valid git repository](fatal: not a git repository: /esp-matter/connectedhomeip/connectedhomeip/../../.git/modules/connectedhomeip/connectedhomeip), Currently we have an issue for install.sh, which is that we does not checkout submodule libwebsockets required by chip-tool.
I am not sure why you have the error. Here are my steps:
git clone --depth 1 https://github.com/espressif/esp-matter.git
cd esp-matter
git submodule update --init --depth 1
cd connectedhomeip/connectedhomeip
./scripts/checkout_submodules.py --platform esp32 --shallow
git submodule update --init third_party/libwebsockets/repo
cd ../..
./install.sh

I downloaded the latest ESP Matter SDK version (using the shallow clone and without any install commands).

How did you download this? If you download it as a zip, then it won't have git and none of the git commands would work. Hence the error is expected. To confirm, please check for .git folder inside esp-matter.

@dhrishi Here are the steps

Clone the latest ESP-Matter SDK by running the below commands
git clone --depth 1 https://github.com/espressif/esp-matter.git cd esp-matter git submodule update --init --depth 1 cd connectedhomeip/connectedhomeip ./scripts/checkout_submodules.py --platform esp32 --shallow

I can see.git folder inside the esp-matter folder after the clone. Now, I am pushing this ESP-Matter SDK to the bitbucket repo for our development

Now, the cloning the ESP-Matter SDK from out bitbucket repo and trying to run ./install.sh. It shows failure.  (I also noticed the .git folder is also not created when cloned from bitbucket repo)

(Note: I am able to install all the tools and run the examples if cloned directly from github i.e. as i mentioned in step 1)

Files starting with . are hidden files, and all the git config are inside .git, I guess when you ran git add command it failed to add those files and thats why you are seeing it as that error.
Why don't you add the esp-matter as a submodule? It would save space as well as easy to maintain.

@shubhamdp can you provide steps for linking specific version of esp-matter SDK as submodule?

You can find the detailed documentation here https://git-scm.com/book/en/v2/Git-Tools-Submodules.
git submodule add https://github.com/espressif/esp-matter.git
# check git status, there will be two files staged to commit, `.gitmodules` and esp-matter (submodule)
# commit them

@shubhamdp Thanks for the details.
We are using a shallow clone for ESP32 platform so that required modules will be pulled out from github. otherwise, it takes a lot of time to clone the full repo of the ESP matter SDK
Here is the script we are using right now for shallow clone
git clone --depth 1 https://github.com/espressif/esp-matter.git cd esp-matter git submodule update --init --depth 1 cd connectedhomeip/connectedhomeip ./scripts/checkout_submodules.py --platform esp32 --shallow git submodule update --init third_party/libwebsockets/repo

This is what we have been suggesting in our programming guide. What is the problem with above steps? And I cannot think a way to optimize this further right now.
One think that you can do is, since .git folder will be big in size you can download a zip for source code and then unpack it and upload that, but tracking the changes will be upto you.

@shubhamdp
We are facing issues while setting target to esp32c3 with matter example. When we looked carefully, we noticed that mmb

@aggaddam Were you able to solve this issue?

@dhrishi It was not solved. I raised a separate issue in esd-idf repository. Here is the link
https://github.com/espressif/esp-idf/issues/11152

Okay. Thanks! If it is being tracked there, would you mind closing it here?


Update Grammar in index.html

Updated Grammar and changed a few words around in index.html to make it read a bit better.

Is a simple change that I trust, so will squash and merge


Django createsuperuser from Ansible

Currently I have to create the Ideascube superuser manually.
From CLI : ideascube createsuperuser, Django prompt for superuser password.
I need to find a work around to be able to set the password from Ansible.
Here is the Ansible django module : http://docs.ansible.com/ansible/django_manage_module.html

+1

The ideascube interface ask now to create a user and password. This is done at first connection.


serve with hot reload error

when run npm run dev
error msg：
Starting electron...

electron  events.js:160
                throw er; // Unhandled 'error' event
                ^

          Error: spawn /Users/lidashuang/code/cc_activity/node_modules/electron-prebuilt/dist/Electron.app/Contents/MacOS/Electron ENOENT
              at exports._errnoException (util.js:1026:11)
              at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
              at onErrorNT (internal/child_process.js:359:16)
              at _combinedTickCallback (internal/process/next_tick.js:74:11)
              at process._tickCallback (internal/process/next_tick.js:98:9)
              at Module.runMain (module.js:609:11)
              at run (bootstrap_node.js:382:7)
              at startup (bootstrap_node.js:137:9)
              at bootstrap_node.js:497:3

development environment.

Node version: v7.0.0
NPM version: 3.10.8
Operating System: macOS

Could you give this try on an earlier node version? There are some cases where some packages loose functionality if node releases some breaking changes.

Closing for now. Feel free to comment back.


OmniSharp server is not running.

Unable to generate assets to build and debug. OmniSharp server is not running. pls help! also the Activation time : 319ms! how to fix! pls help

Please provide the full logs, without them we are just guessing. Is this on Windows?

Closing due to lack of response.


Keycloak realm import automation

Addresses https://github.com/spiffe/tornjak/issues/229

Add tornjak realm json
Import tornjak realm before the image starts
Build with docker compose -f docker-compose-keycloak.yml up --build

Moved to https://github.com/spiffe/tornjak/pull/238


occasional key error when building score tables

Here's the error trace:

Depth=2, working on node 9: 100%|████████████████████████| 10/10 [00:00<00:00, 2662.88it/s]
Context score tables: 100%|████████████████████████████| 10/10 [00:00<00:00, 129.15it/s]
Creating #stagings tables: 100%|█████████████████████████| 10/10 [00:00<00:00, 8328.64it/s]
Order score tables:  60%|███████████████████▌              | 6/10 [00:00<00:00, 405.12it/s]
Traceback (most recent call last):
File "", line 17, in __PYTHON_EL_eval
File "/home/alex/projects/cstrees/code/bug_report/reproduce_bug.py", line 28, in
est = learn_synth_cstree(data)
File "/home/alex/projects/cstrees/code/bug_report/reproduce_bug.py", line 13, in learn_synth_cstree
score_table, context_scores, _ = sc.order_score_tables(
File "/home/alex/projects/cstrees/code/src/cstrees/scoring.py", line 521, in order_score_tables
staging_unnorm_post += context_scores["scores"][var][stage_context]
KeyError: '0=1,3=1'

I've saved the data set that resulted in this, and wrote a minimal script to reproduce it. I'll push them to a branch now.

fixed in commit 696a7ab


Media sections in answer do not match offer

Hello!
Trying to run the example code I get the following error from aiortc:
ValueError: Media sections in answer do not match offer
Not sure what exactly causes this problem, but maybe it is possible to find what is wrong.
Thanks in advance!

I ran into the same issue, which might not be one for you anymore. I came across this, when I subscribed to an audio stream, unsubscribed and later subscribed to a video stream. I could narrow down this to some point, but it seems, that the consumer joins a stale RTP stream, that's why it forms an answer, which doesn't match the offered media...
But I couldn't solve this. If I always stick with the same media type, that problem doesn't happen

Oh, a second after my first post I think I found the answer. The reason is the attempt to recycle some old "closedMediaSections".
https://github.com/skymaze/pymediasoup/blob/6fd3564ed690fe59ab886334fe136bca84648a7e/pymediasoup/handlers/sdp/remote_sdp.py#L169
See, if you can comment 170 to 173 and if this solves your problem.

Thanks!
However, it has been a while since I moved from that project, so I guess it's best to close this issue.

May I ask what you did choose in replacement?

In my case Jitsi with some minor changes worked just fine

So you dropped MediaSoup, I guess? I'm pretty happy with that (replaced Kurento Media Server). Having clients for Web, Android and now for Python. Thanks for the details. Have a nice weekend.
BTW: This lib is pretty good, though

Yep, dropped mediasoup. This lib is good, that's true.
Have a nice weekend.


WASD Controls

Sometimes moving around using the mouse to navigate is clunky, especially on laptops. It might be good to have something like WASD controls for moving forward/right/back/left.
We just have to avoid conflicting keybindings that may be more useful.

Done in #218


Looks like the code is about to be released, can my 4090 card work? What is the minimum vram? Thank you very much

Your GPU should work fine. I tested with RTX 4090 myself.


Strange output of HomogeneousPointTestSuite.testHpoints

When I run this test it outputs stuff like:
[----------] 1 test from HomogeneousPointTestSuite
[ RUN      ] HomogeneousPointTestSuite.testHpoints
*** Validation failed on _ph:
0.114507
-0.416342
0.596963
-0.676153
other:
0
0
0
1
at bool sm::kinematics::HomogeneousPoint::isBinaryEqual(const sm::kinematics::HomogeneousPoint&) const In: /home/hannes/ros/schweizer_messer/sm_kinematics/src/HomogeneousPoint.cpp:221

*** Validation failed on _ph:
0
0
0
1
other:
0.114507
-0.416342
0.596963
-0.676153
at bool sm::kinematics::HomogeneousPoint::isBinaryEqual(const sm::kinematics::HomogeneousPoint&) const In: /home/hannes/ros/schweizer_messer/sm_kinematics/src/HomogeneousPoint.cpp:221

....

but in the end the test passes! This seems wrong. I already went back up to  3299e3234c144e843ccdeb3c8e608c0695cfbb1b: Same behavior.

Apparently this is solved.


[*] Websites Available:
Comidoc
Discudemy
Udemy Freebies
Udemy Coupons
Real Discount
Tricks Info
Free Web Cart
Course Mania
Jojo Coupons
------->> Comidoc <<-------
Expecting value: line 1 column 1 (char 0)
Traceback (most recent call last):
File "udemy.py", line 315, in main
File "udemy.py", line 23, in
File "pack\functions.py", line 260, in comidoc
File "requests\models.py", line 898, in json
File "json_init_.py", line 357, in loads
File "json\decoder.py", line 337, in decode
File "json\decoder.py", line 355, in raw_decode
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "udemy.py", line 324, in
File "udemy.py", line 321, in main
NameError: name 'exit' is not defined
[44116] Failed to execute script udemy

Download the new one


[Enhancement] Add NumberOfTapsRequired property in TouchEffect

Summary
My suggestion would be to add a new property called NumberOfTapsRequired to the TouchEffect, similar to the one that the gesture recognizer has to establish how many clicks are necessary for the associated command to be executed.
API Changes
e.g.
<StackLayout xct:TouchEffect.Command="{Binding SampleCommand}"
             xct:TouchEffect.CommandParameter="{Binding .}"
             xct:NumberOfTapsRequired="2">

Intended Use Case
This functionality could be used in countless cases.
Who Will Do The Work?

[x]  Just putting this out there for someone to pick up

Thanks! However, we are no longer adding new features to Xamarin Community Toolkit, focusing on the .NET MAUI Community Toolkit.
Please open a New Feature Discussion to implement this feature in the .NET MAUI Community Toolkit.
I've posted more information about the Future Of Xamarin Community Toolkit here: https://devblogs.microsoft.com/xamarin/the-future-of-xamarin-community-toolkit/?WT.mc_id=mobile-0000-bramin


I can't seem to find the JAR file...

Am I blind?

You can find the executable JAR file on the releases page :smile:

You can find the executable JAR file on the releases page 😄

Ugh, how stupid of me. Thanks, I am quite new to GitHub.
I don't want to have the same struggle again when I want to download something from GitHub. Could you tell me how I can find the a releases page in a repository?

Yeah, GitHub's site design is unintuitive at best...
Here's the release page on the Desktop website: (I don't think they even show that link on mobile...)

Thank you very much :)


Total CPU not equal to the sum of different cpu usages

Hey, first, thanks for the great work, I've been working on a system with ROS lately and great to use your monitor.
I just have a slight question about it, my system is composed of multiple ROS nodes communicating, if I check cpu usage of each I find (12, 17, 30%....), however if I check the total_cpu I get 30% which doesn't fit the sum of all cpu usages (the sum exceeds way more).
Any possible explanation for this ?
Would be glad to get an answer.
Thanks a lot !

Well figure it out :

My board has 8 cores, so it considers each core to be 100%

weirdly with unitary nodes, the given usage is referenced to the 800% full cpu, means a node that displays a consumption of 30% is actually consuming 3.75%

However when it comes to total usage, it takes all 8 cores as 100%, means if I do the sum of my unitary usages then *100/800, I get the 30% as given.

Tadaa, and thanks !


Fix IntelliJValidatorOnMac validator

Description
IntelliJValidatorOnMac may fail when you get IDEA installed by JetBrains ToolBox

@c9n can you sign the CLA so we can proceed with this PR? This will also need tests, and perhaps a description of the logic you've updated in the validator

@googlebot I signed it!


[Bug] BlockBuilder cannot create an IRModule with multiple functions correctly.

The python BlockBuilder cannot create an IRModule with multiple functions correctly.
Steps to reproduce
import tvm
from tvm import tir
from tvm import relax as rx
from tvm.script import relax as R

bb = rx.BlockBuilder()
batch = tir.Var("batch", dtype="int64")
height = tir.Var("height", dtype="int64")
dtype0 = rx.DynTensorType(rank=3, dtype="float32")
a = rx.Var("a", [batch, height, 4], dtype0)
b = rx.Var("b", [batch, height, 4], dtype0)

with bb.function("func1", [a, b]):
    with bb.dataflow() as df:
        lv0 = bb.emit(rx.op.add(a, b))
        gv0 = bb.emit_output(lv0)
    bb.emit_func_output(gv0)

with bb.function("func2", [a, b]):
    with bb.dataflow() as df:
        lv0 = bb.emit(rx.op.add(a, b))
        gv0 = bb.emit_output(lv0)
    bb.emit_func_output(gv0)

print(R.parser.astext(bb.get()))

Actual behavior
This will produce the following IRModule:
@tvm.script.ir_module
class Module:
    @relax.function
    def func1(a: Tensor[(batch, height, 4), "float32"], b: Tensor[(batch, height, 4), "float32"]) -> Tensor[_, "float32"]:
        # block 0
        with relax.dataflow():
            lv: Tensor[(batch, height, 4), "float32"] = relax.add(a, b)
            gv: Tensor[(batch, height, 4), "float32"] = lv
            relax.output(gv)
        return gv

    @relax.function
    def func2(a: Tensor[(batch, height, 4), "float32"], b: Tensor[(batch, height, 4), "float32"]) -> Tensor[_, "float32"]:
        # block 0
        with relax.dataflow():
            lv: Tensor[(batch, height, 4), "float32"] = relax.add(a, b)
            gv: Tensor[(batch, height, 4), "float32"] = lv
            relax.output(gv)
        # block 1
        with relax.dataflow():
            lv1: Tensor[(batch, height, 4), "float32"] = relax.add(a, b)
            gv1: Tensor[(batch, height, 4), "float32"] = lv1
            relax.output(gv1)
        return gv1

Expected Behavior
However, I guess only block 1 is expected to appear in func2. This might be a bug in https://github.com/tlc-pack/relax/blob/afc3719c1fada5c0f7976f7eb8b931f96b026c00/python/tvm/relax/block_builder.py#L534-L537, where we only need to construct SeqExpr with block instead of self._blocks.

Hi @Robslhc, thanks for catching this bug! The cause of it is self._blocks is never reset after we compose the function in emit_func_output. We do need to construct SeqExpr with multiple blocks though, so I think we can just add self._blocks = [] after constructing the rx.Function. Would you like to submit a PR to fix this issue? :)
Also we can add asserts to check func1 and func2 both have 1 block in this test: https://github.com/tlc-pack/relax/blob/relax/tests/python/relax/test_blockbuilder.py#L133.