Jx: Error during jx step changelog

Created on 27 Mar 2019  路  12Comments  路  Source: jenkins-x/jx

Summary

jx step changelog is outputting the following error:

Failed to enrich commits with issues: User.jenkins.io "" is invalid: metadata.name: Required value: name or generateName is required

Steps to reproduce the behavior

Execute a pipeline build on master containing jx step changelog.

Expected behavior

No errors.

Actual behavior

An error.

Jx version

The output of jx version is:

NAME               VERSION
jx                 1.3.1011
jenkins x platform 0.0.3629
Kubernetes cluster v1.11.7-gke.12
kubectl            v1.12.0
helm client        v2.11.0+g2e55dbe
helm server        v2.12.2+g7d2b0c7
git                git version 2.18.0
Operating System   Mac OS X 10.14.2 build 18C54

Jenkins type

  • [ ] Classic Jenkins
  • [X] Serverless Jenkins

Kubernetes cluster


GKE - jx create cluster gke

Operating system / Environment


macOS

arecli kinbug prioritimportant-soon

Most helpful comment

We're having the same issue:

Failed to enrich commits with issues: User.jenkins.io "-0" is invalid: metadata.name: Invalid value: "-0": a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')
Failed to enrich commits with issues: User.jenkins.io "-0" is invalid: metadata.name: Invalid value: "-0": a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')

Running jenkins-x-platform version 0.0.3737.

All 12 comments

Having debugged a little, it is attempting to resolve a jx user for the merge commit by jenkins-x-bot. Having failed to find one, it is then attempting to create a new user. This fails because CreateUser is attempting to use the github login name as the kube resource name:
https://github.com/jenkins-x/jx/blob/4fb65371b5f7a8e8614cdde8652b6625416447a8/pkg/users/users.go#L38

But the git user is created without a login because it is just taken from the commit history:
https://github.com/jenkins-x/jx/blob/4fb65371b5f7a8e8614cdde8652b6625416447a8/pkg/users/git.go#L25

I've reproduced this issue

We're having the same issue:

Failed to enrich commits with issues: User.jenkins.io "-0" is invalid: metadata.name: Invalid value: "-0": a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')
Failed to enrich commits with issues: User.jenkins.io "-0" is invalid: metadata.name: Invalid value: "-0": a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')

Running jenkins-x-platform version 0.0.3737.

Same issue: Failed to enrich commits with issues: User.jenkins.io "" is invalid: metadata.name: Required value: name or generateName is required

NAME VERSION
jx 2.0.5
jenkins x platform 0.0.3877

I think this is fixed now after using valid k8s names for users

How is the fix?
We are experiencing this issue just overnight, without any change in JX's platform or k8s cluster. We had another JX PoC cluster and it's algo failing there.

What's failing is jx preview with error error: User.****.io "" is invalid: metadata.name: Required value: name or generateName is required
It fails in all projects, all branches, for all users (we use Google OAuth Login plugin) and with any pod builder (python, node, etc..)
We tried with jx versions: 2.0.118 and 2.0.185

The same issue with 2.0.204. Any ideas on how to fix that?

The same issue with 2.0.204. Any ideas on how to fix that?

Seems like it was a problem with bitbucket cloud itself because everything it working now, without any changes from my side.

@alexvolsh same thing over here! Suddenly builds started to pass without any change at all. Though BitBucket has not make any statement at all.

The same issue, but for a preview.

@lgg42 have you updated jx version?

Facing the same issue. Any update on this ?

@kadryomar there is no news here
https://github.com/jenkins-x/jx/issues/2149

Was this page helpful?
0 / 5 - 0 ratings