redhat-developer / openshift-vsts

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

OC Setup task fails (is this extension supported?) #187

Open andresmmujica opened 2 years ago

andresmmujica commented 2 years ago

Hey guys, I'm trying to connect my ADO Release to OpenShift but the oc setup task fails with this error

2022-02-01T01:36:23.8337587Z ##[section]Starting: oc-setup 
2022-02-01T01:36:23.8567729Z ==============================================================================
2022-02-01T01:36:23.8568341Z Task         : Install and setup oc
2022-02-01T01:36:23.8568821Z Description  : Installs oc and configures the PATH and KUBECONFIG environment variables.
2022-02-01T01:36:23.8569107Z Version      : 2.0.13
2022-02-01T01:36:23.8569448Z Author       : Red Hat
2022-02-01T01:36:23.8570043Z Help         : See [getting started](https://github.com/redhat-developer/openshift-vsts/blob/master/docs/getting-started.md)
2022-02-01T01:36:23.8570460Z ==============================================================================
2022-02-01T01:36:24.2688375Z [command]/usr/bin/curl -s -L -o /home/vsts/work/r1/a/.download/openshift-client-linux.tar.gz https://mirror.openshift.com/pub/openshift-v4/clients/ocp/latest/openshift-client-linux.tar.gz
2022-02-01T01:36:24.5571353Z 
2022-02-01T01:36:25.6946397Z [command]/home/vsts/work/r1/a/.download/oc login --certificate-authority=*** --token *** https://api.sandboxXXXXXXXXX
2022-02-01T01:36:25.7505045Z error: open ***: no such file or directory
2022-02-01T01:36:25.7524283Z 
2022-02-01T01:36:25.7628552Z ##[error]The process '/home/vsts/work/r1/a/.download/oc' failed with exit code 1
2022-02-01T01:36:25.7810229Z ##[section]Finishing: oc-setup 

Any hints to solve it? Can't see anything wrong, there's not much to configure, so...

nitesh-jaswal commented 2 years ago

An exit code 1 implied that the oc command could not resolve the domain name provided in my case. I am currently facing this issue. Find the log below

2022-02-13T21:21:50.2106908Z` ##[section]Starting: ocsetup 2022-02-13T21:21:50.2131658Z ============================================================================== 2022-02-13T21:21:50.2132233Z Task : Install and setup oc 2022-02-13T21:21:50.2132658Z Description : Installs oc and configures the PATH and KUBECONFIG environment variables. 2022-02-13T21:21:50.2133088Z Version : 2.0.13 2022-02-13T21:21:50.2133385Z Author : Red Hat 2022-02-13T21:21:50.2133882Z Help : See getting started 2022-02-13T21:21:50.2134400Z ============================================================================== 2022-02-13T21:21:50.6348637Z [command]/usr/bin/curl -s -L -o /home/vsts/work/1/s/.download/openshift-client-linux.tar.gz https://mirror.openshift.com/pub/openshift-v4/clients/ocp/latest/openshift-client-linux.tar.gz 2022-02-13T21:21:51.7788647Z 2022-02-13T21:21:53.1653565Z [command]/home/vsts/work/1/s/.download/oc login --insecure-skip-tls-verify --token *** https://api.xxx.xxx.com:6443/ 2022-02-13T21:22:23.2431093Z error: dial tcp 100.xx.xx.xxx:6443: i/o timeout - verify you have provided the correct host and port and that the server is currently running. 2022-02-13T21:22:23.2527919Z 2022-02-13T21:22:23.2733181Z ##[error]The process '/home/vsts/work/1/s/.download/oc' failed with exit code 1 2022-02-13T21:22:23.2855960Z ##[section]Finishing: ocsetup

Were you able to find a fix for your issue? It is sad that the developers have stopped responding and helping long back.

gorkem commented 2 years ago

@lstocchi can you check this. I suspect this is due to changes to mirror site

lstocchi commented 2 years ago

I see two different errors here. The first is that the pipeline tries to find oc in a wrong path. It should look at /home/vsts/work/1/s/ instead of /home/vsts/work/r1/a/. The second there is a timeout.

I tried and it works fine for me

2022-02-15T09:25:39.2154496Z ##[section]Starting: ocsetup
2022-02-15T09:25:39.2163291Z ==============================================================================
2022-02-15T09:25:39.2163693Z Task         : Install and setup oc
2022-02-15T09:25:39.2164133Z Description  : Installs oc and configures the PATH and KUBECONFIG environment variables.
2022-02-15T09:25:39.2164465Z Version      : 2.0.13
2022-02-15T09:25:39.2164731Z Author       : Red Hat
2022-02-15T09:25:39.2165117Z Help         : See [getting started](https://github.com/redhat-developer/openshift-vsts/blob/master/docs/getting-started.md)
2022-02-15T09:25:39.2165634Z ==============================================================================
2022-02-15T09:25:40.1312255Z [command]/usr/bin/curl -s -L -o /home/vsts/work/1/s/.download/openshift-client-linux.tar.gz https://mirror.openshift.com/pub/openshift-v4/clients/ocp/latest/openshift-client-linux.tar.gz
2022-02-15T09:25:41.2000280Z 
2022-02-15T09:25:42.4321829Z [command]/home/vsts/work/1/s/.download/oc login --insecure-skip-tls-verify --token *** https://api.******.openshiftapps.com:6443/
2022-02-15T09:25:42.9505210Z Logged into "https://api.*****.openshiftapps.com:6443" as "lstocchi" using the token provided.
2022-02-15T09:25:42.9506109Z 
2022-02-15T09:25:43.1256248Z You have access to the following projects and can switch between them with 'oc project <projectname>':
2022-02-15T09:25:43.1259606Z 
2022-02-15T09:25:43.1261817Z   * lstocchi-dev
2022-02-15T09:25:43.1265517Z     lstocchi-stage
2022-02-15T09:25:43.1266182Z 
2022-02-15T09:25:43.1267614Z Using project "lstocchi-dev".
2022-02-15T09:25:43.2140125Z Welcome! See 'oc help' to get started.
2022-02-15T09:25:43.2160267Z 
2022-02-15T09:25:43.2427539Z ##[section]Finishing: ocsetup

@andresmmujica could you please copy/paste your pipeline?

@nitesh-jaswal have you tried to run the login command locally? Does it work fine? It's like the cluster is not reachable from the vm created by Azure. Have you tried with a local agent? If it works, the problem is with the server configuration i guess.