Jx: Unhelpful `jx promote` failure message when `jx env` not on `dev`

Created on 7 Mar 2018  路  7Comments  路  Source: jenkins-x/jx

Problem

jx promote fails with a message hard to understand when invoked with jx env not being on the dev environment.

WARNING: Failed to try detect the current Jenkins pipeline for cyrille-leclerc/demo-20180603-2000/master due to services "jenkins" not found
WARNING: No $JOB_NAME environment variable found so cannot record promotion activities into the PipelineActivity resources in kubernetes

Detailed logs with demo-20180603-2000



demo-20180603-2000 (master) $ jx env -b
Using environment 'production' in team 'jx' on server 'https://35.196.213.210'.


demo-20180603-2000 (master) $ jx promote --version 0.0.1 --env production
Promoting app demo-20180603-2000 version 0.0.1 to namespace jx-production
WARNING: Failed to try detect the current Jenkins pipeline for cyrille-leclerc/demo-20180603-2000/master due to services "jenkins" not found
WARNING: No $JOB_NAME environment variable found so cannot record promotion activities into the PipelineActivity resources in kubernetes
Using pipeline:  build: #
fatal: remote origin already exists.
No local changes to save
Switched to branch 'master'
Your branch is up to date with 'origin/master'.
Already up to date.
Found remote branch names master, promote-demo-20180603-2000-0.0.1, promote-my-spring-boot-app-20180306-0.0.2, promote-my-spring-boot-app-20180306-0.0.2-31902166-2174-11e8-b0d9-784f4386325d, HEAD -> origin/master, master, promote-demo-20180603-2000-0.0.1, promote-my-spring-boot-app-20180306-0.0.2, promote-my-spring-boot-app-20180306-0.0.2-31902166-2174-11e8-b0d9-784f4386325d
Switched to branch 'promote-demo-20180603-2000-0.0.1-be594c4c-220c-11e8-8e20-784f4386325d'
[promote-demo-20180603-2000-0.0.1-be594c4c-220c-11e8-8e20-784f4386325d 37f6cc7] Promote demo-20180603-2000 to version 0.0.1
 1 file changed, 8 insertions(+), 5 deletions(-)
Counting objects: 4, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 491 bytes | 491.00 KiB/s, done.
Total 4 (delta 2), reused 0 (delta 0)
remote: Resolving deltas: 100% (2/2), completed with 2 local objects.
To https://github.com/cyrille-leclerc/environment-iguanatopaz-production.git
 * [new branch]      HEAD -> promote-demo-20180603-2000-0.0.1-be594c4c-220c-11e8-8e20-784f4386325d
$ jx version
WARNING: Failed to find draft version: exit status 1
WARNING: Client: &version.Version{SemVer:"v0.9.0", GitCommit:"6a6b387d84cc7530b45bfff704bd1d71e36082ed", GitTreeState:"clean"}
2018/03/07 14:41:49 grpc: addrConn.resetTransport failed to create client transport: connection error: desc = "transport: dial tcp: missing address"; Reconnecting to { <nil>}
Error: cannot connect to draftd
NAME        VERSION
jx          1.0.118
Jenkins X   0.0.252
Kubernetes  v1.7.12-gke.1
Helm Client v2.8.1+g6af75a8
Helm Server v2.8.1+g6af75a8
Git         git version 2.15.1

Happy path

