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.57k stars 787 forks source link

Create Devpod fails #4415

Closed dhruv3 closed 4 years ago

dhruv3 commented 5 years ago

Summary

I am using an Enterprise Git account(which has multi-factor auth). When I run "jx create devpod" it fails and gives an error listed under "Actual behavior" section.

Steps to reproduce the behavior

cd MyRepoName
jx create devpod

MyRepoName is just node-http app we get from quickstart.

Expected behavior

I can source code my code in Web IDE and edit environment is created.

Actual behavior

Usage:
  jx step create [flags] [options]
Use "jx <command> --help" for more information about a given command.
Use "jx options" for a list of global command-line options (applies to all commands).

command terminated with exit code 1
ERROR: Error: Command failed  kubectl exec -it -n jx -c devpod ec2-user-nodejs -- /bin/sh -c mkdir -p /workspace
cd /workspace
if which yum &> /dev/null; then yum install -q -y bash-completion bash-completion-extra; fi && if which apt-get &> /dev/null; then apt-get install -qq bash-completion; fi && mkdir -p ~/.jx && jx completion bash > ~/.jx/bash && echo "source ~/.jx/bash" >> ~/.bashrc && jx step create devpod workspace --vscode && jx step git credentials && git config --global credential.helper store && if ! [ -d "appRangers" ]; then git clone https://github.<Enterprise ID>.com/MyUserName/MyRepoName.git; fi && cd MyRepoName && bash

Jx version

2.0.328

The output of jx version is:

NAME               VERSION
jx                 2.0.328
jenkins x platform 2.0.330
Kubernetes cluster v1.12.6-eks-d69f1b
kubectl            v1.13.2
helm client        Client: v2.14.1+g5270352
git                git version 2.14.5
Operating System   Unkown Linux distribution Linux version 4.14.123-86.109.amzn1.x86_64 (mockbuild@koji-pdx-corp-builder-64004) (gcc version 7.2.1 20170915 (Red Hat 7.2.1-2) (GCC)) #1 SMP Mon Jun 10 19:44:53 UTC 2019

Jenkins type

Kubernetes cluster

EKS

Operating system / Environment

Linux. EC2 instance.

jstrachan commented 5 years ago

whats the actual output of jx create devpod? I don't really understand the above log snippet I'm afraid. Whats the output of jx version?

dhruv3 commented 5 years ago

My jx create devpod output:

[ec2-user@ip-Address MyAppName]$ jx create devpod
performing pack detection in folder /home/ec2-user/MyAppName
--> Draft detected YAML (47.801764%)
--> Could not find a pack for YAML. Trying to find the next likely language match...
--> Draft detected Perl (17.349207%)
--> Could not find a pack for Perl. Trying to find the next likely language match...
--> Draft detected RPM Spec (15.168902%)
--> Could not find a pack for RPM Spec. Trying to find the next likely language match...
--> Draft detected Coq (5.242774%)
--> Could not find a pack for Coq. Trying to find the next likely language match...
--> Draft detected Smarty (3.700782%)
--> Could not find a pack for Smarty. Trying to find the next likely language match...
--> Draft detected JavaScript (3.005092%)
selected pack: /home/ec2-user/.jx/draft/packs/github.com/jenkins-x-buildpacks/jenkins-x-kubernetes/packs/javascript
Creating a DevPod of label: nodejs
Created pod ec2-user-nodejs - waiting for it to be ready...

job.batch "exposecontroller" deleted
configmap "exposecontroller" deleted
serviceaccount "exposecontroller" deleted
role.rbac.authorization.k8s.io "exposecontroller" deleted
rolebinding.rbac.authorization.k8s.io "exposecontroller" deleted
Pod ec2-user-nodejs is now ready!
You can open other shells into this DevPod via jx create devpod

You can edit your app using the Web IDE at: http://ec2-user-nodejs-ide.jx.jenkinsx.MYURL

You can access the DevPod from your browser via the following URLs:
* http://ec2-user-nodejs-port-3000.jx.jenkinsx.MYURL
* http://ec2-user-nodejs-port-8080.jx.jenkinsx.MYURL
* http://ec2-user-nodejs-port-9229.jx.jenkinsx.MYURL

Attempting to install Bash Completion into DevPod
Error from server (BadRequest): pod ec2-user-nodejs does not have a host assigned
ERROR: Error: Command failed  kubectl exec -it -n jx -c ide ec2-user-nodejs -- /bin/sh -c mkdir -p /workspace
cd /workspace
echo "https://GitUserName:APIToken@github.ENTERPRISE.com/
http://GitUserName:APIToken@github.ENTERPRISE.com/
https://GitUserName:APIToken@github.com
http://GitUserName:APIToken@github.com
" >> ~/.git-credentials&&git config --global credential.helper store&&git config --global user.name "GitUserName"&&git config --global user.email "GitUserName@ENTERPRISE.com"&& git config --global push.default simple
error: exit status 1

My jx version output:

NAME               VERSION
jx                 2.0.329
jenkins x platform 2.0.330
Kubernetes cluster v1.12.6-eks-d69f1b
kubectl            v1.13.2
helm client        Client: v2.14.1+g5270352
git                git version 2.14.5
Operating System   Unkown Linux distribution Linux version 4.14.123-86.109.amzn1.x86_64 (mockbuild@koji-pdx-corp-builder-64004) (gcc version 7.2.1 20170915 (Red Hat 7.2.1-2) (GCC)) #1 SMP Mon Jun 10 19:44:53 UTC 2019
tdcox commented 5 years ago

@jstrachan I was seeing errors like this when testing the machine-learning builder images as devpods. The bash shell was failing to run due to a circular dependency in the bash config files. ~/.bashrc or ~/.bash_profile was being invoked first and then invoking a series of files in /etc, one of which invoked the initial file in ~ again.

deanesmith commented 5 years ago

/area jenkins

jenkins-x-bot commented 4 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 4 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

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