jenkins-x / jx

Jenkins X provides automated CI+CD for Kubernetes with Preview Environments on Pull Requests using Cloud Native pipelines from Tekton
https://jenkins-x.io/
Apache License 2.0
4.58k stars 788 forks source link

Attempting to create a quickstart whilst not in dev environment gives an obscure error #3360

Closed tdcox closed 4 years ago

tdcox commented 5 years ago

Summary

Old chestnut with new symptoms here...

If you forget to switch to the dev environment and try to create a new quickstart-based project, the wizard process will get right to the end and then fail to set up the webhook with the following very obscure error:

Creating GitHub webhook for tdcox/test109 for url http://hook.jx.34.76.82.107.nip.io/hook
error: configmaps "ingress-config" not found

Should the quickstart command perhaps force a jx env dev or at least warn you that it will not work because you are in the wrong context?

Steps to reproduce the behavior

➜ jx env staging
➜ jx create quickstart
Using Git provider GitHub at https://github.com
? Do you wish to use tdcox as the Git user name? Yes

About to create repository  on server https://github.com with user tdcox
? Which organisation do you want to use? tdcox
? Enter the new repository name:  test109

Creating repository tdcox/test109
? select the quickstart you wish to create golang-http
Generated quickstart at /Users/terry/Documents/code/jxtesting/test109
### NO charts folder /Users/terry/Documents/code/jxtesting/test109/charts/golang-http
Created project at /Users/terry/Documents/code/jxtesting/test109

The directory /Users/terry/Documents/code/jxtesting/test109 is not yet using git
? Would you like to initialise git now? Yes
? Commit message:  Initial import

Git repository created
performing pack detection in folder /Users/terry/Documents/code/jxtesting/test109
--> Draft detected Go (65.746753%)
selected pack: /Users/terry/.jx/draft/packs/github.com/jenkins-x-buildpacks/jenkins-x-kubernetes/packs/go
replacing placeholders in directory /Users/terry/Documents/code/jxtesting/test109
app name: test109, git server: github.com, org: tdcox, Docker registry org: tdcox
skipping directory "/Users/terry/Documents/code/jxtesting/test109/.git"
Pushed Git repository to https://github.com/tdcox/test109

Creating GitHub webhook for tdcox/test109 for url http://hook.jx.34.76.82.107.nip.io/hook
error: configmaps "ingress-config" not found

Expected behavior

Either create a new application instance, or fail with an error about being in the wrong environment.

Actual behavior

Code created locally and in GitHub but no hooks set up and no build started.

Jx version

The output of jx version is:

NAME               VERSION
jx                 1.3.980
jenkins x platform 0.0.3542
Kubernetes cluster v1.11.7-gke.4
kubectl            v1.13.4
helm client        Client: v2.13.0+g79d0794
git                git version 2.21.0
Operating System   Mac OS X 10.13.6 build 17G4015

Jenkins type

With Tekton and Kaniko

Kubernetes cluster

jx create cluster gke \
--cluster-name='d27' \
--default-admin-password='xxxxx' \
--environment-git-owner='tdcox' \
--enhanced-apis=true \
--enhanced-scopes=true \
--git-username='tdcox' \
--git-private=false \
--kaniko=true \
--labels='demo=true' \
--machine-type='n1-standard-4' \
--max-num-nodes='3' \
--min-num-nodes='2' \
--no-tiller=true \
--preemptible=true \
--project-id='jx-mar19' \
--prow=true \
--skip-login=true \
--tekton=true \
--vault=false \
--zone='europe-west1-d'

Operating system / Environment

Mac OS X 10.13.6

jenkins-x-bot commented 5 years ago

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close. If this issue is safe to close now please do so with /close. Provide feedback via https://jenkins-x.io/community. /lifecycle stale

jenkins-x-bot commented 5 years ago

Stale issues rot after 30d of inactivity. Mark the issue as fresh with /remove-lifecycle rotten. Rotten issues close after an additional 30d of inactivity. If this issue is safe to close now please do so with /close. Provide feedback via https://jenkins-x.io/community. /lifecycle rotten

ccojocar commented 4 years ago

@tdcox Can we close this one? Is it still reproducible when you are using boot?

tdcox commented 4 years ago

@ccojocar It's actually a worse experience now, as if you are not in the jx namespace, you are asked to create a new API token for your git account before you even get that far.

ccojocar commented 4 years ago

Yeah, I think the create quickstart and import is requesting now a local local git token different from the pipeline token, unfortunately this is not consistent throughout all commands when executed locally.

jenkins-x-bot commented 4 years ago

Rotten issues close after 30d of inactivity. Reopen the issue with /reopen. Mark the issue as fresh with /remove-lifecycle rotten. Provide feedback via https://jenkins-x.io/community. /close

jenkins-x-bot commented 4 years ago

@jenkins-x-bot: Closing this issue.

In response to [this](https://github.com/jenkins-x/jx/issues/3360#issuecomment-598388580): >Rotten issues close after 30d of inactivity. >Reopen the issue with `/reopen`. >Mark the issue as fresh with `/remove-lifecycle rotten`. >Provide feedback via https://jenkins-x.io/community. >/close Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.