acmesh-official / acme.sh

A pure Unix shell script implementing ACME client protocol
https://acme.sh
GNU General Public License v3.0
39.26k stars 4.96k forks source link

dns_gcloud: fails when txt value starts with dash or underscore #3984

Open errrrata opened 2 years ago

errrrata commented 2 years ago

Steps to reproduce normal renewal or issuing, however it only happens randomly, when the generated txt value starts with dash or underscore

Debug log

Log anonymized with xxxxxxxx


"/root/.acme.sh/acme.sh" --cron --home "/root/.acme.sh" --config-home "/acme.sh"

---- it's a certificate with many domains, so I'm skipping --

[Wed Mar 16 21:36:38 UTC 2022] xxxxxxxx record added
[Wed Mar 16 21:36:38 UTC 2022] The txt record is added: Success.
[Wed Mar 16 21:36:38 UTC 2022] Adding txt value: XKEJOw8tGsGyyJ6HTvB14EC8t_2_2IKy1klhVSX7KnA for domain:  xxxxxxxx
[Wed Mar 16 21:36:38 UTC 2022] Using gcloud
Transaction started [/tmp/tmp.cRR9J7vmfP/tr.yaml].
Record removal appended to transaction at [/tmp/tmp.cRR9J7vmfP/tr.yaml].
Record addition appended to transaction at [/tmp/tmp.cRR9J7vmfP/tr.yaml].
Executed transaction [/tmp/tmp.cRR9J7vmfP/tr.yaml] for managed-zone [xxxxxxxx].
Created [https://dns.googleapis.com/dns/v1/projects/xxxxxxx/managedZones/xxxxxxxx/changes/371].
ID   START_TIME                STATUS
371  2022-03-16T21:36:45.748Z  pending
Listed 0 items.
[Wed Mar 16 21:36:49 UTC 2022] xxxxxxxx record added
[Wed Mar 16 21:36:49 UTC 2022] The txt record is added: Success.
[Wed Mar 16 21:36:49 UTC 2022] Adding txt value: -fafhnTHWHV427xobH9hwb4bts4-52PAtmFVvFxuBKI for domain:  xxxxxxxx
[Wed Mar 16 21:36:49 UTC 2022] Using gcloud
Transaction started [/tmp/tmp.oCUzqBMZ9F/tr.yaml].
Record removal appended to transaction at [/tmp/tmp.oCUzqBMZ9F/tr.yaml].
ERROR: (gcloud.dns.record-sets.transaction.add) unrecognized arguments: -fafhnTHWHV427xobH9hwb4bts4-52PAtmFVvFxuBKI

To search the help text of gcloud commands, run:
  gcloud help -- SEARCH_TERMS
[Wed Mar 16 21:36:55 UTC 2022] _dns_gcloud_add_rrs: failed to add RRs
[Wed Mar 16 21:36:55 UTC 2022] Error add txt for domain:xxxxxxxx
[Wed Mar 16 21:36:55 UTC 2022] Please add '--debug' or '--log' to check more details.
[Wed Mar 16 21:36:55 UTC 2022] See: https://github.com/acmesh-official/acme.sh/wiki/How-to-debug-acme.sh
[Wed Mar 16 21:36:57 UTC 2022] It seems the CA server is busy now, let's wait and retry. Sleeping 1 seconds.
aamarques commented 1 year ago

@Neilpang is related to this commit ?