Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kutt Application Returns ERR_EMPTY_RESPONSE When Accessed via Traefik #834

Open
angeloluidens opened this issue Mar 4, 2025 · 0 comments

Comments

@angeloluidens
Copy link

angeloluidens commented Mar 4, 2025

Description

I am running a Dockerized Kutt application managed via Portainer and served through Traefik in a Docker Swarm setup. The Kutt application is accessible internally (e.g., via curl from within the container), but when accessed externally via the domain short.link', it returns an ERR_EMPTY_RESPONSEerror. The Traefik logs show no errors, and the Kutt application logs indicate that the service is running and listening on port3000`.


Steps to Reproduce

  1. Deploy the Kutt application using the provided Docker Compose script.
  2. Access the application via the configured domain (short.link).
  3. Observe the ERR_EMPTY_RESPONSE error in the browser.

Expected Behavior

The Kutt application should be accessible via the configured domain (short.link) and return the expected web interface.


Actual Behavior

The browser displays the following error:

This page isn’t working right now
short.link didn’t send any data.
ERR_EMPTY_RESPONSE

Environment

  • Kutt Version: kutt/kutt:latest (Docker image)
  • Docker Version: 20.10.12
  • Docker Swarm: Single-node setup
  • Traefik Version: v2.10
  • Portainer Version: 2.11.1
  • Operating System: Debian 12.5

Configuration

Docker Compose Script

version: '3.7'

services:
  kutt:
    image: kutt/kutt:latest
    depends_on:
      - mdb
      - redis
    environment:
      - SITE_NAME=MainDomain.Net
      - DEFAULT_DOMAIN=short.link
      - LINK_LENGTH=7
      - DISALLOW_ANONYMOUS_LINKS=true
      - DB_CLIENT=pg
      - DB_HOST=db
      - DB_PORT=5432
      - DB_NAME=kutt
      - DB_USER=user
      - DB_PASSWORD=password
      - JWT_SECRET="###########################################################"
    networks:
      - stack_proxy
      - privatenet
    deploy:
      mode: replicated
      replicas: 1
      update_config:
        order: start-first
      rollback_config:
        order: start-first
      labels:
        - "traefik.enable=true"
        - "traefik.docker.network=sgp_proxy"
        - "traefik.http.routers.kutt.rule=Host(`short.link`)"
        - "traefik.http.services.kutt.loadbalancer.server.port=3000"

networks:
  stack_proxy:
    external: true
  privatenet:
    internal: true

Troubleshooting Steps Taken

  1. Verified Network Connectivity:

    • Confirmed that the Traefik container can ping and access the Kutt container on port 3000.
    • Tested connectivity using curl from the Traefik container:
      curl -vI http://10.0.4.15:3000
      The Kutt application responds correctly internally.
  2. Checked Kutt Logs:

    • The Kutt logs show that the application is running and listening on port 3000:
      > Ready on http://localhost:3000
      
    • No errors or crashes are reported in the logs.
  3. Verified Traefik Configuration:

    • Traefik is correctly routing traffic to the Kutt container.
    • The Traefik dashboard shows that the kutt service is registered and healthy.
  4. Tested Database Connectivity:

    • Verified that the Kutt application can connect to the PostgreSQL database (db) and Redis.
    • Tested the database connection from another container:
      psql -h db -U user -d kutt
      redis-cli -h redis
  5. Simplified Configuration:

    • Removed all middleware and simplified the Traefik configuration to the bare minimum.
    • Temporarily disabled HTTPS and tested HTTP routing.
  6. Checked for Port Conflicts:

    • Confirmed that no other service is using port 3000.

Current State

  • The Kutt application is running and listening on port 3000.
  • Traefik is correctly routing traffic to the Kutt container.
  • The application is accessible internally but returns an ERR_EMPTY_RESPONSE error when accessed externally via the domain short.link.

Additional Information

  • Traefik Logs:

    time="2025-03-04T01:16:55Z" level=info msg="Configuration loaded from flags."
    

    No errors are reported in the Traefik logs.

  • Kutt Logs:

    > [email protected] migrate
    > knex migrate:latest
    Already up to date
    npm notice
    npm notice New major version of npm available! 10.9.2 -> 11.1.0
    npm notice Changelog: https://github.com/npm/cli/releases/tag/v11.1.0
    npm notice To update run: npm install -g [email protected]
    npm notice
    > [email protected] start
    > node server/server.js --production
    > Ready on http://localhost:3000
    

Request for Assistance

I would appreciate any guidance on resolving this issue. Specifically:

  1. Are there any known issues with running Kutt behind Traefik?
  2. Are there additional logs or debugging steps I can enable to identify the root cause?
  3. Are there any configuration changes required for Kutt to work correctly in this setup?

Thank you for your help!


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant