redhat-developer / openshift-vsts

OpenShift Extension for Azure DevOps.
Apache License 2.0
15 stars 20 forks source link

VSTS release with OpenShift Extention is failed #172

Closed qrshat closed 4 years ago

qrshat commented 4 years ago

Hello Team,

it's be more than 6 months we are using VSTS OpenShift extension to release on Red Hat OKD 3.1 platforms. During this time we never faced any problem related with VSTS OpenShift extention.

But unlikely the last week our releases start to fail because of VSTS OpenShift extention. When we check the VSTS release logs, we noticed "oc binary" that we are using to release on Red Hat OKD 3.1, download link was changed. After this change, "oc binary" not working properly and cause prbolem on our releases running on VSTS.

Could you please help us to solve problem or fix the "oc binary" .

You can see success and fail logs below:

The oc binary used by OpenShift extension that provide successful release: https://github.com/openshift/origin/releases/download/v3.11.0/openshift-origin-client-tools-v3.11.0-0cbc58b-linux-64bit.tar.gz

Logs: /datadrive01/LinuxAgent3/_work/r137/a/.download/openshift-origin-client-tools-v3.11.0-0cbc58b-linux-64bit.tar.gz https://github.com/openshift/origin/releases/download/v3.11.0/openshift-origin-client-tools-v3.11.0-0cbc58b-linux-64bit.tar.gz oc login --insecure-skip-tls-verify -u -p https://ocp1.fw.dteknoloji.com.tr:8443/

The oc binary used by OpenShift extension that provide failed release: https://mirror.openshift.com/pub/openshift-v4/clients/ocp/latest/openshift-client-linux.tar.gz

Logs: /datadrive01/LinuxAgent4/_work/r87/a/.download/openshift-client-linux.tar.gz https://mirror.openshift.com/pub/openshift-v4/clients/ocp/latest/openshift-client-linux.tar.gz oc login --insecure-skip-tls-verify -u *** -p asdf_43

thanks in advance

lstocchi commented 4 years ago

Hi @qrshat, it looks like you are still using an old version of the extension as we changed how the oc cli is downloaded long ago (November 2019). I can see you were downloading your oc from GitHub but we moved to mirror.openshift.com because of the exceeding API limit error users were facing. Maybe your code didn't update because we didn't change version of the task in the previous updates and Azure cached the old extension?? (no idea).

BTW it's like you are using the latest version of oc cli (v.4.4) with your OKD3.1, so i suggest you to declare explicitly the version of oc you want to use such as version: '3.11.3'

If you go here https://mirror.openshift.com/pub/openshift-v3/clients/ you can see all oc cli versions available to be used by the extension.

If it still doesn't work, could you please share the part of your pipeline where you use this extension? So i can verify if there are any issue. Let me know. Thank you

qrshat commented 4 years ago

Thanks for your kind and quick response @lstocchi.

We are using the latest version of extension which is 1.6.0.

We can't change the version and download URL of the extension that is in Azure market place. I guess Azure manages it by itself.

Our releases were worked without any problem 1.5.0 version. We didn't change anything on our release but they are not working as we expected in 1.6.0. So we think 1.6.0 version needs a fix.

Thanks again,

lstocchi commented 4 years ago

@qrshat i wasn't talking about changing the version of the extension to be used but the version of oc cli to be downloaded. Let's suppose you are using the oc-cmd task, you should have something like:

- task: oc-cmd@2
  inputs:
    connectionType: 'OpenShift Connection Service'
    openshiftService: 'My OpenShift'
    version: '3.11.3'
    cmd: 'get pods'
alionur07 commented 4 years ago

Hi Everyone,

I have also same issue. I dont know how can i resolve. Also i am using PAAS Azure Devops and i couldnt change any that extension version. Cause i dont have any permission for this operation.

I realized, my releases had been working until 25 April. I checked the extension updates and i guess my releases had been working until v 1.6.0.

I took screen shot of my releases. May be that could be helpful.

image

---Error LOG--- Login failed (401 Unauthorized) Verify you have provided correct credentials.

[error]Unhandled: ENOENT: no such file or directory, open

lstocchi commented 4 years ago

Hi @alionur07 , those logs are not so helpful. Have you updated your pipeline to make it work with the new extension 1.6.0? Now your task should look like:

- task: oc-cmd@2
  inputs:
    connectionType: 'OpenShift Connection Service'
    openshiftService: 'My OpenShift'
    version: '3.11.3'
    cmd: 'get pods'

If you can send me any other infos (logs or your pipeline) i can be more helpful. Thanks

qrshat commented 4 years ago

hanging t I got your point @lstocchi. But i can't change oc binary version of the release.

In release, we download oc binary and use required credential to authenticate OKD. After authentication we use command line command to change project and deploy yamls. We got errors in oc deployment and authentication step. But i don't see any settings to change oc binary version in this step. Because extension decide which version of the oc binary will be used for authentication. You can see related release log below;

2020-04-30T18:02:28.2764132Z ##[section]Starting: oc-setup 2020-04-30T18:02:28.2807389Z ============================================================================== 2020-04-30T18:02:28.2808321Z Task : Install and setup oc 2020-04-30T18:02:28.2809158Z Description : Installs oc and configures the PATH and KUBECONFIG environment variables. 2020-04-30T18:02:28.2809984Z Version : 2.0.13 2020-04-30T18:02:28.2810604Z Author : Red Hat 2020-04-30T18:02:28.2811572Z Help : See getting started 2020-04-30T18:02:28.2812929Z ============================================================================== 2020-04-30T18:02:28.6066680Z [command]/bin/curl -s -L -o /datadrive01/LinuxAgent1/_work/r257/a/.download/openshift-client-linux.tar.gz https://mirror.openshift.com/pub/openshift-v4/clients/ocp/latest/openshift-client-linux.tar.gz 2020-04-30T18:02:30.6573070Z 2020-04-30T18:02:31.8880318Z ##[error]Endpoint auth data not present: undefined 2020-04-30T18:02:31.8893442Z ##[error]Endpoint not present: undefined 2020-04-30T18:02:31.9147836Z ##[section]Finishing: oc-setup

lstocchi commented 4 years ago

@qrshat i still don't get why you cannot change oc binary version in your oc-setup (just add the version arg). If you use a number version you will also take advantage of the cache which will avoid downloading the same oc again and again

Back to the error.... the logs shows the same issue another user had and this is due to the fact that the task definition changed and azure is not smart enough to deal with that. Look here https://github.com/redhat-developer/openshift-vsts/issues/170

You just need to update your pipeline (any irrelevant change is good enough) and start it again. It should work.

qrshat commented 4 years ago

Thank you for your help @lstocchi. #170 clearify my mind. The problem is resolved. By the way i can change oc binary version.

Thanks again. I'm going close the issue.

alionur07 commented 4 years ago

@lstocchi thank you. It worked.

The situation was nonsense but it resolved. The problem was taking a long time of me :).