traefik / traefik-migration-tool

A migration tool from Traefik v1 to Traefik v2
https://docs.traefik.io/migration/v1-to-v2/
Apache License 2.0
151 stars 35 forks source link

acme subcommand generates invalid v2 acme.json #2

Closed zachreizner closed 4 years ago

zachreizner commented 4 years ago

I used the acme subcommand of this migration tool and then used the resulting acme-new.json with traefik v2. This would result in this error:

Unable to add ACME provider to the providers list: unable to get ACME account: json: cannot unmarshal array into Go value of type acme.StoredData
zachreizner commented 4 years ago

This problem seems to be caused by a disagreement between this tool's structure (acme.StoredData{}) of the acme.json and the structure used in traefik v2 (map[string]*StoredData{}).

As an experiment to confirm this, I manually wrapped the acme-new.json from this tool with a map with a single key:

{ "default": <output from traefik-migration-tool> }

This seems to work and traefik is up and running with the migrated certificate. I haven't tested if renewal will work yet.

ldez commented 4 years ago

Hello, could you give me the command that you are using?

zachreizner commented 4 years ago

I was using traefik-migration-tool acme without any extra parameters. I tried both the release binary and the master branch source but I got the same acme-new.json from both.

On Thu, Sep 19, 2019, 1:23 AM Ludovic Fernandez notifications@github.com wrote:

Hello, could you give me the command that you are using?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/containous/traefik-migration-tool/issues/2?email_source=notifications&email_token=AACHOZ3UZUY2IS6EPIOLZOTQKMZHXA5CNFSM4IYHS722YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7CUZQQ#issuecomment-533023938, or mute the thread https://github.com/notifications/unsubscribe-auth/AACHOZZIW23MGD5YCFTBMFLQKMZHXANCNFSM4IYHS72Q .

ldez commented 4 years ago

I see your problem, I will fix that.

ldez commented 4 years ago

Thanks for the issue :+1:

I fixed that in the version v0.4.0

And also with v0.4.0 you can provide a resolver name.

Note: the version will be published soon https://travis-ci.com/containous/traefik-migration-tool/builds/128305536