Skip to content
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

Openshift 3.5 : Multiple ImageStreamTags found for name che when launching Java-MySQl Multi Machine workspace #6500

Closed
hbhargav opened this issue Sep 29, 2017 · 4 comments
Assignees
Labels
kind/bug Outline of a bug - must adhere to the bug report template.

Comments

@hbhargav
Copy link

I've setup Openshift 3.5 & running Che 5.18.0 on the same.
When I launh a multi machine workspace i.e. Java-MySQL, che reports an error stating "Multiple ImageStreamTags found for name che"

$oc get is

NAME DOCKER REPO TAGS
eclipse_mysql eclipse/mysql latest,che-ws-etisvb14x536bo800mhavmqgpn2n1t9l
eclipse_ubuntu_jdk8 eclipse/ubuntu_jdk8 che-ws-etisvb14x536bo80e4hp2bwgrr2wefqn,latest,qa

Reproduction Steps:
Setup OS v3.5
Run Che 5.18.0
Launch multi-machine workspace i.e. Java-MySQL

OS and version:
CentOS 7.3

Diagnostics:
I see the issue is coming from OpenShiftConnect, getImageStreamTagFromRepo method

String imageTagTrimmed =
imageStreamTagName.length() > 20 ? imageStreamTagName.substring(0, 20) :
imageStreamTagName

Since, the above code trims the imageStreamTagName to 20 characters

Tag Name for eclipse_mysql image stream changes from che-ws-etisvb14x536bo800mhavmqgpn2n1t9l to che-ws-etisvb14x536b

Tag Name for eclipse_ubuntu_jdk8 image stream changes from che-ws-etisvb14x536bo80e4hp2bwgrr2wefqn to che-ws-etisvb14x536b

In the following piece of code
List imageStreamTags =
imageStreams
.stream()
.filter(e -> e.getMetadata().getName().contains(imageTagTrimmed))
.map(e -> e.getMetadata().getName())
.collect(Collectors.toList());

We are checking for trimmed image tag in both the images streams and adding it to a list.
Now the list has 2 entries which enters the ELSE condition in the following code & throws exception

if (imageStreamTags.size() < 1) {
throw new OpenShiftException(
String.format("ImageStreamTag %s not found!", imageStreamTagName));
} else if (imageStreamTags.size() > 1) {
throw new OpenShiftException(
String.format("Multiple ImageStreamTags found for name %s", imageStreamTagName));
}

We should either increase the trim to 30 characters or have check which includes image stream name along with trimmed image tag.

@ibuziuk
Copy link
Member

ibuziuk commented Sep 29, 2017

related rh-che issue - redhat-developer/rh-che#334

@gorkem
Copy link
Contributor

gorkem commented Sep 29, 2017

I can also reproduce this easily on minishift.

@ibuziuk ibuziuk self-assigned this Oct 4, 2017
ibuziuk added a commit to ibuziuk/che that referenced this issue Oct 5, 2017
…creation

Signed-off-by: Ilya Buziuk <ibuziuk@redhat.com>
@ibuziuk
Copy link
Member

ibuziuk commented Oct 5, 2017

PR with hot fix is sent - #6604
Note that it will be possible to create Java-MySQl Multi Machine workspace only on minishift.
Here is a separate issue for making Java-MySQl stack usable on osio - redhat-developer/rh-che#364

ibuziuk added a commit that referenced this issue Oct 9, 2017
Signed-off-by: Ilya Buziuk <ibuziuk@redhat.com>
@ibuziuk
Copy link
Member

ibuziuk commented Oct 9, 2017

PR is merged - closing

@ibuziuk ibuziuk closed this as completed Oct 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Outline of a bug - must adhere to the bug report template.
Projects
None yet
Development

No branches or pull requests

4 participants