New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: Create a team problem #2381

Closed
onuryartasi opened this Issue Nov 29, 2018 · 10 comments

Comments

Projects
None yet
4 participants
@onuryartasi
Copy link

onuryartasi commented Nov 29, 2018

Summary

When I want to creat team , i getting error

Steps to reproduce the behavior

jx create team teamname

Jx version

The output of jx version is:
jx 1.3.612
jenkins x platform 0.0.2940
Kubernetes cluster v1.11.2-gke.18
kubectl v1.12.3
helm client v2.11.0+g2e55dbe
helm server v2.11.0+g2e55dbe
git git version 2.17.1
Operating System Ubuntu 18.04.1 LTS

OUTPUT

jx log jenkins-x-controllerteam

Using the admin namespace jx
Setting up git credentials
Generated Git credentials file /home/jenkins/git/credentials
Watching for teams in all namespaces
ERROR: logging before flag.Parse: W1129 18:27:47.039400       1 reflector.go:341] github.com/jenkins-x/jx/pkg/jx/cmd/controller_team.go:151: watch of *v1.Team ended with: too old resource version: 22874 (23733)
Adding / Updating Team onur, Namespace jx, Status 'Pending'
Adding / Updating Team crm, Namespace jx, Status 'Pending'

jx controller team

Using the admin namespace jx
Watching for teams in all namespaces
Adding / Updating Team crm, Namespace jx, Status 'Pending'
Adding / Updating Team onur, Namespace jx, Status 'Pending'

jx get team

NAME
jx

Kubernetes cluster

1.11.2-gke.18

What kind of Kubernetes cluster are you using & how did you create it?
Create gke on gcloud

Operating system / Environment

Ubuntu 18.04.1 LTS

Expected behavior

Creating multiple team on cluster

Actual behavior

doesn't create team and getting error

@jtnord

This comment has been minimized.

Copy link
Member

jtnord commented Nov 30, 2018

slightly different error locally (cluster created from terraform)

Cloning the Jenkins X cloud environments repo to /root/.jx/cloud-environments
Enumerating objects: 8, done.
Counting objects: 100% (8/8), done.
Compressing objects: 100% (6/6), done.
Total 1227 (delta 2), reused 6 (delta 2), pack-reused 1219
Generated helm values /root/.jx/extraValues.yaml
Installing Jenkins X platform helm chart from: /root/.jx/cloud-environments/env-gke
Unable to install jx for team test1: failed to add the jenkinx-x helm repo: failed to check if the repository with URL 'https://chartmuseum.build.cd.jenkins-x.io' is missing: failed to list the repositories: failed to list repositories: failed to run 'helm repo list' command in directory '', output: 'Error: Couldn't load repositories file (/root/.helm/repository/repositories.yaml).
You might need to run `helm init` (or `helm init --client-only` if tiller is already installed)': exit status 1
ERROR: logging before flag.Parse: W1130 10:24:31.966704       1 reflector.go:341] github.com/jenkins-x/jx/pkg/jx/cmd/controller_team.go:151: watch of *v1.Team ended with: too old resource version: 167971 (167973)
@jtnord

This comment has been minimized.

Copy link
Member

jtnord commented Dec 3, 2018

@jtnord

This comment has been minimized.

Copy link
Member

jtnord commented Dec 3, 2018

using the latest jx

 ☸ jamesn-rbac:jx C:\workarea\source>jx log jenkins-x-controllerteam