demo-20180603-2000 (master) $ jx promote --version 0.0.1 --env production
Promoting app demo-20180603-2000 version 0.0.1 to namespace jx-production
Using pipeline: cyrille-leclerc/demo-20180603-2000/master build: #1
fatal: remote origin already exists.
No local changes to save
Switched to branch 'master'
Your branch is up to date with 'origin/master'.
Already up to date.
Found remote branch names master, promote-demo-20180603-2000-0.0.1, promote-demo-20180603-2000-0.0.1-be594c4c-220c-11e8-8e20-784f4386325d, promote-my-spring-boot-app-20180306-0.0.2, promote-my-spring-boot-app-20180306-0.0.2-31902166-2174-11e8-b0d9-784f4386325d, HEAD -> origin/master, master, promote-demo-20180603-2000-0.0.1, promote-demo-20180603-2000-0.0.1-be594c4c-220c-11e8-8e20-784f4386325d, promote-my-spring-boot-app-20180306-0.0.2, promote-my-spring-boot-app-20180306-0.0.2-31902166-2174-11e8-b0d9-784f4386325d
Switched to branch 'promote-demo-20180603-2000-0.0.1-c6f459e6-220c-11e8-bad6-784f4386325d'
[promote-demo-20180603-2000-0.0.1-c6f459e6-220c-11e8-bad6-784f4386325d 37baee3] Promote demo-20180603-2000 to version 0.0.1
 1 file changed, 8 insertions(+), 5 deletions(-)
Counting objects: 4, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 490 bytes | 490.00 KiB/s, done.
Total 4 (delta 2), reused 0 (delta 0)
remote: Resolving deltas: 100% (2/2), completed with 2 local objects.
To https://github.com/cyrille-leclerc/environment-iguanatopaz-production.git
 * [new branch]      HEAD -> promote-demo-20180603-2000-0.0.1-c6f459e6-220c-11e8-bad6-784f4386325d
arepromote kinbug lifecyclrotten prioritimportant-soon

Most helpful comment

Same for jx import

$ jx env -b
Using environment 'production' in team 'jx' on server 'https://35.196.213.210'.
cleclerc spring-petclinic-master $ jx import
error: services "jenkins" not found
$ jx version
WARNING: Failed to find draft version: exit status 1
WARNING: Client: &version.Version{SemVer:"v0.9.0", GitCommit:"6a6b387d84cc7530b45bfff704bd1d71e36082ed", GitTreeState:"clean"}
2018/03/09 16:35:15 grpc: addrConn.resetTransport failed to create client transport: connection error: desc = "transport: dial tcp: missing address"; Reconnecting to { <nil>}
Error: cannot connect to draftd
NAME        VERSION
jx          1.0.126
Jenkins X   0.0.252
Kubernetes  v1.7.12-gke.1
Helm Client v2.8.1+g6af75a8
Helm Server v2.8.1+g6af75a8
Git         git version 2.15.1

All 7 comments

Same for jx import

$ jx env -b
Using environment 'production' in team 'jx' on server 'https://35.196.213.210'.
cleclerc spring-petclinic-master $ jx import
error: services "jenkins" not found
$ jx version
WARNING: Failed to find draft version: exit status 1
WARNING: Client: &version.Version{SemVer:"v0.9.0", GitCommit:"6a6b387d84cc7530b45bfff704bd1d71e36082ed", GitTreeState:"clean"}
2018/03/09 16:35:15 grpc: addrConn.resetTransport failed to create client transport: connection error: desc = "transport: dial tcp: missing address"; Reconnecting to { <nil>}
Error: cannot connect to draftd
NAME        VERSION
jx          1.0.126
Jenkins X   0.0.252
Kubernetes  v1.7.12-gke.1
Helm Client v2.8.1+g6af75a8
Helm Server v2.8.1+g6af75a8
Git         git version 2.15.1

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

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

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: Closing this issue.

In response to this:

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. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

This still seems to be an issue, I just did a promotion and I get the following warning.

WARNING: No $BUILD_NUMBER environment variable found so cannot record promotion activities into the PipelineActivity resources in kubernetes

Even i am getting error while i do :

jx promote my-app --version 2.1 --env production

Getting warning :

WARNING: No $BUILD_NUMBER environment variable found so cannot record promotion activities into the PipelineActivity resources in kubernetes

Was this page helpful?
0 / 5 - 0 ratings

Related issues

CobraFlow picture CobraFlow  路  5Comments

sourabhg picture sourabhg  路  4Comments

kevinsuperped picture kevinsuperped  路  5Comments

carlossg picture carlossg  路  4Comments

empath picture empath  路  3Comments