traefik: Traefik doesn't handle empty acme.json file well :)

Do you want to request a feature or report a bug?

BUG

What did you do?

had an empty acme.json file, had this:

What did you expect to see?

Working traefik… somehow

What did you see instead?

alse ProxyProtocol:<nil> ForwardedHeaders:0xc420625ba0} with readTimeout=0s writeTimeout=0s idleTimeout=3m0s" 
time="2018-04-05T07:46:06Z" level=info msg="Loading ACME Account..." 
time="2018-04-05T07:46:06Z" level=error msg="Error creating TLS config: unexpected end of JSON input" 
time="2018-04-05T07:46:06Z" level=fatal msg="Error preparing server: unexpected end of JSON input" 

Output of traefik version: (What version of Traefik are you using?)

latest

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 1
  • Comments: 16 (4 by maintainers)

Most upvoted comments

Got the same problem with 1.6.3 and 1.6 and in 1.5 level=error msg="Failed to read new account, ACME data conversion is not available : open '/etc/traefik/acme/acme.json': no such file or directory"

Hello guys,

Many thanks for your interest in the project.

@sokoow : Your issue seems to be a bug fixed in v1.6-RC1. If you are using an older version you can

  • Upgrade the Træfik version
  • Or edit your acme.json file to add {}.

@tha80, @timothyallan, @nathanaherne : The error message appears when the acme.json cannot be opened by Træfik. Can you provide your entire configuration (Træfik options and Docker) in the way to reproduce the issue?

Thanks in advance.

EDIT : Issue reproduced, fix is coming ASAP.

@holms try setting your storage to not start with / here’s the snipet from my docker-compose.yml

  traefik:
    image: traefik:alpine
    command:
    - --defaultEntryPoints=http,https
    - --insecureSkipVerify
    - "--entryPoints=Name:http Address::80 Compress:true Redirect.entryPoint:https"
    - "--entryPoints=Name:https Address::443 Compress:true TLS"
    - --api
    - --ping
    - --docker
    - --docker.exposedByDefault=false
    - --docker.swarmMode
    - --docker.watch
    - --acme
    - --acme.email=xxxx@xxxx.com
    - --acme.onhostrule
    - --acme.entrypoint=https
    - --acme.httpchallenge
    - --acme.httpchallenge.entrypoint=http
    - --acme.storage=etc/traefik/acme/acme.json
    volumes:
    - /var/run/docker.sock:/var/run/docker.sock:ro
    - /terraform/traefik:/etc/traefik/acme
    networks:
    - traefik