Failed to register default certificate on traefik

Hello together,

I have been trying to setup a default certificate to the traefik through file provider. I have added this as .yaml file,

tls:
stores:
default:
defaultCertificate:
certFile: /data/config/tls.crt
keyFile: /data/config/tls.key

The paths defined for cert is absolute path and once this file I am providing I am getting an error like below,

time="2022-06-07T05:12:32Z" level=error msg="Error during the build of the default TLS configuration: TLS store default not found" entryPointName=traefik
time="2022-06-07T05:12:32Z" level=error msg="Error during the build of the default TLS configuration: TLS store default not found" entryPointName=web
time="2022-06-07T05:12:32Z" level=error msg="Error during the build of the default TLS configuration: TLS store default not found" entryPointName=websecure
time="2022-06-07T05:12:32Z" level=error msg="Error during the build of the default TLS configuration: TLS store default not found" entryPointName=metrics.

Need some help!!! Thanks in advance.

PS: I am using v2.5.3 of traefik

This error message come from this code. It happens during the build of your store. It means Traefik cannot build it.

You may have an other error message explaining why. It may mean your cert files are not accessible. You have to use the path inside the container, not host path. For example, if you mount volumes like this :

 - "/data/config/:/config/

Then your path to cert should look like this

# Dynamic configuration
tls:
  stores:
    default:
      defaultCertificate:
        certFile: /config/tls.crt
        keyFile: /config/tls.key

Btw, you have a recent, full and detailed example on how to do it on Traefik Blog.

Hi, Thanks for the reply,

I have a pod running in kubernetes cluster with a pvc mounted at "/data" inside the traefix container, So, I am trying to load the certificates from there. I find no luck doing that. I am trying this with self signed certificate

I am registered to load dynamic config from "/data/config/tls_config.yaml" and in that I have the path like "/data/config/tls.*"

Moreover i see this error message when I try to load the page.

time="2022-06-09T13:43:58Z" level=debug msg="http: panic serving 10.6.0.91:46552: runtime error: invalid memory address or nil pointer dereference"
time="2022-06-09T13:43:58Z" level=debug msg="goroutine 855704 [running]:"
time="2022-06-09T13:43:58Z" level=debug msg="net/http.(*conn).serve.func1()"
time="2022-06-09T13:43:58Z" level=debug msg="\t/usr/local/golang/1.10.8/go/src/net/http/server.go:1801 +0xb9"
time="2022-06-09T13:43:58Z" level=debug msg="panic({0x2d787c0, 0x59307b0})"
time="2022-06-09T13:43:58Z" level=debug msg="\t/usr/local/golang/1.10.8/go/src/runtime/panic.go:1047 +0x266"
time="2022-06-09T13:43:58Z" level=debug msg="github.com/traefik/traefik/v2/pkg/tls.(*Manager).Get.func1(0xc000beadd0)"
time="2022-06-09T13:43:58Z" level=debug msg="\t/home/semaphore/go/src/github.com/traefik/traefik/pkg/tls/tlsmanager.go:162 +0x1be"

Do you have same behavior with v2.5.7 ? or superior ?