krakend / krakend-ce

KrakenD Community Edition: High-performance, stateless, declarative, API Gateway written in Go.

Home Page:https://www.krakend.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hot reloading not working - error parsing the configuration file, unexpected end of JSON input

domantaskudzius opened this issue · comments

Been having trouble getting hot reloading to work after switching from Docker to Docker Desktop on Ubuntu.

2023/12/07 16:39:46 KRAKEND INFO: [SERVICE: Gin] Listening on port: 8080
2023/12/07 16:39:46 KRAKEND DEBUG: [SERVICE: Gin][CORS] Enabled CORS for all requests
2023-12-07 16:40:06 [00] Killing service
2023/12/07 16:40:06 Signal intercepted: interrupt
2023/12/07 16:40:06 KRAKEND INFO: [SERVICE: Gin] Router execution ended
2023-12-07 16:40:06 [00] Starting service
2023-12-07 16:40:06 [00] ERROR parsing the configuration file: '/tmp/KrakenD_parsed_config_template_3702000700.json': unexpected end of JSON input, offset: 0, row: 0, col: 0

docker-compose.yml

version: "3"
services:
  krakend_ce:
    image: devopsfaith/krakend:watch
    container_name: api_gateway
    restart: "unless-stopped"
    volumes:
      - ./:/etc/krakend
    ports:
      - "8080:8080"
    command: ["run", "-c", "/etc/krakend/krakend.json"]
    environment:
      - FC_ENABLE=1
      - FC_SETTINGS=/etc/krakend/settings/development
      - API_APP_URL=api_app:8099
    networks:
      - shared_network
networks:
    shared_network:
        external: true

This issue was marked as resolved a long time ago and now has been automatically locked as there has not been any recent activity after it. You can still open a new issue and reference this link.

Hi @domantaskudzius
The log you are showing shows that the hot-reload is actually working because it sends the kill signal and restarts again. The problem is with the configuration you use, not with the watch container. It looks like it is receiving an empty file?