Waiting for a running pod in namespace jx with labels app=controllerteam,release=jenkins-x
Found newest pod: jenkins-x-controllerteam-5fd5bd5db5-pb56l
Using the admin namespace jx
Setting up git credentials
Generated Git credentials file /home/jenkins/git/credentials
Watching for teams in all namespaces
Adding / Updating Team jx, Namespace jx, Status 'Error'
Adding / Updating Team test1, Namespace jx, Status 'Pending'
Adding / Updating Team testfromui, Namespace jx, Status 'Pending'
Adding / Updating Team test1, Namespace test1, Status 'Error'
Adding / Updating Team testfromui, Namespace testfromui, Status 'Error'
Adding / Updating Team bob, Namespace jx, Status ''
Namespace bob created
ERROR: logging before flag.Parse: E1203 13:42:11.664927       1 runtime.go:66] Observed a panic: "invalid memory address or nil pointer dereference" (runtime error: invalid memory address or nil pointer dereference)
/home/jenkins/go/pkg/mod/k8s.io/apimachinery@v0.0.0-20180621070125-103fd098999d/pkg/util/runtime/runtime.go:72
/home/jenkins/go/pkg/mod/k8s.io/apimachinery@v0.0.0-20180621070125-103fd098999d/pkg/util/runtime/runtime.go:65
/home/jenkins/go/pkg/mod/k8s.io/apimachinery@v0.0.0-20180621070125-103fd098999d/pkg/util/runtime/runtime.go:51
/usr/local/go/src/runtime/asm_amd64.s:522
/usr/local/go/src/runtime/panic.go:513
/usr/local/go/src/runtime/panic.go:82
/usr/local/go/src/runtime/signal_unix.go:390
/home/jenkins/go/src/github.com/jenkins-x/jx/pkg/jx/cmd/common.go:726
/home/jenkins/go/src/github.com/jenkins-x/jx/pkg/jx/cmd/controller_team.go:222
/home/jenkins/go/src/github.com/jenkins-x/jx/pkg/jx/cmd/controller_team.go:147
/home/jenkins/go/pkg/mod/k8s.io/client-go@v8.0.0+incompatible/tools/cache/controller.go:195
/home/jenkins/go/pkg/mod/k8s.io/client-go@v8.0.0+incompatible/tools/cache/controller.go:314
/home/jenkins/go/pkg/mod/k8s.io/client-go@v8.0.0+incompatible/tools/cache/delta_fifo.go:444
/home/jenkins/go/pkg/mod/k8s.io/client-go@v8.0.0+incompatible/tools/cache/delta_fifo.go:444
/home/jenkins/go/pkg/mod/k8s.io/client-go@v8.0.0+incompatible/tools/cache/controller.go:150
/home/jenkins/go/pkg/mod/k8s.io/client-go@v8.0.0+incompatible/tools/cache/controller.go:124
/home/jenkins/go/pkg/mod/k8s.io/apimachinery@v0.0.0-20180621070125-103fd098999d/pkg/util/wait/wait.go:133
/home/jenkins/go/pkg/mod/k8s.io/apimachinery@v0.0.0-20180621070125-103fd098999d/pkg/util/wait/wait.go:134
/home/jenkins/go/pkg/mod/k8s.io/apimachinery@v0.0.0-20180621070125-103fd098999d/pkg/util/wait/wait.go:88
/home/jenkins/go/pkg/mod/k8s.io/client-go@v8.0.0+incompatible/tools/cache/controller.go:124
/usr/local/go/src/runtime/asm_amd64.s:1333

@jtnord jtnord self-assigned this Dec 4, 2018

jtnord added a commit to jtnord/jx that referenced this issue Dec 4, 2018

