openshiftio / openshift.io

Red Hat OpenShift.io is an end-to-end development environment for planning, building and deploying modern applications.
https://openshift.io
97 stars 66 forks source link

Stack report not getting generated from build pipeline #4644

Open yzainee-zz opened 5 years ago

yzainee-zz commented 5 years ago

Issue Overview:

The stack report is not getting generated via the build pipeline. The problem is that when we try to get the github token via the auth API "https://auth.openshift.io/api/token?for=https://github.com" , by passing the OSIO token, we are getitng back "unauthorized_error" and hence we do not get the git hub token. Due to this, the 1st step of stack analysis, where we clone the github repo fails.

Note: This issue is observed only for "Node" ecosystem.

Logs snippet:

{"parent": {}, "task_id": "5c2695b6-0c67-4a47-b491-718c387530bc", "flow_name": "gitOperationsFlow", "node_args": {"request_id": "fc07a45168474eaf8d95b30b9ef85632", "ecosystem": "npm", "git_url": "https://github.com/yzainee/node-js-sample.git ", "is_modified_flag": {"is_modified": false}, "is_scan_enabled": "true", "gh_token": {"access_token": null}, "auth_key": "Bearer xxxx", "check_license": false}, "event": "TASK_START", "dispatcher_id": "b2ecc0f6-d681-44fc-aa36-ed536a9182f0", "task_name": "GitOperationTask", "queue": "prod_api_GitOperationTask_v0"}
--
  | 2018-12-17 05:38:41,046 [INFO] GitOperationTask: Worker flow initiated for git operations
  | 2018-12-17 05:38:41,054 [ERROR] GitOperationTask: Exception while cloning repo or generating files.
sbose78 commented 5 years ago

Go to settings and reconnect Github ? https://openshift.io/shbose/_settings ( should look something like this )

yzainee-zz commented 5 years ago

@sbose78 This is not an issue with the user's OSIO token, this is the issue with the OSIO token (offline) that we get during build pipeline flow

spaparaju commented 5 years ago

am not sure if using offline OSIO token is right approach (as the starting point) to clone repos.

yzainee-zz commented 5 years ago

@SriKrishnaPaparaju We dont use offline token to clone repos. The offline token is used when we call the auth APIs to get the github token. We then use the github token to clone the repos

sbose78 commented 5 years ago

osio hardcoded token is not used for github API calls. Only user's OSiO tokens could be used for such calls.