Closed Bug 1601149 Opened 5 years ago Closed 5 years ago

Troubleshoot github_private_pem regression in v24

Categories

(Taskcluster :: Operations and Service Requests, task)

task
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: edunham, Assigned: dustin)

Details

Taskcluster staging is currently broken on v24 with failures in the github service of the form Error: Malformed GITHUB_PRIVATE_PEM: must match /-----BEGIN RSA PRIVATE KEY-----(\n|\\n).*(\n|\\n)-----END RSA PRIVATE KEY-----(\n|\\n)?/; got a value of length 1679.

I suspect the env var json encoding changes in v24 may be relevant.

Some hints from Slack: The Helm is:

GITHUB_PRIVATE_PEM: '{{ if typeIs "<nil>" .Values.github.github_private_pem }}{{ else }}{{ if typeIs "string" .Values.github.github_private_pem }}{{ .Values.github.github_private_pem | b64enc }}{{ else }}{{ .Values.github.github_private_pem | toJson | b64enc }}{{ end }}{{ end }}'

The input YAML, with secret bits replaced by pwgen rubbish of course, is of the form:

 github:
            github_private_pem: |
                -----BEGIN RSA PRIVATE KEY-----
                es1ho3hh5ae/ghe
                ...
                up4e/ph7wie
                -----END RSA PRIVATE KEY-----

Filing this as a reminder to take a look tomorrow.

Flags: needinfo?(dustin)

I used exactly that yaml in my dev env, and:

(go1.12.13) (v12.13.1) (sandbox) dustin@lamport ~/p/taskcluster [master] $ kubectl get secret taskcluster-github -oyaml                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
apiVersion: v1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
data:
  ...
  GITHUB_PRIVATE_PEM: LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLQplczFobzNoaDVhZS9naGUKLi4uCnVwNGUvcGg3d2llCi0tLS0tRU5EIFJTQSBQUklWQVRFIEtFWS0tLS0tCg==
...
(go1.12.13) (v12.13.1) (sandbox) dustin@lamport ~/p/taskcluster [master] $ echo LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLQplczFobzNoaDVhZS9naGUKLi4uCnVwNGUvcGg3d2llCi0tLS0tRU5EIFJTQSBQUklWQVRFIEtFWS0tLS0tCg== | base64 -d; echo                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
-----BEGIN RSA PRIVATE KEY-----                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
es1ho3hh5ae/ghe
...
up4e/ph7wie
-----END RSA PRIVATE KEY-----

but the github service doesn't ingest that correctly. I can reproduce in a test.

Assignee: edunham → dustin
Flags: needinfo?(dustin)

As a workaround, this did work for me:

github:
  github_private_pem: -----BEGIN RSA PRIVATE KEY-----\nes1ho3hh5ae/ghe\n...\nup4e/ph7wie\n-----END RSA PRIVATE KEY-----

That said, once the above is merged we can ship a 24.0.1 and just deploy that -- that seems the better solution.

Landed, and 24.0.1 is in the oven, so let's just plan to deploy that and not 24.0.0.

24.0.1 is out. edunham, can you confirm it addresses this issue?

Flags: needinfo?(edunham)

I'll try 24.0.1 on stage and see what it does now

Flags: needinfo?(edunham)
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.