fix(jenkins-x#2381) Do not panic when creating teams
`getDefaultAdminPassword(string)` was expecting (incorrectly) that the
CahcedKubeClient has already been created wich was not correct.

change this to use `KubeClient()` which will create the cache if not
already done and return it if it has.

@jtnord jtnord reopened this Dec 5, 2018

@jtnord

This comment has been minimized.

Copy link
Member

jtnord commented Dec 5, 2018

followup fix in #2425
however even with the team creation is not complete. (even thought it looks like it is)

Namespace sdlfuhsdlflsdyhf-production created
 Creating GitHub webhook for jtnord/environment-sdlfuhsdlflsdyhf-production for url https://redacted/hook
No service called jenkins-x-chartmuseum could be found so couldn't wire up the local auth file to talk to chart museum

Jenkins X installation completed successfully


        ********************************************************

             NOTE: Your admin password is: redacted

        ********************************************************



Your Kubernetes context is now set to the namespace: sdlfuhsdlflsdyhf
To switch back to your original namespace use: jx ns jx
For help on switching contexts see: https://jenkins-x.io/developing/kube-context/

To import existing projects into Jenkins:       jx import
To create a new Spring Boot microservice:       jx create spring -d web -d actuator
To create a new microservice from a quickstart: jx create quickstart
Adding / Updating Team sdlfuhsdlflsdyhf, Namespace jx, Status 'Pending'
@jtnord

This comment has been minimized.

Copy link
Member

jtnord commented Dec 7, 2018

this is mostly fixed. the team crd is not marked as complete in the admin namespace but is being created and update in the team namespace which is not correct.

@wwhurley

This comment has been minimized.

Copy link

wwhurley commented Dec 28, 2018

Not sure if this is the same issue, but when creating a new team it appears I don't get Jenkins installed for it.

$ jx get teams
NAME
default
jx

$ jx create team foo
Created Team: foo

$ jx get teams
NAME
default
foo
jx

$ jx team
? Pick Team:  foo
Now using team 'foo' on server 'https://xxx.xxx.xxx.xxx'.
$ jx diagnose
Running in namespace: foo
Jenkins X Version:
 NAME               VERSION
jx                 1.3.688
jenkins x platform 0.0.3125
Kubernetes cluster v1.10.9-gke.5
kubectl            v1.10.7
helm client        Client: v2.12.1+g02a47c7
git                git version 2.11.0
Operating System   Debian GNU/Linux 9.6 (stretch)
Unable to get the Jenkins X Status
? Pick service to open:   [Use arrows to move, type to filter]
> jenkins-x-chartmuseum
  jenkins-x-docker-registry
Cluster(cluster_jenkinsx): 2 nodes, memory 20% of 25399952Ki, cpu 64% of 7840m Jenkins not found
error: EOF exit status 1

$ jx team
? Pick Team:  jx
Now using team 'jx' on server 'https://xxx.xxx.xxx.xxx'.
$ jx diagnose
Running in namespace: jx
Jenkins X Version:
 NAME               VERSION
jx                 1.3.688
jenkins x platform 0.0.3125
Kubernetes cluster v1.10.9-gke.5
kubectl            v1.10.7
helm client        v2.12.1+g02a47c7
helm server        v2.12.1+g02a47c7
git                git version 2.11.0
Operating System   Debian GNU/Linux 9.6 (stretch)

Jenkins X Status:
 Jenkins X checks passed for Cluster(cluster_jenkinsx): 2 nodes, memory 20% of 25399952Ki, cpu 64% of 7840m. Jenkins is running at http://jenkins.jx.xxx.xxx.xxx.xxx.nip.io

I've attempted to install for that team using jx install -n foo as described at https://jenkins-x.io/architecture/cloud-native-jenkins/ however that flag doesn't appear to work.

$ jx install -n foo
Error: unknown shorthand flag: 'n' in -n
@jstrachan

This comment has been minimized.

Copy link
Member

jstrachan commented Jan 4, 2019

it sounds like the team controller hasn't completed installing the team yet - you can view the logs via jx logs - it can take a few minutes for the new team to be provisioned.

I've just fixed the docs on https://jenkins-x.io/architecture/cloud-native-jenkins/ - it was using -n when it looks like the abbreviation isn't yet supported so you have to use --namespace e.g. jx install --namespace foo

@wwhurley

This comment has been minimized.

Copy link

wwhurley commented Jan 10, 2019

I attempted to create a team again, not specifying the namespace and then watched the teamcontroller logs. Saw the following:

Creating staging Environment in namespace foo
Created environment staging
Namespace foo-staging created
 Unable to install jx for team foo: creating the environments: failed to create staging environment in namespace foo: Could not find any user auths for jenkins server http://jenkins.jx.0.0.0.0.nip.io has server URLs http://jenkins.foo.0.0.0.0.nip.io
Adding / Updating Team foo, Namespace jx, Status 'Pending'
Adding / Updating Team foo, Namespace jx, Status 'Error'
@jtnord

This comment has been minimized.

Copy link
Member

jtnord commented Jan 11, 2019

an install and a team are subtly different and I strongly beleive they will diverge more in the future.

I believe what @wwhurley is reporting is a different issue than what was originally reported and teams crd is now correctly updated and I can successfully create teams, as such I have created a new issue for this.

@jtnord

This comment has been minimized.

Copy link
Member

jtnord commented Jan 11, 2019

using the wrong namespace was fixed in #2469

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment