jenkinsci / jenkinsci/openstack-cloud-plugin

Unavailable cloud stops the provisioning process

Open
#340 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
49
Forks
97
Avg merge
13h 23m
Merged PRs (30d)
6

Description

### Jenkins and plugins versions report

Environment


```text
Jenkins 2.60.3
Plugin version : 2.61
```

### What Operating System are you using (both controller, and any agents involved in the problem)?

Controller :
I used the latest (currently 2.60.3 ) docker image of Jenkins.
https://hub.docker.com/_/jenkins?tab=tags
Linux

Agents (not involved in the problem): Centos 7

### Reproduction steps

1. Launch and setup a Jenkins instance in a docker container
a. Command : docker run --name jenkinsInstance -p 8080:8080 -p 50000:50000 -v /var/jenkins_home jenkins
b. Setting up Jenkins : https://www.jenkins.io/doc/book/installing/docker/
2. Install the OpenStack cloud plugin via the Manage plugin tabs
3. Configure 2 clouds with the same label (in the templates)
4. Create a multibranch pipeline project and link it to a git project :
a. Example : https://gitlab.com/AnderwanSAM/demo-project/-/tree/master
b. Details: The project has 4 branches. Each of them has a Jenkins file with jobs specifying the same label
5. Scan the project
6. Remove the credentials of the first cloud
7. try to build the jobs

### Expected Results

The first cloud is unavailable. Hence the jobs should be built using the next available cloud with the same label.

### Actual Results

The jobs hangs. The plugin ignores the failures and keep trying to provision nodes from the cloud that is down.

### Anything else?

We have investigated and found that the exception thrown by getOpenStack() is not handled in the getAvailableTemplateProvider
method. I believe this is what causes the problem.

- getOpenStack() : https://github.com/jenkinsci/openstack-cloud-plugin/blob/master/plugin/src/main/java/jenkins/plugins/openstack/compute/JCloudsCloud.java#L483

- getAvailableTemplateProvider : https://github.com/jenkinsci/openstack-cloud-plugin/blob/master/plugin/src/main/java/jenkins/plugins/openstack/compute/JCloudsCloud.java#L258

Suggestion : handle the exception and return an empty queue. See this pull request :

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.